diff --git a/.gitignore b/.gitignore index 658c4d0d8ea..f487ea6dd29 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ scripts/*.js.map coverage/ internal/ **/.DS_Store +.settings/ diff --git a/.npmignore b/.npmignore index 98c50479c69..2b75d37f70a 100644 --- a/.npmignore +++ b/.npmignore @@ -4,4 +4,5 @@ scripts src tests Jakefile -.travis.yml \ No newline at end of file +.travis.yml +.settings/ \ No newline at end of file diff --git a/Jakefile b/Jakefile.js similarity index 97% rename from Jakefile rename to Jakefile.js index dcda1b648f2..cb53b479502 100644 --- a/Jakefile +++ b/Jakefile.js @@ -127,7 +127,8 @@ var harnessSources = [ "services/documentRegistry.ts", "services/preProcessFile.ts", "services/patternMatcher.ts", - "versionCache.ts" + "versionCache.ts", + "convertToBase64.ts" ].map(function (f) { return path.join(unittestsDirectory, f); })).concat([ diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index 8a2561af13a..fd048630ca1 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -561,7 +561,7 @@ interface Math { */ atan(x: number): number; /** - * Returns the angle (in radians) from the X axis to a point (y,x). + * Returns the angle (in radians) from the X axis to a point. * @param y A numeric expression representing the cartesian y-coordinate. * @param x A numeric expression representing the cartesian x-coordinate. */ diff --git a/bin/lib.core.es6.d.ts b/bin/lib.core.es6.d.ts index 0b963774071..902962cae51 100644 --- a/bin/lib.core.es6.d.ts +++ b/bin/lib.core.es6.d.ts @@ -561,7 +561,7 @@ interface Math { */ atan(x: number): number; /** - * Returns the angle (in radians) from the X axis to a point (y,x). + * Returns the angle (in radians) from the X axis to a point. * @param y A numeric expression representing the cartesian y-coordinate. * @param x A numeric expression representing the cartesian x-coordinate. */ @@ -1237,11 +1237,41 @@ interface SymbolConstructor { isConcatSpreadable: symbol; /** - * A method that returns the default iterator for an object.Called by the semantics of the + * A method that returns the default iterator for an object. Called by the semantics of the * for-of statement. */ iterator: symbol; + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + split: symbol; + /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive * abstract operation. @@ -1628,7 +1658,7 @@ interface IteratorResult { } interface Iterator { - next(): IteratorResult; + next(value?: any): IteratorResult; return?(value?: any): IteratorResult; throw?(e?: any): IteratorResult; } @@ -4728,6 +4758,16 @@ declare module Reflect { function setPrototypeOf(target: any, proto: any): boolean; } +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; +} + /** * Represents the completion of an asynchronous operation */ @@ -4738,14 +4778,16 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: (value: T) => TResult | Promise, onrejected?: (reason: any) => TResult | Promise): Promise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: (reason: any) => T | Promise): Promise; + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; + + [Symbol.toStringTag]: string; } interface PromiseConstructor { @@ -4756,13 +4798,11 @@ interface PromiseConstructor { /** * Creates a new Promise. - * @param init A callback used to initialize the promise. This callback is passed two arguments: + * @param executor A callback used to initialize the promise. This callback is passed two arguments: * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; - - (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -4770,15 +4810,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: (T | Promise)[]): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of values. - * @returns A new Promise. - */ - all(values: Promise[]): Promise; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -4786,7 +4818,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: (T | Promise)[]): Promise; + race(values: Iterable>): Promise; /** * Creates a new rejected promise for the provided reason. @@ -4807,13 +4839,15 @@ interface PromiseConstructor { * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | Promise): Promise; + resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise . * @returns A resolved promise. */ resolve(): Promise; + + [Symbol.species]: Function; } declare var Promise: PromiseConstructor; diff --git a/bin/lib.d.ts b/bin/lib.d.ts index 5eaa933d164..e583f1ac783 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -561,7 +561,7 @@ interface Math { */ atan(x: number): number; /** - * Returns the angle (in radians) from the X axis to a point (y,x). + * Returns the angle (in radians) from the X axis to a point. * @param y A numeric expression representing the cartesian y-coordinate. * @param x A numeric expression representing the cartesian x-coordinate. */ @@ -1231,6 +1231,139 @@ interface ArrayBufferView { byteOffset: number; } +interface DataView { + buffer: ArrayBuffer; + byteLength: number; + byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare var DataView: DataViewConstructor; + /** * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested * number of bytes could not be allocated an exception is raised. @@ -7222,6 +7355,8 @@ interface HTMLCanvasElement extends HTMLElement { * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. @@ -15703,6 +15838,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { overrideMimeType(mime: string): void; send(data?: Document): void; send(data?: string): void; + send(data?: any): void; setRequestHeader(header: string, value: string): void; DONE: number; HEADERS_RECEIVED: number; @@ -15857,11 +15993,13 @@ interface DocumentEvent { createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; createEvent(eventInterface:"ErrorEvent"): ErrorEvent; createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; createEvent(eventInterface:"FocusEvent"): FocusEvent; createEvent(eventInterface:"GamepadEvent"): GamepadEvent; createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; @@ -15876,8 +16014,12 @@ interface DocumentEvent { createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; createEvent(eventInterface:"MessageEvent"): MessageEvent; createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; createEvent(eventInterface:"NavigationEvent"): NavigationEvent; createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; @@ -15888,6 +16030,7 @@ interface DocumentEvent { createEvent(eventInterface:"PopStateEvent"): PopStateEvent; createEvent(eventInterface:"ProgressEvent"): ProgressEvent; createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; createEvent(eventInterface:"StorageEvent"): StorageEvent; createEvent(eventInterface:"TextEvent"): TextEvent; @@ -15895,6 +16038,7 @@ interface DocumentEvent { createEvent(eventInterface:"TrackEvent"): TrackEvent; createEvent(eventInterface:"TransitionEvent"): TransitionEvent; createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; createEvent(eventInterface:"WheelEvent"): WheelEvent; diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts index 2c970a1cf52..142486a1662 100644 --- a/bin/lib.dom.d.ts +++ b/bin/lib.dom.d.ts @@ -61,6 +61,139 @@ interface ArrayBufferView { byteOffset: number; } +interface DataView { + buffer: ArrayBuffer; + byteLength: number; + byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare var DataView: DataViewConstructor; + /** * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested * number of bytes could not be allocated an exception is raised. @@ -6052,6 +6185,8 @@ interface HTMLCanvasElement extends HTMLElement { * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. @@ -14533,6 +14668,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { overrideMimeType(mime: string): void; send(data?: Document): void; send(data?: string): void; + send(data?: any): void; setRequestHeader(header: string, value: string): void; DONE: number; HEADERS_RECEIVED: number; @@ -14687,11 +14823,13 @@ interface DocumentEvent { createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; createEvent(eventInterface:"ErrorEvent"): ErrorEvent; createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; createEvent(eventInterface:"FocusEvent"): FocusEvent; createEvent(eventInterface:"GamepadEvent"): GamepadEvent; createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; @@ -14706,8 +14844,12 @@ interface DocumentEvent { createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; createEvent(eventInterface:"MessageEvent"): MessageEvent; createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; createEvent(eventInterface:"NavigationEvent"): NavigationEvent; createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; @@ -14718,6 +14860,7 @@ interface DocumentEvent { createEvent(eventInterface:"PopStateEvent"): PopStateEvent; createEvent(eventInterface:"ProgressEvent"): ProgressEvent; createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; createEvent(eventInterface:"StorageEvent"): StorageEvent; createEvent(eventInterface:"TextEvent"): TextEvent; @@ -14725,6 +14868,7 @@ interface DocumentEvent { createEvent(eventInterface:"TrackEvent"): TrackEvent; createEvent(eventInterface:"TransitionEvent"): TransitionEvent; createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; createEvent(eventInterface:"WheelEvent"): WheelEvent; diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts index 297cac973e3..f839a3e3a0b 100644 --- a/bin/lib.es6.d.ts +++ b/bin/lib.es6.d.ts @@ -561,7 +561,7 @@ interface Math { */ atan(x: number): number; /** - * Returns the angle (in radians) from the X axis to a point (y,x). + * Returns the angle (in radians) from the X axis to a point. * @param y A numeric expression representing the cartesian y-coordinate. * @param x A numeric expression representing the cartesian x-coordinate. */ @@ -1237,11 +1237,41 @@ interface SymbolConstructor { isConcatSpreadable: symbol; /** - * A method that returns the default iterator for an object.Called by the semantics of the + * A method that returns the default iterator for an object. Called by the semantics of the * for-of statement. */ iterator: symbol; + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + split: symbol; + /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive * abstract operation. @@ -1628,7 +1658,7 @@ interface IteratorResult { } interface Iterator { - next(): IteratorResult; + next(value?: any): IteratorResult; return?(value?: any): IteratorResult; throw?(e?: any): IteratorResult; } @@ -4728,6 +4758,16 @@ declare module Reflect { function setPrototypeOf(target: any, proto: any): boolean; } +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; +} + /** * Represents the completion of an asynchronous operation */ @@ -4738,14 +4778,16 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: (value: T) => TResult | Promise, onrejected?: (reason: any) => TResult | Promise): Promise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: (reason: any) => T | Promise): Promise; + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; + + [Symbol.toStringTag]: string; } interface PromiseConstructor { @@ -4756,13 +4798,11 @@ interface PromiseConstructor { /** * Creates a new Promise. - * @param init A callback used to initialize the promise. This callback is passed two arguments: + * @param executor A callback used to initialize the promise. This callback is passed two arguments: * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; - - (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -4770,15 +4810,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: (T | Promise)[]): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of values. - * @returns A new Promise. - */ - all(values: Promise[]): Promise; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -4786,7 +4818,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: (T | Promise)[]): Promise; + race(values: Iterable>): Promise; /** * Creates a new rejected promise for the provided reason. @@ -4807,13 +4839,15 @@ interface PromiseConstructor { * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | Promise): Promise; + resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise . * @returns A resolved promise. */ resolve(): Promise; + + [Symbol.species]: Function; } declare var Promise: PromiseConstructor; @@ -8700,6 +8734,8 @@ interface HTMLCanvasElement extends HTMLElement { * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. @@ -17181,6 +17217,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { overrideMimeType(mime: string): void; send(data?: Document): void; send(data?: string): void; + send(data?: any): void; setRequestHeader(header: string, value: string): void; DONE: number; HEADERS_RECEIVED: number; @@ -17335,11 +17372,13 @@ interface DocumentEvent { createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; createEvent(eventInterface:"ErrorEvent"): ErrorEvent; createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; createEvent(eventInterface:"FocusEvent"): FocusEvent; createEvent(eventInterface:"GamepadEvent"): GamepadEvent; createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; @@ -17354,8 +17393,12 @@ interface DocumentEvent { createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; createEvent(eventInterface:"MessageEvent"): MessageEvent; createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; createEvent(eventInterface:"NavigationEvent"): NavigationEvent; createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; @@ -17366,6 +17409,7 @@ interface DocumentEvent { createEvent(eventInterface:"PopStateEvent"): PopStateEvent; createEvent(eventInterface:"ProgressEvent"): ProgressEvent; createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; createEvent(eventInterface:"StorageEvent"): StorageEvent; createEvent(eventInterface:"TextEvent"): TextEvent; @@ -17373,6 +17417,7 @@ interface DocumentEvent { createEvent(eventInterface:"TrackEvent"): TrackEvent; createEvent(eventInterface:"TransitionEvent"): TransitionEvent; createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; createEvent(eventInterface:"WheelEvent"): WheelEvent; diff --git a/bin/lib.webworker.d.ts b/bin/lib.webworker.d.ts index 740ebe94fa6..1704e07f75a 100644 --- a/bin/lib.webworker.d.ts +++ b/bin/lib.webworker.d.ts @@ -61,6 +61,139 @@ interface ArrayBufferView { byteOffset: number; } +interface DataView { + buffer: ArrayBuffer; + byteLength: number; + byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare var DataView: DataViewConstructor; + /** * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested * number of bytes could not be allocated an exception is raised. diff --git a/bin/tsc.js b/bin/tsc.js index f97d761e4f4..2bde9314b4d 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -444,7 +444,7 @@ var ts; for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + if (part === ".." && normalized.length > 0 && lastOrUndefined(normalized) !== "..") { normalized.pop(); } else { @@ -536,7 +536,7 @@ var ts; function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { directoryComponents.length--; } for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { @@ -960,7 +960,7 @@ var ts; A_get_accessor_cannot_have_parameters: { code: 1054, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, + An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: ts.DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: ts.DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, @@ -1021,8 +1021,8 @@ var ts; or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "'{' or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in a namespace cannot reference a module." }, + Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules unless the '--module' flag is provided." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, var_let_or_const_expected: { code: 1152, category: ts.DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, @@ -1064,9 +1064,9 @@ var ts; The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, An_import_declaration_cannot_have_modifiers: { code: 1191, category: ts.DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "External module '{0}' has no default export." }, + Module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no default export." }, An_export_declaration_cannot_have_modifiers: { code: 1193, category: ts.DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." }, + Export_declarations_are_not_permitted_in_a_namespace: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in a namespace." }, Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: ts.DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." }, Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." }, Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, @@ -1075,28 +1075,27 @@ var ts; Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, - Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, + Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." }, Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." }, Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, - Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." }, + Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, + Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, Circular_definition_of_import_alias_0: { code: 2303, category: ts.DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, Cannot_find_name_0: { code: 2304, category: ts.DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not a module." }, + Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find module '{0}'." }, A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: ts.DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, @@ -1119,7 +1118,7 @@ var ts; Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: ts.DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: ts.DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible: { code: 2330, category: ts.DiagnosticCategory.Error, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_module_or_namespace_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module or namespace body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, @@ -1211,15 +1210,15 @@ var ts; Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient modules cannot be nested in other modules." }, + Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient module declaration cannot specify relative module name." }, Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, @@ -1273,11 +1272,13 @@ var ts; Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, - External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, - External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, + Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "Module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "Module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." }, + Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "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}'." }, 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}'." }, @@ -1353,6 +1354,7 @@ var ts; Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported file encoding." }, + Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." }, Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, @@ -1366,6 +1368,10 @@ var ts; Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." }, Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." }, Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, + Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." }, + Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -1377,7 +1383,7 @@ var ts; Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." }, Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." }, @@ -1398,8 +1404,8 @@ var ts; Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." }, + Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, @@ -1412,6 +1418,9 @@ var ts; Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, + Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." }, + NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" }, + Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -1424,7 +1433,6 @@ var ts; 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." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: ts.DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: ts.DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, _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: { code: 7023, category: ts.DiagnosticCategory.Error, key: "'{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." }, Function_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: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function 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." }, @@ -1480,7 +1488,7 @@ var ts; "false": 80, "finally": 81, "for": 82, - "from": 124, + "from": 125, "function": 83, "get": 116, "if": 84, @@ -1491,33 +1499,34 @@ var ts; "interface": 103, "let": 104, "module": 117, + "namespace": 118, "new": 88, "null": 89, - "number": 119, + "number": 120, "package": 105, "private": 106, "protected": 107, "public": 108, - "require": 118, + "require": 119, "return": 90, - "set": 120, + "set": 121, "static": 109, - "string": 121, + "string": 122, "super": 91, "switch": 92, - "symbol": 122, + "symbol": 123, "this": 93, "throw": 94, "true": 95, "try": 96, - "type": 123, + "type": 124, "typeof": 97, "var": 98, "void": 99, "while": 100, "with": 101, "yield": 110, - "of": 125, + "of": 126, "{": 14, "}": 15, "(": 16, @@ -1699,7 +1708,7 @@ var ts; function isLineBreak(ch) { // ES5 7.3: // The ECMAScript line terminator characters are listed in Table 3. - // Table 3 � Line Terminator Characters + // Table 3: Line Terminator Characters // Code Unit Value Name Formal Name // \u000A Line Feed // \u000D Carriage Return @@ -1839,7 +1848,7 @@ var ts; } collecting = true; if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } continue; case 9: @@ -1885,7 +1894,7 @@ var ts; default: if (ch > 127 && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } pos++; continue; @@ -2703,16 +2712,16 @@ var ts; (function (ts) { ts.bindTime = 0; function getModuleInstanceState(node) { - if (node.kind === 202 || node.kind === 203) { + if (node.kind === 203 || node.kind === 204) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { + else if ((node.kind === 210 || node.kind === 209) && !(node.flags & 1)) { return 0; } - else if (node.kind === 206) { + else if (node.kind === 207) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -2728,7 +2737,7 @@ var ts; }); return state; } - else if (node.kind === 205) { + else if (node.kind === 206) { return getModuleInstanceState(node.body); } else { @@ -2781,10 +2790,10 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 205 && node.name.kind === 8) { + if (node.kind === 206 && node.name.kind === 8) { return '"' + node.name.text + '"'; } - if (node.name.kind === 127) { + if (node.name.kind === 128) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -2792,22 +2801,22 @@ var ts; return node.name.text; } switch (node.kind) { - case 143: - case 135: + case 144: + case 136: return "__constructor"; - case 142: - case 138: - return "__call"; + case 143: case 139: - return "__new"; + return "__call"; case 140: + return "__new"; + case 141: return "__index"; - case 215: + case 216: return "__export"; - case 214: + case 215: return node.isExportEquals ? "export=" : "default"; - case 200: case 201: + case 202: return node.flags & 256 ? "default" : undefined; } } @@ -2839,7 +2848,7 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if ((node.kind === 201 || node.kind === 174) && symbol.exports) { + if ((node.kind === 202 || node.kind === 175) && symbol.exports) { var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { @@ -2855,7 +2864,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + if (node.kind === 218 || (node.kind === 209 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -2863,7 +2872,7 @@ var ts; } } else { - if (hasExportModifier || container.flags & 32768) { + if (hasExportModifier || container.flags & 65536) { var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); @@ -2886,56 +2895,59 @@ var ts; parent = node; if (symbolKind & 262128) { container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; + addToContainerChain(container); } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 228); } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } + function addToContainerChain(node) { + if (lastContainer) { + lastContainer.nextContainer = node; + } + lastContainer = node; + } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 205: + case 206: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 228: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 142: case 143: - case 138: + case 144: case 139: case 140: - case 134: - case 133: + case 141: case 135: + case 134: case 136: case 137: - case 200: - case 162: + case 138: + case 201: case 163: + case 164: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 174: - case 201: + case 175: + case 202: if (node.flags & 128) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 145: - case 154: - case 202: + case 146: + case 155: + case 203: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 204: + case 205: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -2950,11 +2962,11 @@ var ts; return false; } function hasExportDeclarations(node) { - var body = node.kind === 227 ? node : node.body; - if (body.kind === 227 || body.kind === 206) { + var body = node.kind === 228 ? node : node.body; + if (body.kind === 228 || body.kind === 207) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 215 || stat.kind === 214) { + if (stat.kind === 216 || stat.kind === 215) { return true; } } @@ -2963,10 +2975,10 @@ var ts; } function setExportContextFlag(node) { if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 32768; + node.flags |= 65536; } else { - node.flags &= ~32768; + node.flags &= ~65536; } } function bindModuleDeclaration(node) { @@ -3004,7 +3016,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 143 ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -3016,10 +3028,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { - case 205: + case 206: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 228: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -3027,6 +3039,7 @@ var ts; default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); } declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } @@ -3041,14 +3054,14 @@ var ts; function bind(node) { node.parent = parent; switch (node.kind) { - case 128: + case 129: bindDeclaration(node, 262144, 530912, false); break; - case 129: + case 130: bindParameter(node); break; - case 198: - case 152: + case 199: + case 153: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -3059,68 +3072,68 @@ var ts; bindDeclaration(node, 1, 107454, false); } break; + case 133: case 132: - case 131: bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 224: case 225: + case 226: bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 226: + case 227: bindPropertyOrMethodOrAccessor(node, 8, 107455, false); break; - case 138: case 139: case 140: + case 141: bindDeclaration(node, 131072, 0, false); break; + case 135: case 134: - case 133: bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); break; - case 200: + case 201: bindDeclaration(node, 16, 106927, true); break; - case 135: + case 136: bindDeclaration(node, 16384, 0, true); break; - case 136: + case 137: bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); break; - case 137: + case 138: bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); break; - case 142: case 143: + case 144: bindFunctionOrConstructorType(node); break; - case 145: + case 146: bindAnonymousDeclaration(node, 2048, "__type", false); break; - case 154: + case 155: bindAnonymousDeclaration(node, 4096, "__object", false); break; - case 162: case 163: + case 164: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 174: + case 175: bindAnonymousDeclaration(node, 32, "__class", false); break; - case 223: + case 224: bindCatchVariableDeclaration(node); break; - case 201: + case 202: bindBlockScopedDeclaration(node, 32, 899583); break; - case 202: + case 203: bindDeclaration(node, 64, 792992, false); break; - case 203: + case 204: bindDeclaration(node, 524288, 793056, false); break; - case 204: + case 205: if (ts.isConst(node)) { bindDeclaration(node, 128, 899967, false); } @@ -3128,16 +3141,16 @@ var ts; bindDeclaration(node, 256, 899327, false); } break; - case 205: + case 206: bindModuleDeclaration(node); break; - case 208: - case 211: - case 213: - case 217: + case 209: + case 212: + case 214: + case 218: bindDeclaration(node, 8388608, 8388608, false); break; - case 210: + case 211: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -3145,13 +3158,13 @@ var ts; bindChildren(node, 0, false); } break; - case 215: + case 216: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 214: + case 215: if (node.expression.kind === 65) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); } @@ -3160,20 +3173,20 @@ var ts; } bindChildren(node, 0, false); break; - case 227: + case 228: setExportContextFlag(node); if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 179: + case 180: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 223: - case 186: + case 224: case 187: case 188: - case 207: + case 189: + case 208: bindChildren(node, 0, true); break; default: @@ -3191,8 +3204,8 @@ var ts; bindDeclaration(node, 1, 107455, false); } if (node.flags & 112 && - node.parent.kind === 135 && - (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + node.parent.kind === 136 && + (node.parent.parent.kind === 202 || node.parent.parent.kind === 175)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -3270,7 +3283,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 227) { + while (node && node.kind !== 228) { node = node.parent; } return node; @@ -3359,15 +3372,15 @@ var ts; return current; } switch (current.kind) { - case 227: - case 207: - case 223: - case 205: - case 186: + case 228: + case 208: + case 224: + case 206: case 187: case 188: + case 189: return current; - case 179: + case 180: if (!isFunctionLike(current.parent)) { return current; } @@ -3378,9 +3391,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 198 && + declaration.kind === 199 && declaration.parent && - declaration.parent.kind === 223; + declaration.parent.kind === 224; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3416,22 +3429,22 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 227: + case 228: 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 198: - case 152: - case 201: - case 174: + case 199: + case 153: case 202: + case 175: + case 203: + case 206: case 205: - case 204: - case 226: - case 200: - case 162: + case 227: + case 201: + case 163: errorNode = node.name; break; } @@ -3453,11 +3466,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 204 && isConst(node); + return node.kind === 205 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 152 || isBindingPattern(node))) { + while (node && (node.kind === 153 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3465,14 +3478,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 198) { + if (node.kind === 199) { node = node.parent; } - if (node && node.kind === 199) { + if (node && node.kind === 200) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 180) { + if (node && node.kind === 181) { flags |= node.flags; } return flags; @@ -3487,11 +3500,11 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 182 && node.expression.kind === 8; + return node.kind === 183 && node.expression.kind === 8; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - if (node.kind === 129 || node.kind === 128) { + if (node.kind === 130 || node.kind === 129) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -3513,23 +3526,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 191: + case 192: return visitor(node); - case 207: - case 179: - case 183: + case 208: + case 180: case 184: case 185: case 186: case 187: case 188: - case 192: + case 189: case 193: - case 220: - case 221: case 194: - case 196: - case 223: + case 221: + case 222: + case 195: + case 197: + case 224: return ts.forEachChild(node, traverse); } } @@ -3538,14 +3551,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 152: - case 226: - case 129: - case 224: - case 132: - case 131: + case 153: + case 227: + case 130: case 225: - case 198: + case 133: + case 132: + case 226: + case 199: return true; } } @@ -3555,8 +3568,8 @@ var ts; function isAccessor(node) { if (node) { switch (node.kind) { - case 136: case 137: + case 138: return true; } } @@ -3566,22 +3579,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 135: - case 162: - case 200: - case 163: - case 134: - case 133: case 136: + case 163: + case 201: + case 164: + case 135: + case 134: case 137: case 138: case 139: case 140: - case 142: + case 141: case 143: - case 162: + case 144: case 163: - case 200: + case 164: + case 201: return true; } } @@ -3589,11 +3602,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 179 && isFunctionLike(node.parent); + return node && node.kind === 180 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 134 && node.parent.kind === 154; + return node && node.kind === 135 && node.parent.kind === 155; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -3612,36 +3625,36 @@ var ts; return undefined; } switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 128: + if (node.parent.parent.kind === 202) { return node; } node = node.parent; break; - case 130: - if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + case 131: + if (node.parent.kind === 130 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 163: + case 164: if (!includeArrowFunctions) { continue; } - case 200: - case 162: - case 205: - case 132: - case 131: - case 134: + case 201: + case 163: + case 206: case 133: + case 132: case 135: + case 134: case 136: case 137: - case 204: - case 227: + case 138: + case 205: + case 228: return node; } } @@ -3653,40 +3666,40 @@ var ts; if (!node) return node; switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 128: + if (node.parent.parent.kind === 202) { return node; } node = node.parent; break; - case 130: - if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + case 131: + if (node.parent.kind === 130 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 200: - case 162: + case 201: case 163: + case 164: if (!includeFunctions) { continue; } - case 132: - case 131: - case 134: case 133: + case 132: case 135: + case 134: case 136: case 137: + case 138: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 159) { + if (node.kind === 160) { return node.tag; } return node.expression; @@ -3694,40 +3707,40 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 201: + case 202: return true; - case 132: - return node.parent.kind === 201; - case 129: - return node.parent.body && node.parent.parent.kind === 201; - case 136: + case 133: + return node.parent.kind === 202; + case 130: + return node.parent.body && node.parent.parent.kind === 202; case 137: - case 134: - return node.body && node.parent.kind === 201; + case 138: + case 135: + return node.body && node.parent.kind === 202; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 201: + case 202: if (node.decorators) { return true; } return false; - case 132: - case 129: + case 133: + case 130: if (node.decorators) { return true; } return false; - case 136: + case 137: if (node.body && node.decorators) { return true; } return false; - case 134: - case 137: + case 135: + case 138: if (node.body && node.decorators) { return true; } @@ -3738,10 +3751,10 @@ var ts; ts.nodeIsDecorated = nodeIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 201: + case 202: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 134: - case 137: + case 135: + case 138: return ts.forEach(node.parameters, nodeIsDecorated); } return false; @@ -3759,7 +3772,6 @@ var ts; case 95: case 80: case 9: - case 153: case 154: case 155: case 156: @@ -3769,69 +3781,70 @@ var ts; case 160: case 161: case 162: - case 174: case 163: - case 166: + case 175: case 164: - case 165: case 167: + case 165: + case 166: case 168: case 169: case 170: - case 173: case 171: + case 174: + case 172: case 10: - case 175: + case 176: return true; - case 126: - while (node.parent.kind === 126) { + case 127: + while (node.parent.kind === 127) { node = node.parent; } - return node.parent.kind === 144; + return node.parent.kind === 145; case 65: - if (node.parent.kind === 144) { + if (node.parent.kind === 145) { return true; } case 7: case 8: var parent_1 = node.parent; switch (parent_1.kind) { - case 198: - case 129: + case 199: + case 130: + case 133: case 132: - case 131: - case 226: - case 224: - case 152: + case 227: + case 225: + case 153: return parent_1.initializer === node; - case 182: case 183: case 184: case 185: - case 191: + case 186: case 192: case 193: - case 220: - case 195: - case 193: + case 194: + case 221: + case 196: + case 194: return parent_1.expression === node; - case 186: - var forStatement = parent_1; - return (forStatement.initializer === node && forStatement.initializer.kind !== 199) || - forStatement.condition === node || - forStatement.iterator === node; case 187: + var forStatement = parent_1; + return (forStatement.initializer === node && forStatement.initializer.kind !== 200) || + forStatement.condition === node || + forStatement.incrementor === node; case 188: + case 189: var forInStatement = parent_1; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 200) || forInStatement.expression === node; - case 160: + case 161: return node === parent_1.expression; - case 176: + case 178: return node === parent_1.expression; - case 127: + case 128: return node === parent_1.expression; - case 130: + case 131: return true; default: if (isExpression(parent_1)) { @@ -3849,7 +3862,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind === 219; + return node.kind === 209 && node.moduleReference.kind === 220; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3858,40 +3871,40 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind !== 219; + return node.kind === 209 && node.moduleReference.kind !== 220; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 209) { + if (node.kind === 210) { return node.moduleSpecifier; } - if (node.kind === 208) { + if (node.kind === 209) { var reference = node.moduleReference; - if (reference.kind === 219) { + if (reference.kind === 220) { return reference.expression; } } - if (node.kind === 215) { + if (node.kind === 216) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 129 && node.dotDotDotToken !== undefined; + return node && node.kind === 130 && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 129: + case 130: return node.questionToken !== undefined; + case 135: case 134: - case 133: return node.questionToken !== undefined; + case 226: case 225: - case 224: + case 133: case 132: - case 131: return node.questionToken !== undefined; } } @@ -3899,7 +3912,7 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function hasRestParameters(s) { - return s.parameters.length > 0 && s.parameters[s.parameters.length - 1].dotDotDotToken !== undefined; + return s.parameters.length > 0 && ts.lastOrUndefined(s.parameters).dotDotDotToken !== undefined; } ts.hasRestParameters = hasRestParameters; function isLiteralKind(kind) { @@ -3915,7 +3928,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 151 || node.kind === 150); + return !!node && (node.kind === 152 || node.kind === 151); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -3930,33 +3943,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 163: - case 152: - case 201: - case 135: - case 204: - case 226: - case 217: - case 200: - case 162: - case 136: - case 210: - case 208: - case 213: + case 164: + case 153: case 202: - case 134: - case 133: + case 136: case 205: - case 211: - case 129: - case 224: - case 132: - case 131: + case 227: + case 218: + case 201: + case 163: case 137: - case 225: + case 211: + case 209: + case 214: case 203: - case 128: - case 198: + case 135: + case 134: + case 206: + case 212: + case 130: + case 225: + case 133: + case 132: + case 138: + case 226: + case 204: + case 129: + case 199: return true; } return false; @@ -3964,25 +3977,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 190: - case 189: - case 197: - case 184: - case 182: - case 181: - case 187: - case 188: - case 186: - case 183: - case 194: case 191: - case 193: - case 94: - case 196: - case 180: + case 190: + case 198: case 185: + case 183: + case 182: + case 188: + case 189: + case 187: + case 184: + case 195: case 192: - case 214: + case 194: + case 94: + case 197: + case 181: + case 186: + case 193: + case 215: return true; default: return false; @@ -3991,13 +4004,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 135: - case 132: - case 134: case 136: - case 137: case 133: - case 140: + case 135: + case 137: + case 138: + case 134: + case 141: return true; default: return false; @@ -4009,7 +4022,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 213 || parent.kind === 217) { + if (parent.kind === 214 || parent.kind === 218) { if (parent.propertyName) { return true; } @@ -4021,12 +4034,12 @@ var ts; } ts.isDeclarationName = isDeclarationName; function isAliasSymbolDeclaration(node) { - return node.kind === 208 || - node.kind === 210 && !!node.name || - node.kind === 211 || - node.kind === 213 || - node.kind === 217 || - node.kind === 214 && node.expression.kind === 65; + return node.kind === 209 || + node.kind === 211 && !!node.name || + node.kind === 212 || + node.kind === 214 || + node.kind === 218 || + node.kind === 215 && node.expression.kind === 65; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -4109,7 +4122,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 66 <= token && token <= 125; + return 66 <= token && token <= 126; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -4118,19 +4131,19 @@ var ts; ts.isTrivia = isTrivia; function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 127 && + declaration.name.kind === 128 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { - return node.kind === 155 && isESSymbolIdentifier(node.expression); + return node.kind === 156 && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { if (name.kind === 65 || name.kind === 8 || name.kind === 7) { return name.text; } - if (name.kind === 127) { + if (name.kind === 128) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -4164,7 +4177,7 @@ var ts; } ts.isModifier = isModifier; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 205 || n.kind === 227; + return isFunctionLike(n) || n.kind === 206 || n.kind === 228; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -4327,7 +4340,7 @@ var ts; var lineStartsOfS = ts.computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); } } } @@ -4388,7 +4401,7 @@ var ts; ts.getLineOfLocalPosition = getLineOfLocalPosition; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 135 && nodeIsPresent(member.body)) { + if (member.kind === 136 && nodeIsPresent(member.body)) { return member; } }); @@ -4396,8 +4409,8 @@ var ts; ts.getFirstConstructorWithBody = getFirstConstructorWithBody; function shouldEmitToOwnFile(sourceFile, compilerOptions) { if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; + if ((isExternalModule(sourceFile) || !compilerOptions.out)) { + return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js"); } return false; } @@ -4411,10 +4424,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 136) { + if (accessor.kind === 137) { getAccessor = accessor; } - else if (accessor.kind === 137) { + else if (accessor.kind === 138) { setAccessor = accessor; } else { @@ -4423,7 +4436,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 136 || member.kind === 137) + if ((member.kind === 137 || member.kind === 138) && (member.flags & 128) === (accessor.flags & 128)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -4434,10 +4447,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 136 && !getAccessor) { + if (member.kind === 137 && !getAccessor) { getAccessor = member; } - if (member.kind === 137 && !setAccessor) { + if (member.kind === 138 && !setAccessor) { setAccessor = member; } } @@ -4558,22 +4571,22 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 155: case 156: - case 158: case 157: case 159: - case 153: - case 161: + case 158: + case 160: case 154: - case 174: case 162: + case 155: + case 175: + case 163: case 65: case 9: case 7: case 8: case 10: - case 171: + case 172: case 80: case 89: case 93: @@ -4589,30 +4602,84 @@ var ts; return token >= 53 && token <= 64; } ts.isAssignmentOperator = isAssignmentOperator; - function isSupportedHeritageClauseElement(node) { - return isSupportedHeritageClauseElementExpression(node.expression); + function isSupportedExpressionWithTypeArguments(node) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } - ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; - function isSupportedHeritageClauseElementExpression(node) { + ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; + function isSupportedExpressionWithTypeArgumentsRest(node) { if (node.kind === 65) { return true; } - else if (node.kind === 155) { - return isSupportedHeritageClauseElementExpression(node.expression); + else if (node.kind === 156) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } else { return false; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 126 && node.parent.right === node) || - (node.parent.kind === 155 && node.parent.name === node); + return (node.parent.kind === 127 && node.parent.right === node) || + (node.parent.kind === 156 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function getLocalSymbolForExportDefault(symbol) { return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function getExpandedCharCodes(input) { + var output = []; + var length = input.length; + var leadSurrogate = undefined; + for (var i = 0; i < length; i++) { + var charCode = input.charCodeAt(i); + if (charCode < 0x80) { + output.push(charCode); + } + else if (charCode < 0x800) { + output.push((charCode >> 6) | 192); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x10000) { + output.push((charCode >> 12) | 224); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x20000) { + output.push((charCode >> 18) | 240); + output.push(((charCode >> 12) & 63) | 128); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else { + ts.Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + function convertToBase64(input) { + var result = ""; + var charCodes = getExpandedCharCodes(input); + var i = 0; + var length = charCodes.length; + var byte1, byte2, byte3, byte4; + while (i < length) { + byte1 = charCodes[i] >> 2; + byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; + byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; + byte4 = charCodes[i + 2] & 63; + if (i + 1 >= length) { + byte3 = byte4 = 64; + } + else if (i + 2 >= length) { + byte4 = 64; + } + result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i += 3; + } + return result; + } + ts.convertToBase64 = convertToBase64; })(ts || (ts = {})); var ts; (function (ts) { @@ -4734,7 +4801,7 @@ var ts; /// var ts; (function (ts) { - var nodeConstructors = new Array(229); + var nodeConstructors = new Array(230); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4772,20 +4839,20 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 126: + case 127: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 128: + case 129: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 129: + case 130: + case 133: case 132: - case 131: - case 224: case 225: - case 198: - case 152: + case 226: + case 199: + case 153: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -4794,24 +4861,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 142: case 143: - case 138: + case 144: case 139: case 140: + case 141: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 134: - case 133: case 135: + case 134: case 136: case 137: - case 162: - case 200: + case 138: case 163: + case 201: + case 164: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -4822,151 +4889,144 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 141: + case 142: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 144: - return visitNode(cbNode, node.exprName); case 145: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 146: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 147: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 148: - return visitNodes(cbNodes, node.types); + return visitNodes(cbNodes, node.elementTypes); case 149: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.types); case 150: + return visitNode(cbNode, node.type); case 151: - return visitNodes(cbNodes, node.elements); - case 153: + case 152: return visitNodes(cbNodes, node.elements); case 154: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 155: + return visitNodes(cbNodes, node.properties); + case 156: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 156: + case 157: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 157: case 158: + case 159: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 159: + case 160: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 160: + case 161: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 161: - return visitNode(cbNode, node.expression); - case 164: + case 162: return visitNode(cbNode, node.expression); case 165: return visitNode(cbNode, node.expression); case 166: return visitNode(cbNode, node.expression); case 167: - return visitNode(cbNode, node.operand); - case 172: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression); case 168: return visitNode(cbNode, node.operand); + case 173: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); case 169: + return visitNode(cbNode, node.operand); + case 170: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 170: + case 171: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 173: + case 174: return visitNode(cbNode, node.expression); - case 179: - case 206: + case 180: + case 207: return visitNodes(cbNodes, node.statements); - case 227: + case 228: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 180: + case 181: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 199: + case 200: return visitNodes(cbNodes, node.declarations); - case 182: - return visitNode(cbNode, node.expression); case 183: + return visitNode(cbNode, node.expression); + case 184: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 184: + case 185: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 185: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 186: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 187: return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || + visitNode(cbNode, node.condition) || + visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); case 188: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 189: - case 190: - return visitNode(cbNode, node.label); - case 191: - return visitNode(cbNode, node.expression); - case 192: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 190: + case 191: + return visitNode(cbNode, node.label); + case 192: + return visitNode(cbNode, node.expression); case 193: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 194: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 207: + case 208: return visitNodes(cbNodes, node.clauses); - case 220: + case 221: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 221: + case 222: return visitNodes(cbNodes, node.statements); - case 194: + case 195: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 195: - return visitNode(cbNode, node.expression); case 196: + return visitNode(cbNode, node.expression); + case 197: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 223: + case 224: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 130: + case 131: return visitNode(cbNode, node.expression); - case 201: - case 174: - 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 202: + case 175: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -4977,65 +5037,72 @@ var ts; return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 204: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 226: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + visitNode(cbNode, node.type); case 205: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 227: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 206: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 208: + case 209: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 209: + case 210: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 210: + case 211: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 211: - return visitNode(cbNode, node.name); case 212: - case 216: + return visitNode(cbNode, node.name); + case 213: + case 217: return visitNodes(cbNodes, node.elements); - case 215: + case 216: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 213: - case 217: + case 214: + case 218: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 214: + case 215: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 171: + case 172: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 176: + case 178: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 127: + case 128: return visitNode(cbNode, node.expression); - case 222: + case 223: return visitNodes(cbNodes, node.types); case 177: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 219: + case 220: return visitNode(cbNode, node.expression); - case 218: + case 219: return visitNodes(cbNodes, node.decorators); } } @@ -5121,7 +5188,7 @@ var ts; } } function createSourceFile(fileName, languageVersion) { - sourceFile = createNode(227, 0); + sourceFile = createNode(228, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -5414,7 +5481,7 @@ var ts; return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(127); + var node = createNode(128); parseExpected(18); var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { @@ -5708,14 +5775,14 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { + case 210: case 209: - case 208: + case 216: case 215: - case 214: - case 201: case 202: + case 203: + case 206: case 205: - case 204: return true; } return isReusableStatement(node); @@ -5725,13 +5792,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 135: - case 140: - case 134: case 136: + case 141: + case 135: case 137: - case 132: - case 178: + case 138: + case 133: + case 179: return true; } } @@ -5740,8 +5807,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 220: case 221: + case 222: return true; } } @@ -5750,56 +5817,56 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 200: + case 201: + case 181: case 180: - case 179: + case 184: case 183: - case 182: - case 195: + case 196: + case 192: + case 194: case 191: - case 193: case 190: + case 188: case 189: case 187: - case 188: case 186: - case 185: - case 192: - case 181: - case 196: - case 194: - case 184: + case 193: + case 182: case 197: + case 195: + case 185: + case 198: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 226; + return node.kind === 227; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 139: - case 133: case 140: - case 131: - case 138: + case 134: + case 141: + case 132: + case 139: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 198) { + if (node.kind !== 199) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 129) { + if (node.kind !== 130) { return false; } var parameter = node; @@ -5894,7 +5961,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20)) { - var node = createNode(126, entity.pos); + var node = createNode(127, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -5911,20 +5978,20 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(171); + var template = createNode(172); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); do { templateSpans.push(parseTemplateSpan()); - } while (templateSpans[templateSpans.length - 1].literal.kind === 12); + } while (ts.lastOrUndefined(templateSpans).literal.kind === 12); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(176); + var span = createNode(178); span.expression = allowInAnd(parseExpression); var literal; if (token === 15) { @@ -5958,7 +6025,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(141); + var node = createNode(142); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24) { node.typeArguments = parseBracketedList(17, parseType, 24, 25); @@ -5966,13 +6033,13 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(144); + var node = createNode(145); parseExpected(97); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(128); + var node = createNode(129); node.name = parseIdentifier(); if (parseOptional(79)) { if (isStartOfType() || !isStartOfExpression()) { @@ -6007,7 +6074,7 @@ var ts; } } function parseParameter() { - var node = createNode(129); + var node = createNode(130); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21); @@ -6059,7 +6126,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 139) { + if (kind === 140) { parseExpected(88); } fillSignature(51, false, false, node); @@ -6099,7 +6166,7 @@ var ts; return token === 51 || token === 23 || token === 19; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(140, fullStart); + var node = createNode(141, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15, parseParameter, 18, 19); @@ -6112,7 +6179,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { - var method = createNode(133, fullStart); + var method = createNode(134, fullStart); method.name = name; method.questionToken = questionToken; fillSignature(51, false, false, method); @@ -6120,7 +6187,7 @@ var ts; return finishNode(method); } else { - var property = createNode(131, fullStart); + var property = createNode(132, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -6162,14 +6229,14 @@ var ts; switch (token) { case 16: case 24: - return parseSignatureMember(138); + return parseSignatureMember(139); case 18: return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); case 88: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(139); + return parseSignatureMember(140); } case 8: case 7: @@ -6199,7 +6266,7 @@ var ts; return token === 16 || token === 24; } function parseTypeLiteral() { - var node = createNode(145); + var node = createNode(146); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -6215,12 +6282,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(147); + var node = createNode(148); node.elementTypes = parseBracketedList(18, parseType, 18, 19); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(149); + var node = createNode(150); parseExpected(16); node.type = parseType(); parseExpected(17); @@ -6228,7 +6295,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 143) { + if (kind === 144) { parseExpected(88); } fillSignature(32, false, false, node); @@ -6241,10 +6308,10 @@ var ts; function parseNonArrayType() { switch (token) { case 112: - case 121: - case 119: - case 113: case 122: + case 120: + case 113: + case 123: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); case 99: @@ -6264,10 +6331,10 @@ var ts; function isStartOfType() { switch (token) { case 112: - case 121: - case 119: - case 113: case 122: + case 120: + case 113: + case 123: case 99: case 97: case 14: @@ -6289,7 +6356,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { parseExpected(19); - var node = createNode(146, type.pos); + var node = createNode(147, type.pos); node.elementType = type; type = finishNode(node); } @@ -6304,7 +6371,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(148, type.pos); + var node = createNode(149, type.pos); node.types = types; type = finishNode(node); } @@ -6349,10 +6416,10 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(142); + return parseFunctionOrConstructorType(143); } if (token === 88) { - return parseFunctionOrConstructorType(143); + return parseFunctionOrConstructorType(144); } return parseUnionTypeOrHigher(); } @@ -6490,7 +6557,7 @@ var ts; (isIdentifier() || token === 14 || token === 18); } function parseYieldExpression() { - var node = createNode(172); + var node = createNode(173); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { @@ -6504,8 +6571,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(163, identifier.pos); - var parameter = createNode(129, identifier.pos); + var node = createNode(164, identifier.pos); + var parameter = createNode(130, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -6583,7 +6650,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(163); + var node = createNode(164); fillSignature(51, false, !allowAmbiguity, node); if (!node.parameters) { return undefined; @@ -6610,7 +6677,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(170, leftOperand.pos); + var node = createNode(171, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -6623,7 +6690,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 86 || t === 125; + return t === 86 || t === 126; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -6684,37 +6751,37 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(169, left.pos); + var node = createNode(170, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(167); + var node = createNode(168); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(164); - nextToken(); - node.expression = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(165); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(166); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(167); + nextToken(); + node.expression = parseUnaryExpressionOrHigher(); + return finishNode(node); + } function parseUnaryExpressionOrHigher() { switch (token) { case 33: @@ -6740,7 +6807,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(168, expression.pos); + var node = createNode(169, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -6763,14 +6830,14 @@ var ts; if (token === 16 || token === 20) { return expression; } - var node = createNode(155, expression.pos); + var node = createNode(156, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(20, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } function parseTypeAssertion() { - var node = createNode(160); + var node = createNode(161); parseExpected(24); node.type = parseType(); parseExpected(25); @@ -6781,7 +6848,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(20); if (dotToken) { - var propertyAccess = createNode(155, expression.pos); + var propertyAccess = createNode(156, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -6789,7 +6856,7 @@ var ts; continue; } if (!inDecoratorContext() && parseOptional(18)) { - var indexedAccess = createNode(156, expression.pos); + var indexedAccess = createNode(157, expression.pos); indexedAccess.expression = expression; if (token !== 19) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -6803,7 +6870,7 @@ var ts; continue; } if (token === 10 || token === 11) { - var tagExpression = createNode(159, expression.pos); + var tagExpression = createNode(160, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 ? parseLiteralNode() @@ -6822,7 +6889,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(157, expression.pos); + var callExpr = createNode(158, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -6830,7 +6897,7 @@ var ts; continue; } else if (token === 16) { - var callExpr = createNode(157, expression.pos); + var callExpr = createNode(158, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -6920,28 +6987,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(161); + var node = createNode(162); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); return finishNode(node); } function parseSpreadElement() { - var node = createNode(173); + var node = createNode(174); parseExpected(21); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(175) : + token === 23 ? createNode(176) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(153); + var node = createNode(154); parseExpected(18); if (scanner.hasPrecedingLineBreak()) node.flags |= 512; @@ -6951,11 +7018,11 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(116)) { - return parseAccessorDeclaration(136, fullStart, decorators, modifiers); - } - else if (parseContextualModifier(120)) { return parseAccessorDeclaration(137, fullStart, decorators, modifiers); } + else if (parseContextualModifier(121)) { + return parseAccessorDeclaration(138, fullStart, decorators, modifiers); + } return undefined; } function parseObjectLiteralElement() { @@ -6975,13 +7042,13 @@ var ts; return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(225, fullStart); + var shorthandDeclaration = createNode(226, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(224, fullStart); + var propertyAssignment = createNode(225, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6990,7 +7057,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(154); + var node = createNode(155); parseExpected(14); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512; @@ -7004,7 +7071,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(162); + var node = createNode(163); parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); @@ -7019,7 +7086,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(158); + var node = createNode(159); parseExpected(88); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -7029,7 +7096,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(179); + var node = createNode(180); if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2, checkForStrictMode, parseStatement); parseExpected(15); @@ -7054,12 +7121,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(181); + var node = createNode(182); parseExpected(22); return finishNode(node); } function parseIfStatement() { - var node = createNode(183); + var node = createNode(184); parseExpected(84); parseExpected(16); node.expression = allowInAnd(parseExpression); @@ -7069,7 +7136,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(184); + var node = createNode(185); parseExpected(75); node.statement = parseStatement(); parseExpected(100); @@ -7080,7 +7147,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(185); + var node = createNode(186); parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); @@ -7103,21 +7170,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(86)) { - var forInStatement = createNode(187, pos); + var forInStatement = createNode(188, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(125)) { - var forOfStatement = createNode(188, pos); + else if (parseOptional(126)) { + var forOfStatement = createNode(189, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(186, pos); + var forStatement = createNode(187, pos); forStatement.initializer = initializer; parseExpected(22); if (token !== 22 && token !== 17) { @@ -7125,7 +7192,7 @@ var ts; } parseExpected(22); if (token !== 17) { - forStatement.iterator = allowInAnd(parseExpression); + forStatement.incrementor = allowInAnd(parseExpression); } parseExpected(17); forOrForInOrForOfStatement = forStatement; @@ -7135,7 +7202,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 190 ? 66 : 71); + parseExpected(kind === 191 ? 66 : 71); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -7143,7 +7210,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(191); + var node = createNode(192); parseExpected(90); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -7152,7 +7219,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(192); + var node = createNode(193); parseExpected(101); parseExpected(16); node.expression = allowInAnd(parseExpression); @@ -7161,7 +7228,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(220); + var node = createNode(221); parseExpected(67); node.expression = allowInAnd(parseExpression); parseExpected(51); @@ -7169,7 +7236,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(221); + var node = createNode(222); parseExpected(73); parseExpected(51); node.statements = parseList(4, false, parseStatement); @@ -7179,12 +7246,12 @@ var ts; return token === 67 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(193); + var node = createNode(194); parseExpected(92); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); - var caseBlock = createNode(207, scanner.getStartPos()); + var caseBlock = createNode(208, scanner.getStartPos()); parseExpected(14); caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); @@ -7194,14 +7261,14 @@ var ts; function parseThrowStatement() { // ThrowStatement[Yield] : // throw [no LineTerminator here]Expression[In, ?Yield]; - var node = createNode(195); + var node = createNode(196); parseExpected(94); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(196); + var node = createNode(197); parseExpected(96); node.tryBlock = parseBlock(false, false); node.catchClause = token === 68 ? parseCatchClause() : undefined; @@ -7212,7 +7279,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(223); + var result = createNode(224); parseExpected(68); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); @@ -7222,7 +7289,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(197); + var node = createNode(198); parseExpected(72); parseSemicolon(); return finishNode(node); @@ -7231,13 +7298,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 65 && parseOptional(51)) { - var labeledStatement = createNode(194, fullStart); + var labeledStatement = createNode(195, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(182, fullStart); + var expressionStatement = createNode(183, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -7278,8 +7345,9 @@ var ts; return !isConstEnum; case 103: case 117: + case 118: case 77: - case 123: + case 124: if (isDeclarationStart()) { return false; } @@ -7324,9 +7392,9 @@ var ts; case 82: return parseForOrForInOrForOfStatement(); case 71: - return parseBreakOrContinueStatement(189); - case 66: return parseBreakOrContinueStatement(190); + case 66: + return parseBreakOrContinueStatement(191); case 90: return parseReturnStatement(); case 101: @@ -7389,16 +7457,16 @@ var ts; } function parseArrayBindingElement() { if (token === 23) { - return createNode(175); + return createNode(176); } - var node = createNode(152); + var node = createNode(153); node.dotDotDotToken = parseOptionalToken(21); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(152); + var node = createNode(153); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 51) { @@ -7413,14 +7481,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(150); + var node = createNode(151); parseExpected(14); node.elements = parseDelimitedList(10, parseObjectBindingElement); parseExpected(15); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(151); + var node = createNode(152); parseExpected(18); node.elements = parseDelimitedList(11, parseArrayBindingElement); parseExpected(19); @@ -7439,7 +7507,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(198); + var node = createNode(199); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -7448,7 +7516,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(199); + var node = createNode(200); switch (token) { case 98: break; @@ -7462,7 +7530,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 126 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -7477,7 +7545,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 17; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(180, fullStart); + var node = createNode(181, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -7485,7 +7553,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(200, fullStart); + var node = createNode(201, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(83); @@ -7496,7 +7564,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(135, pos); + var node = createNode(136, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(114); @@ -7505,7 +7573,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(134, fullStart); + var method = createNode(135, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -7516,7 +7584,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(132, fullStart); + var property = createNode(133, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -7583,7 +7651,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { + if (!ts.isKeyword(idToken) || idToken === 121 || idToken === 116) { return true; } switch (token) { @@ -7610,7 +7678,7 @@ var ts; decorators = []; decorators.pos = scanner.getStartPos(); } - var decorator = createNode(130, decoratorStart); + var decorator = createNode(131, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -7643,7 +7711,7 @@ var ts; } function parseClassElement() { if (token === 22) { - var result = createNode(178); + var result = createNode(179); nextToken(); return finishNode(result); } @@ -7674,10 +7742,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 175); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 202); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var savedStrictModeContext = inStrictModeContext(); @@ -7718,15 +7786,15 @@ var ts; } function parseHeritageClause() { if (token === 79 || token === 102) { - var node = createNode(222); + var node = createNode(223); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseHeritageClauseElement); + node.types = parseDelimitedList(8, parseExpressionWithTypeArguments); return finishNode(node); } return undefined; } - function parseHeritageClauseElement() { + function parseExpressionWithTypeArguments() { var node = createNode(177); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 24) { @@ -7741,7 +7809,7 @@ var ts; return parseList(6, false, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(202, fullStart); + var node = createNode(203, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(103); @@ -7752,10 +7820,10 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203, fullStart); + var node = createNode(204, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(123); + parseExpected(124); node.name = parseIdentifier(); parseExpected(53); node.type = parseType(); @@ -7763,13 +7831,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(226, scanner.getStartPos()); + var node = createNode(227, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(204, fullStart); + var node = createNode(205, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(77); @@ -7784,7 +7852,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(206, scanner.getStartPos()); + var node = createNode(207, scanner.getStartPos()); if (parseExpected(14)) { node.statements = parseList(1, false, parseModuleElement); parseExpected(15); @@ -7794,19 +7862,19 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { - var node = createNode(205, fullStart); + function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { + var node = createNode(206, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) + ? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 1) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(206, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -7814,13 +7882,20 @@ var ts; return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { - parseExpected(117); - return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) - : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); + var flags = modifiers ? modifiers.flags : 0; + if (parseOptional(118)) { + flags |= 32768; + } + else { + parseExpected(117); + if (token === 8) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + } + return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); } function isExternalModuleReference() { - return token === 118 && + return token === 119 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -7829,7 +7904,7 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 || - token === 124; + token === 125; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(85); @@ -7837,8 +7912,8 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 124) { - var importEqualsDeclaration = createNode(208, fullStart); + if (token !== 23 && token !== 125) { + var importEqualsDeclaration = createNode(209, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -7848,14 +7923,14 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(209, fullStart); + var importDeclaration = createNode(210, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(124); + parseExpected(125); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -7868,13 +7943,13 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(210, fullStart); + var importClause = createNode(211, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(213); } return finishNode(importClause); } @@ -7884,8 +7959,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(219); - parseExpected(118); + var node = createNode(220); + parseExpected(119); parseExpected(16); node.expression = parseModuleSpecifier(); parseExpected(17); @@ -7899,7 +7974,7 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(211); + var namespaceImport = createNode(212); parseExpected(35); parseExpected(111); namespaceImport.name = parseIdentifier(); @@ -7907,14 +7982,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 213 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(217); + return parseImportOrExportSpecifier(218); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(213); + return parseImportOrExportSpecifier(214); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -7933,22 +8008,22 @@ var ts; else { node.name = identifierName; } - if (kind === 213 && checkIdentifierIsKeyword) { + if (kind === 214 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(216, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35)) { - parseExpected(124); + parseExpected(125); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(216); - if (parseOptional(124)) { + node.exportClause = parseNamedImportsOrExports(217); + if (parseOptional(125)) { node.moduleSpecifier = parseModuleSpecifier(); } } @@ -7956,7 +8031,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(214, fullStart); + var node = createNode(215, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(53)) { @@ -7983,11 +8058,12 @@ var ts; case 69: case 103: case 77: - case 123: + case 124: return lookAhead(nextTokenIsIdentifierOrKeyword); case 85: return lookAhead(nextTokenCanFollowImportKeyword); case 117: + case 118: return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); case 78: return lookAhead(nextTokenCanFollowExportKeyword); @@ -8053,17 +8129,18 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 103: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 123: + case 124: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 77: return parseEnumDeclaration(fullStart, decorators, modifiers); case 117: + case 118: return parseModuleDeclaration(fullStart, decorators, modifiers); case 85: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: if (decorators) { - var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(219, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -8143,10 +8220,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 - || node.kind === 208 && node.moduleReference.kind === 219 - || node.kind === 209 - || node.kind === 214 + || node.kind === 209 && node.moduleReference.kind === 220 + || node.kind === 210 || node.kind === 215 + || node.kind === 216 ? node : undefined; }); @@ -8507,7 +8584,6 @@ var ts; var undefinedType = createIntrinsicType(32 | 262144, "undefined"); var nullType = createIntrinsicType(64 | 262144, "null"); var unknownType = createIntrinsicType(1, "unknown"); - var resolvingType = createIntrinsicType(1, "__resolving__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -8537,6 +8613,8 @@ var ts; var emitExtends = false; var emitDecorate = false; var emitParam = false; + var resolutionTargets = []; + var resolutionResults = []; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -8699,10 +8777,10 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 227); + return ts.getAncestor(node, 228); } function isGlobalSourceFile(node) { - return node.kind === 227 && !ts.isExternalModule(node); + return node.kind === 228 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8744,34 +8822,34 @@ var ts; } } switch (location.kind) { - case 227: + case 228: if (!ts.isExternalModule(location)) break; - case 205: + case 206: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 218)) { break loop; } result = undefined; } - else if (location.kind === 227 || - (location.kind === 205 && location.name.kind === 8)) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + else if (location.kind === 228 || + (location.kind === 206 && location.name.kind === 8)) { + result = getSymbolOfNode(location).exports["default"]; var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { + if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } break; - case 204: + case 205: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 133: case 132: - case 131: - if (location.parent.kind === 201 && !(location.flags & 128)) { + if (location.parent.kind === 202 && !(location.flags & 128)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455)) { @@ -8780,8 +8858,8 @@ var ts; } } break; - case 201: case 202: + case 203: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { if (lastLocation && lastLocation.flags & 128) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -8790,28 +8868,28 @@ var ts; break loop; } break; - case 127: + case 128: grandparent = location.parent.parent; - if (grandparent.kind === 201 || grandparent.kind === 202) { + if (grandparent.kind === 202 || grandparent.kind === 203) { 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 134: - case 133: case 135: + case 134: case 136: case 137: - case 200: - case 163: + case 138: + case 201: + case 164: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 162: + case 163: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -8822,15 +8900,15 @@ var ts; break loop; } break; - case 174: + case 175: var className = location.name; if (className && name === className.text) { result = location.symbol; break loop; } break; - case 130: - if (location.parent && location.parent.kind === 129) { + case 131: + if (location.parent && location.parent.kind === 130) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -8868,14 +8946,14 @@ var ts; ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); if (!isUsedBeforeDeclaration) { - var variableDeclaration = ts.getAncestor(declaration, 198); + var variableDeclaration = ts.getAncestor(declaration, 199); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 180 || - variableDeclaration.parent.parent.kind === 186) { + if (variableDeclaration.parent.parent.kind === 181 || + variableDeclaration.parent.parent.kind === 187) { isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 188 || - variableDeclaration.parent.parent.kind === 187) { + else if (variableDeclaration.parent.parent.kind === 189 || + variableDeclaration.parent.parent.kind === 188) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -8897,10 +8975,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } - while (node && node.kind !== 209) { + while (node && node.kind !== 210) { node = node.parent; } return node; @@ -8910,7 +8988,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 219) { + if (node.moduleReference.kind === 220) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -8920,7 +8998,7 @@ var ts; if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); if (!exportDefaultSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); + error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } return exportDefaultSymbol; } @@ -8999,17 +9077,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 208: + case 209: return getTargetOfImportEqualsDeclaration(node); - case 210: - return getTargetOfImportClause(node); case 211: + return getTargetOfImportClause(node); + case 212: return getTargetOfNamespaceImport(node); - case 213: - return getTargetOfImportSpecifier(node); - case 217: - return getTargetOfExportSpecifier(node); case 214: + return getTargetOfImportSpecifier(node); + case 218: + return getTargetOfExportSpecifier(node); + case 215: return getTargetOfExportAssignment(node); } } @@ -9051,10 +9129,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214) { + if (node.kind === 215) { checkExpressionCached(node.expression); } - else if (node.kind === 217) { + else if (node.kind === 218) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -9064,17 +9142,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 208); + importDeclaration = ts.getAncestor(entityName, 209); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 65 || entityName.parent.kind === 126) { + if (entityName.kind === 65 || entityName.parent.kind === 127) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 208); + ts.Debug.assert(entityName.parent.kind === 209); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -9087,14 +9165,15 @@ var ts; } var symbol; if (name.kind === 65) { - symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + var message = meaning === 1536 ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; + symbol = resolveName(name, name.text, meaning, message, name); if (!symbol) { return undefined; } } - else if (name.kind === 126 || name.kind === 155) { - var left = name.kind === 126 ? name.left : name.expression; - var right = name.kind === 126 ? name.right : name.name; + else if (name.kind === 127 || name.kind === 156) { + var left = name.kind === 127 ? name.left : name.expression; + var right = name.kind === 127 ? name.right : name.name; var namespace = resolveEntityName(left, 1536); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -9147,10 +9226,10 @@ var ts; if (sourceFile.symbol) { return sourceFile.symbol; } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.fileName); + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); return; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); + error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); } function resolveExternalModuleSymbol(moduleSymbol) { return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; @@ -9158,7 +9237,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { var symbol = resolveExternalModuleSymbol(moduleSymbol); if (symbol && !(symbol.flags & (1536 | 3))) { - error(moduleReferenceExpression, ts.Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; @@ -9238,7 +9317,7 @@ var ts; var members = node.members; for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 135 && ts.nodeIsPresent(member.body)) { + if (member.kind === 136 && ts.nodeIsPresent(member.body)) { return member; } } @@ -9303,17 +9382,17 @@ var ts; } } switch (location_1.kind) { - case 227: + case 228: if (!ts.isExternalModule(location_1)) { break; } - case 205: + case 206: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 201: case 202: + case 203: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -9428,8 +9507,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 205 && declaration.name.kind === 8) || - (declaration.kind === 227 && ts.isExternalModule(declaration)); + return (declaration.kind === 206 && declaration.name.kind === 8) || + (declaration.kind === 228 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9461,11 +9540,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 144) { + if (entityName.parent.kind === 145) { meaning = 107455 | 1048576; } - else if (entityName.kind === 126 || entityName.kind === 155 || - entityName.parent.kind === 208) { + else if (entityName.kind === 127 || entityName.kind === 156 || + entityName.parent.kind === 209) { meaning = 1536; } else { @@ -9509,10 +9588,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 149) { + while (node.kind === 150) { node = node.parent; } - if (node.kind === 203) { + if (node.kind === 204) { return getSymbolOfNode(node); } } @@ -9684,7 +9763,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 227 || declaration.parent.kind === 206; + return declaration.parent.kind === 228 || declaration.parent.kind === 207; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -9759,7 +9838,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 121); + writeKeyword(writer, 122); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9772,7 +9851,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 119); + writeKeyword(writer, 120); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -9916,12 +9995,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 205) { + if (node.kind === 206) { if (node.name.kind === 8) { return node; } } - else if (node.kind === 227) { + else if (node.kind === 228) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9964,59 +10043,59 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 152: + case 153: return isDeclarationVisible(node.parent.parent); - case 198: + case 199: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 205: - case 201: + case 206: case 202: case 203: - case 200: case 204: - case 208: + case 201: + case 205: + case 209: var parent_2 = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + !(node.kind !== 209 && parent_2.kind !== 228 && ts.isInAmbientContext(parent_2))) { return isGlobalSourceFile(parent_2); } return isDeclarationVisible(parent_2); - case 132: - case 131: - case 136: - case 137: - case 134: case 133: + case 132: + case 137: + case 138: + case 135: + case 134: if (node.flags & (32 | 64)) { return false; } - case 135: - case 139: - case 138: + case 136: case 140: - case 129: - case 206: - case 142: - case 143: - case 145: + case 139: case 141: + case 130: + case 207: + case 143: + case 144: case 146: + case 142: case 147: case 148: case 149: + case 150: return isDeclarationVisible(node.parent); - case 210: case 211: - case 213: - return false; - case 128: - case 227: - return true; + case 212: case 214: return false; + case 129: + case 228: + return true; + case 215: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -10031,10 +10110,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 214) { + if (node.parent && node.parent.kind === 215) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 218) { exportSymbol = getTargetOfExportSpecifier(node.parent); } var result = []; @@ -10058,15 +10137,35 @@ var ts; }); } } + function pushTypeResolution(target) { + var i = 0; + var count = resolutionTargets.length; + while (i < count && resolutionTargets[i] !== target) { + i++; + } + if (i < count) { + do { + resolutionResults[i++] = false; + } while (i < count); + return false; + } + resolutionTargets.push(target); + resolutionResults.push(true); + return true; + } + function popTypeResolution() { + resolutionTargets.pop(); + return resolutionResults.pop(); + } function getRootDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 153) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 198 ? node.parent.parent.parent : node.parent; + return node.kind === 199 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -10089,7 +10188,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 150) { + if (pattern.kind === 151) { var name_5 = declaration.propertyName || declaration.name; type = getTypeOfPropertyOfType(parentType, name_5.text) || isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || @@ -10126,10 +10225,10 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 187) { + if (declaration.parent.parent.kind === 188) { return anyType; } - if (declaration.parent.parent.kind === 188) { + if (declaration.parent.parent.kind === 189) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { @@ -10138,10 +10237,10 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 130) { var func = declaration.parent; - if (func.kind === 137 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); + if (func.kind === 138 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 137); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10154,7 +10253,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 225) { + if (declaration.kind === 226) { return checkIdentifier(declaration.name); } return undefined; @@ -10183,7 +10282,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 176 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -10198,7 +10297,7 @@ var ts; return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 150 + return pattern.kind === 151 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -10208,7 +10307,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 224 ? getWidenedType(type) : type; + return declaration.kind !== 225 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -10216,7 +10315,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 130 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -10229,26 +10328,29 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 223) { + if (declaration.parent.kind === 224) { return links.type = anyType; } - if (declaration.kind === 214) { + if (declaration.kind === 215) { return links.type = checkExpression(declaration.expression); } - links.type = resolvingType; + if (!pushTypeResolution(symbol)) { + return unknownType; + } var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + if (!popTypeResolution()) { + if (symbol.valueDeclaration.type) { + type = unknownType; + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + } + else { + type = anyType; + if (compilerOptions.noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + } } + links.type = type; } return links.type; } @@ -10257,7 +10359,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 136) { + if (accessor.kind === 137) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10269,15 +10371,12 @@ var ts; } function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - function checkAndStoreTypeOfAccessors(symbol, links) { - links = links || getSymbolLinks(symbol); if (!links.type) { - links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 136); - var setter = ts.getDeclarationOfKind(symbol, 137); + if (!pushTypeResolution(symbol)) { + return unknownType; + } + var getter = ts.getDeclarationOfKind(symbol, 137); + var setter = ts.getDeclarationOfKind(symbol, 138); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10300,17 +10399,16 @@ var ts; } } } - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 136); - error(getter, 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)); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 137); + 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)); + } } + links.type = type; } + return links.type; } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); @@ -10374,7 +10472,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 202 || node.kind === 201) { + if (node.kind === 203 || node.kind === 202) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10408,10 +10506,10 @@ var ts; } function resolveBaseTypesOfClass(type) { type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(type.symbol, 201); + var declaration = ts.getDeclarationOfKind(type.symbol, 202); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + var baseType = getTypeFromTypeNode(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10431,10 +10529,10 @@ var ts; type.baseTypes = []; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 203 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; - var baseType = getTypeFromHeritageClauseElement(node); + var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 | 2048)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10452,10 +10550,11 @@ var ts; } } } - function getDeclaredTypeOfClass(symbol) { + function getDeclaredTypeOfClassOrInterface(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024, symbol); + var kind = symbol.flags & 32 ? 1024 : 2048; + var type = links.declaredType = createObjectType(kind, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { type.flags |= 4096; @@ -10465,49 +10564,22 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); - } - return links.declaredType; - } - function getDeclaredTypeOfInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); } return links.declaredType; } function getDeclaredTypeOfTypeAlias(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 203); - var type = getTypeFromTypeNode(declaration.type); - if (links.declaredType === resolvingType) { - links.declaredType = type; + if (!pushTypeResolution(links)) { + return unknownType; } - } - else if (links.declaredType === resolvingType) { - links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 203); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 204); + var type = getTypeFromTypeNode(declaration.type); + if (!popTypeResolution()) { + type = unknownType; + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + links.declaredType = type; } return links.declaredType; } @@ -10525,7 +10597,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 128).constraint) { + if (!ts.getDeclarationOfKind(symbol, 129).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10541,11 +10613,8 @@ var ts; } function getDeclaredTypeOfSymbol(symbol) { ts.Debug.assert((symbol.flags & 16777216) === 0); - if (symbol.flags & 32) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & 64) { - return getDeclaredTypeOfInterface(symbol); + if (symbol.flags & (32 | 64)) { + return getDeclaredTypeOfClassOrInterface(symbol); } if (symbol.flags & 524288) { return getDeclaredTypeOfTypeAlias(symbol); @@ -10593,15 +10662,27 @@ var ts; } } } + function resolveDeclaredMembers(type) { + if (!type.declaredProperties) { + var symbol = type.symbol; + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); + } + return type; + } function resolveClassOrInterfaceMembers(type) { - var members = type.symbol.members; - var callSignatures = type.declaredCallSignatures; - var constructSignatures = type.declaredConstructSignatures; - var stringIndexType = type.declaredStringIndexType; - var numberIndexType = type.declaredNumberIndexType; - var baseTypes = getBaseTypes(type); + var target = resolveDeclaredMembers(type); + var members = target.symbol.members; + var callSignatures = target.declaredCallSignatures; + var constructSignatures = target.declaredConstructSignatures; + var stringIndexType = target.declaredStringIndexType; + var numberIndexType = target.declaredNumberIndexType; + var baseTypes = getBaseTypes(target); if (baseTypes.length) { - members = createSymbolTable(type.declaredProperties); + members = createSymbolTable(target.declaredProperties); for (var _i = 0; _i < baseTypes.length; _i++) { var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); @@ -10614,7 +10695,7 @@ var ts; setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveTypeReferenceMembers(type) { - var target = type.target; + var target = resolveDeclaredMembers(type.target); var mapper = createTypeMapper(target.typeParameters, type.typeArguments); var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); @@ -10752,7 +10833,7 @@ var ts; callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & 32) { - var classType = getDeclaredTypeOfClass(symbol); + var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); @@ -10853,7 +10934,7 @@ var ts; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (!prop) { + if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 | 64)) { return undefined; } if (!props) { @@ -10963,7 +11044,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 136 ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -10992,8 +11073,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 137); + if (declaration.kind === 137 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 138); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -11011,19 +11092,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 142: case 143: - case 200: - case 134: - case 133: + case 144: + case 201: case 135: - case 138: + case 134: + case 136: case 139: case 140: - case 136: + case 141: case 137: - case 162: + case 138: case 163: + case 164: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11037,7 +11118,9 @@ var ts; } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; + if (!pushTypeResolution(signature)) { + return unknownType; + } var type; if (signature.target) { type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); @@ -11048,27 +11131,25 @@ var ts; else { type = getReturnTypeFromBody(signature.declaration); } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, 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, ts.declarationNameToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_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); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, 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, ts.declarationNameToString(declaration.name)); + } + else { + error(declaration, ts.Diagnostics.Function_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); + } } } + signature.resolvedReturnType = type; } return signature.resolvedReturnType; } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { - var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); if (type.flags & 4096 && type.target === globalArrayType) { return type.typeArguments[0]; } @@ -11093,7 +11174,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; + var isConstructor = signature.declaration.kind === 136 || signature.declaration.kind === 140; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; @@ -11107,7 +11188,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 119 : 121; + var syntaxKind = kind === 1 ? 120 : 122; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11137,7 +11218,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 129).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11187,13 +11268,13 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 129; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 141 && n.typeName.kind === 65) { + if (n.kind === 142 && n.typeName.kind === 65) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); @@ -11212,18 +11293,12 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReference(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromHeritageClauseElement(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromTypeReferenceOrHeritageClauseElement(node) { + function getTypeFromTypeReferenceOrExpressionWithTypeArguments(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var type; - if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { - var typeNameOrExpression = node.kind === 141 + if (node.kind !== 177 || ts.isSupportedExpressionWithTypeArguments(node)) { + var typeNameOrExpression = node.kind === 142 ? node.typeName : node.expression; var symbol = resolveEntityName(typeNameOrExpression, 793056); @@ -11269,9 +11344,9 @@ var ts; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 201: case 202: - case 204: + case 203: + case 205: return declaration; } } @@ -11460,38 +11535,38 @@ var ts; switch (node.kind) { case 112: return anyType; - case 121: + case 122: return stringType; - case 119: + case 120: return numberType; case 113: return booleanType; - case 122: + case 123: return esSymbolType; case 99: return voidType; case 8: return getTypeFromStringLiteral(node); - case 141: - return getTypeFromTypeReference(node); - case 177: - return getTypeFromHeritageClauseElement(node); - case 144: - return getTypeFromTypeQueryNode(node); - case 146: - return getTypeFromArrayTypeNode(node); - case 147: - return getTypeFromTupleTypeNode(node); - case 148: - return getTypeFromUnionTypeNode(node); - case 149: - return getTypeFromTypeNode(node.type); case 142: - case 143: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case 177: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); case 145: + return getTypeFromTypeQueryNode(node); + case 147: + return getTypeFromArrayTypeNode(node); + case 148: + return getTypeFromTupleTypeNode(node); + case 149: + return getTypeFromUnionTypeNode(node); + case 150: + return getTypeFromTypeNode(node.type); + case 143: + case 144: + case 146: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); case 65: - case 126: + case 127: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11642,27 +11717,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 162: case 163: + case 164: return isContextSensitiveFunctionLikeDeclaration(node); - case 154: + case 155: return ts.forEach(node.properties, isContextSensitive); - case 153: + case 154: return ts.forEach(node.elements, isContextSensitive); - case 170: + case 171: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 169: + case 170: return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 224: + case 225: return isContextSensitive(node.initializer); + case 135: case 134: - case 133: return isContextSensitiveFunctionLikeDeclaration(node); - case 161: + case 162: return isContextSensitive(node.expression); } return false; @@ -12436,22 +12511,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 133: case 132: - case 131: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 129: + case 130: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 200: + case 201: + case 135: case 134: - case 133: - case 136: case 137: - case 162: + case 138: case 163: + case 164: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -12694,10 +12769,10 @@ var ts; function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 144: + case 145: return true; case 65: - case 126: + case 127: node = node.parent; continue; default: @@ -12739,7 +12814,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { var n = node.left; - while (n.kind === 161) { + while (n.kind === 162) { n = n.expression; } if (n.kind === 65 && getResolvedSymbol(n) === symbol) { @@ -12756,46 +12831,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 169: + case 170: return isAssignedInBinaryExpression(node); - case 198: - case 152: - return isAssignedInVariableDeclaration(node); - case 150: - case 151: + case 199: case 153: + return isAssignedInVariableDeclaration(node); + case 151: + case 152: case 154: case 155: case 156: case 157: case 158: - case 160: + case 159: case 161: - case 167: - case 164: + case 162: + case 168: case 165: case 166: - case 168: - case 170: - case 173: - case 179: + case 167: + case 169: + case 171: + case 174: case 180: - case 182: + case 181: case 183: case 184: case 185: case 186: case 187: case 188: - case 191: + case 189: case 192: case 193: - case 220: - case 221: case 194: + case 221: + case 222: case 195: case 196: - case 223: + case 197: + case 224: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12831,17 +12906,17 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 183: + case 184: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 170: + case 171: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 169: + case 170: if (child === node.right) { if (node.operatorToken.kind === 48) { narrowedType = narrowType(type, node.left, true); @@ -12851,14 +12926,14 @@ var ts; } } break; - case 227: - case 205: - case 200: - case 134: - case 133: - case 136: - case 137: + case 228: + case 206: + case 201: case 135: + case 134: + case 137: + case 138: + case 136: break loop; } if (narrowedType !== type) { @@ -12871,7 +12946,7 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 165 || expr.right.kind !== 8) { + if (expr.left.kind !== 166 || expr.right.kind !== 8) { return type; } var left = expr.left; @@ -12930,23 +13005,38 @@ var ts; return type; } var prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (!prototypeProperty) { - return type; + if (prototypeProperty) { + var targetType = getTypeOfSymbol(prototypeProperty); + if (targetType !== anyType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 16384) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + } + } } - var targetType = getTypeOfSymbol(prototypeProperty); - if (isTypeSubtypeOf(targetType, type)) { - return targetType; + var constructSignatures; + if (rightType.flags & 2048) { + constructSignatures = resolveDeclaredMembers(rightType).declaredConstructSignatures; } - if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + else if (rightType.flags & 32768) { + constructSignatures = getSignaturesOfType(rightType, 1); + } + if (constructSignatures && constructSignatures.length !== 0) { + var instanceType = getUnionType(ts.map(constructSignatures, function (signature) { return getReturnTypeOfSignature(getErasedSignature(signature)); })); + if (type.flags & 16384) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, instanceType); })); + } + return instanceType; } return type; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 161: + case 162: return narrowType(type, expr.expression, assumeTrue); - case 169: + case 170: var operator = expr.operatorToken.kind; if (operator === 30 || operator === 31) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12961,7 +13051,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 167: + case 168: if (expr.operator === 46) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12972,7 +13062,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163 && languageVersion < 2) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 164 && 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); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -12996,15 +13086,15 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 223) { + symbol.valueDeclaration.parent.kind === 224) { return; } var container = symbol.valueDeclaration; - while (container.kind !== 199) { + while (container.kind !== 200) { container = container.parent; } container = container.parent; - if (container.kind === 180) { + if (container.kind === 181) { container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -13021,9 +13111,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 ? container.parent : undefined; getNodeLinks(node).flags |= 2; - if (container.kind === 132 || container.kind === 135) { + if (container.kind === 133 || container.kind === 136) { getNodeLinks(classNode).flags |= 4; } else { @@ -13033,36 +13123,36 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 163) { + if (container.kind === 164) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 205: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + case 206: + error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 204: + case 205: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 135: + case 136: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 133: case 132: - case 131: if (container.flags & 128) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 127: + case 128: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -13071,15 +13161,15 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 129) { + if (n.kind === 130) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 201); + var isCallExpression = node.parent.kind === 158 && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 202); var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -13095,31 +13185,31 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 135; + canUseSuperExpression = container.kind === 136; } else { needToCaptureLexicalThis = false; - while (container && container.kind === 163) { + while (container && container.kind === 164) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } - if (container && container.parent && container.parent.kind === 201) { + if (container && container.parent && container.parent.kind === 202) { if (container.flags & 128) { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || - container.kind === 137; + container.kind === 135 || + container.kind === 134 || + container.kind === 137 || + container.kind === 138; } else { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || + container.kind === 135 || + container.kind === 134 || container.kind === 137 || + container.kind === 138 || + container.kind === 133 || container.kind === 132 || - container.kind === 131 || - container.kind === 135; + container.kind === 136; } } } @@ -13133,7 +13223,7 @@ var ts; getNodeLinks(node).flags |= 16; returnType = baseClass; } - if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 136 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -13143,7 +13233,7 @@ var ts; return returnType; } } - if (container && container.kind === 127) { + if (container && container.kind === 128) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -13168,7 +13258,7 @@ var ts; } if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters)); } } } @@ -13181,7 +13271,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 130) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -13196,7 +13286,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { + if (func.type || func.kind === 136 || func.kind === 137 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 138))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignatureForFunctionLikeDeclaration(func); @@ -13216,7 +13306,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 159) { + if (template.parent.kind === 160) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -13324,32 +13414,32 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 198: - case 129: + case 199: + case 130: + case 133: case 132: - case 131: - case 152: - return getContextualTypeForInitializerExpression(node); - case 163: - case 191: - return getContextualTypeForReturnExpression(node); - case 157: - case 158: - return getContextualTypeForArgument(parent, node); - case 160: - return getTypeFromTypeNode(parent.type); - case 169: - return getContextualTypeForBinaryOperand(node); - case 224: - return getContextualTypeForObjectLiteralElement(parent); case 153: - return getContextualTypeForElementExpression(node); - case 170: - return getContextualTypeForConditionalOperand(node); - case 176: - ts.Debug.assert(parent.parent.kind === 171); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 164: + case 192: + return getContextualTypeForReturnExpression(node); + case 158: + case 159: + return getContextualTypeForArgument(parent, node); case 161: + return getTypeFromTypeNode(parent.type); + case 170: + return getContextualTypeForBinaryOperand(node); + case 225: + return getContextualTypeForObjectLiteralElement(parent); + case 154: + return getContextualTypeForElementExpression(node); + case 171: + return getContextualTypeForConditionalOperand(node); + case 178: + ts.Debug.assert(parent.parent.kind === 172); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 162: return getContextualType(parent); } return undefined; @@ -13364,13 +13454,13 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 162 || node.kind === 163; + return node.kind === 163 || node.kind === 164; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -13414,13 +13504,13 @@ var ts; } function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { + if (parent.kind === 170 && parent.operatorToken.kind === 53 && parent.left === node) { return true; } - if (parent.kind === 224) { + if (parent.kind === 225) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 153) { + if (parent.kind === 154) { return isAssignmentTarget(parent); } return false; @@ -13439,7 +13529,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0; _i < elements.length; _i++) { var e = elements[_i]; - if (inDestructuringPattern && e.kind === 173) { + if (inDestructuringPattern && e.kind === 174) { var restArrayType = checkExpression(e.expression, contextualMapper); var restElementType = getIndexTypeOfType(restArrayType, 1) || (languageVersion >= 2 ? checkIteratedType(restArrayType, undefined) : undefined); @@ -13451,7 +13541,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 173; + hasSpreadElement = hasSpreadElement || e.kind === 174; } if (!hasSpreadElement) { var contextualType = getContextualType(node); @@ -13462,7 +13552,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 128 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); @@ -13492,18 +13582,18 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 224 || - memberDecl.kind === 225 || + if (memberDecl.kind === 225 || + memberDecl.kind === 226 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 224) { + if (memberDecl.kind === 225) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 134) { + else if (memberDecl.kind === 135) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 225); + ts.Debug.assert(memberDecl.kind === 226); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -13518,7 +13608,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); + ts.Debug.assert(memberDecl.kind === 137 || memberDecl.kind === 138); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -13551,7 +13641,7 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 132; + return s.valueDeclaration ? s.valueDeclaration.kind : 133; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; @@ -13561,7 +13651,7 @@ var ts; if (!(flags & (32 | 64))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 201); + var enclosingClassDeclaration = ts.getAncestor(node, 202); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32) { @@ -13608,7 +13698,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 135) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13620,14 +13710,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 155 + var left = node.kind === 156 ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 135) { return false; } else { @@ -13642,7 +13732,7 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 158 && node.parent.expression === node) { + if (node.parent.kind === 159 && 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); @@ -13738,7 +13828,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 159) { + if (node.kind === 160) { checkExpression(node.template); } else { @@ -13791,7 +13881,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 173) { + if (args[i].kind === 174) { return i; } } @@ -13801,11 +13891,11 @@ var ts; var adjustedArgCount; var typeArguments; var callIsIncomplete; - if (node.kind === 159) { + if (node.kind === 160) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 171) { + if (tagExpression.template.kind === 172) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -13820,7 +13910,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 158); + ts.Debug.assert(callExpression.kind === 159); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -13872,10 +13962,10 @@ var ts; } for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { + if (arg.kind !== 176) { var paramType = getTypeAtPosition(signature, i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 159) { + if (i === 0 && args[i].parent.kind === 160) { argType = globalTemplateStringsArrayType; } else { @@ -13915,9 +14005,9 @@ var ts; function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { + if (arg.kind !== 176) { var paramType = getTypeAtPosition(signature, i); - var argType = i === 0 && node.kind === 159 + var argType = i === 0 && node.kind === 160 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) @@ -13931,10 +14021,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 159) { + if (node.kind === 160) { var template = node.template; args = [template]; - if (template.kind === 171) { + if (template.kind === 172) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -13947,7 +14037,7 @@ var ts; } function getEffectiveTypeArguments(callExpression) { if (callExpression.expression.kind === 91) { - var containingClass = ts.getAncestor(callExpression, 201); + var containingClass = ts.getAncestor(callExpression, 202); var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } @@ -13956,7 +14046,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 159; + var isTaggedTemplate = node.kind === 160; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); @@ -14166,13 +14256,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 157) { + if (node.kind === 158) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 158) { + else if (node.kind === 159) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 159) { + else if (node.kind === 160) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -14187,12 +14277,12 @@ var ts; if (node.expression.kind === 91) { return voidType; } - if (node.kind === 158) { + if (node.kind === 159) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 135 && - declaration.kind !== 139 && - declaration.kind !== 143) { + declaration.kind !== 136 && + declaration.kind !== 140 && + declaration.kind !== 144) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -14228,9 +14318,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; + var parameter = ts.lastOrUndefined(signature.parameters); var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + links.type = instantiateType(getTypeOfSymbol(ts.lastOrUndefined(context.parameters)), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -14239,7 +14329,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 179) { + if (func.body.kind !== 180) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -14277,7 +14367,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 195); + return (body.statements.length === 1) && (body.statements[0].kind === 196); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { @@ -14286,7 +14376,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 180) { return; } var bodyBlock = func.body; @@ -14299,9 +14389,9 @@ var ts; error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 162) { + if (!hasGrammarError && node.kind === 163) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -14318,10 +14408,9 @@ var ts; if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } - if (!node.type) { - signature.resolvedReturnType = resolvingType; + if (!node.type && !signature.resolvedReturnType) { var returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { + if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } } @@ -14329,19 +14418,19 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { + if (produceDiagnostics && node.kind !== 135 && node.kind !== 134) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); if (node.type && !node.asteriskToken) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { - if (node.body.kind === 179) { + if (node.body.kind === 180) { checkSourceElement(node.body); } else { @@ -14371,13 +14460,13 @@ var ts; var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 155: { + case 156: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 156: + case 157: return true; - case 161: + case 162: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -14386,11 +14475,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 65: - case 155: { + case 156: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; } - case 156: { + case 157: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 8) { @@ -14400,7 +14489,7 @@ var ts; } return false; } - case 161: + case 162: return isConstVariableReference(n.expression); default: return false; @@ -14525,7 +14614,7 @@ var ts; var properties = node.properties; for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 225 || p.kind === 226) { var name_8 = p.name; var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name_8.text) || @@ -14549,8 +14638,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { + if (e.kind !== 176) { + if (e.kind !== 174) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) @@ -14574,7 +14663,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 169 && restExpression.operatorToken.kind === 53) { + if (restExpression.kind === 170 && restExpression.operatorToken.kind === 53) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -14587,14 +14676,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 170 && target.operatorToken.kind === 53) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 154) { + if (target.kind === 155) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 153) { + if (target.kind === 154) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -14611,7 +14700,7 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { + if (operator === 53 && (node.left.kind === 155 || node.left.kind === 154)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); @@ -14785,14 +14874,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 127) { + if (node.name.kind === 128) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 127) { + if (node.name.kind === 128) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -14819,7 +14908,7 @@ var ts; } function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 126) { + if (node.kind == 127) { type = checkQualifiedName(node); } else { @@ -14827,9 +14916,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 155 && node.parent.expression === node) || - (node.parent.kind === 156 && node.parent.expression === node) || - ((node.kind === 65 || node.kind === 126) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 156 && node.parent.expression === node) || + (node.parent.kind === 157 && node.parent.expression === node) || + ((node.kind === 65 || node.kind === 127) && 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); } @@ -14855,54 +14944,54 @@ var ts; return booleanType; case 7: return checkNumericLiteral(node); - case 171: + case 172: return checkTemplateExpression(node); case 8: case 10: return stringType; case 9: return globalRegExpType; - case 153: - return checkArrayLiteral(node, contextualMapper); case 154: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, contextualMapper); case 155: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, contextualMapper); case 156: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 157: + return checkIndexedAccess(node); case 158: - return checkCallExpression(node); case 159: - return checkTaggedTemplateExpression(node); + return checkCallExpression(node); case 160: - return checkTypeAssertion(node); + return checkTaggedTemplateExpression(node); case 161: - return checkExpression(node.expression, contextualMapper); - case 174: - return checkClassExpression(node); + return checkTypeAssertion(node); case 162: - case 163: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 165: - return checkTypeOfExpression(node); - case 164: - return checkDeleteExpression(node); - case 166: - return checkVoidExpression(node); - case 167: - return checkPrefixUnaryExpression(node); - case 168: - return checkPostfixUnaryExpression(node); - case 169: - return checkBinaryExpression(node, contextualMapper); - case 170: - return checkConditionalExpression(node, contextualMapper); - case 173: - return checkSpreadElementExpression(node, contextualMapper); + return checkExpression(node.expression, contextualMapper); case 175: + return checkClassExpression(node); + case 163: + case 164: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); + case 166: + return checkTypeOfExpression(node); + case 165: + return checkDeleteExpression(node); + case 167: + return checkVoidExpression(node); + case 168: + return checkPrefixUnaryExpression(node); + case 169: + return checkPostfixUnaryExpression(node); + case 170: + return checkBinaryExpression(node, contextualMapper); + case 171: + return checkConditionalExpression(node, contextualMapper); + case 174: + return checkSpreadElementExpression(node, contextualMapper); + case 176: return undefinedType; - case 172: + case 173: checkYieldExpression(node); return unknownType; } @@ -14931,7 +15020,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 112) { func = ts.getContainingFunction(node); - if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 136 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -14943,12 +15032,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 140) { + if (node.kind === 141) { checkGrammarIndexSignature(node); } - else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || - node.kind === 138 || node.kind === 135 || - node.kind === 139) { + else if (node.kind === 143 || node.kind === 201 || node.kind === 144 || + node.kind === 139 || node.kind === 136 || + node.kind === 140) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14960,10 +15049,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 139: + case 140: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 138: + case 139: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -14972,7 +15061,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 202) { + if (node.kind === 203) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14987,7 +15076,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 121: + case 122: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -14995,7 +15084,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 119: + case 120: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -15032,17 +15121,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 157 && n.expression.kind === 91; + return n.kind === 158 && n.expression.kind === 91; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 162: - case 200: case 163: - case 154: return false; + case 201: + case 164: + case 155: return false; default: return ts.forEachChild(n, containsSuperCall); } } @@ -15050,12 +15139,12 @@ var ts; if (n.kind === 93) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 162 && n.kind !== 200) { + else if (n.kind !== 163 && n.kind !== 201) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 132 && + return n.kind === 133 && !(n.flags & 128) && !!n.initializer; } @@ -15065,7 +15154,7 @@ var ts; ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 182 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 183 || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -15081,13 +15170,13 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 136) { + if (node.kind === 137) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 136 ? 137 : 136; + var otherKind = node.kind === 137 ? 138 : 137; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112) !== (otherAccessor.flags & 112))) { @@ -15102,7 +15191,7 @@ var ts; } } } - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); + getTypeOfAccessors(getSymbolOfNode(node)); } checkFunctionLikeDeclaration(node); } @@ -15111,15 +15200,15 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeReferenceInStrictMode(node.typeName); - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkHeritageClauseElement(node) { - checkGrammarHeritageClauseElementInStrictMode(node.expression); - return checkTypeReferenceOrHeritageClauseElement(node); + function checkExpressionWithTypeArguments(node) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(node.expression); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkTypeReferenceOrHeritageClauseElement(node) { + function checkTypeReferenceOrExpressionWithTypeArguments(node) { checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); + var type = getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); if (type !== unknownType && node.typeArguments) { var len = node.typeArguments.length; for (var i = 0; i < len; i++) { @@ -15172,9 +15261,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 202) { - ts.Debug.assert(signatureDeclarationNode.kind === 138 || signatureDeclarationNode.kind === 139); - var signatureKind = signatureDeclarationNode.kind === 138 ? 0 : 1; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 203) { + ts.Debug.assert(signatureDeclarationNode.kind === 139 || signatureDeclarationNode.kind === 140); + var signatureKind = signatureDeclarationNode.kind === 139 ? 0 : 1; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -15192,7 +15281,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 203 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; } @@ -15265,7 +15354,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) { - ts.Debug.assert(node.kind === 134 || node.kind === 133); + ts.Debug.assert(node.kind === 135 || node.kind === 134); ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128)); var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); @@ -15292,11 +15381,11 @@ var ts; var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 202 || node.parent.kind === 145 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 203 || node.parent.kind === 146 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { + if (node.kind === 201 || node.kind === 135 || node.kind === 134 || node.kind === 136) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -15393,16 +15482,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 202: + case 203: return 2097152; - case 205: + case 206: return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 201: - case 204: + case 202: + case 205: return 2097152 | 1048576; - case 208: + case 209: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -15416,29 +15505,29 @@ var ts; var expression = node.expression; var exprType = checkExpression(expression); switch (node.parent.kind) { - case 201: + case 202: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]); checkTypeAssignableTo(exprType, classDecoratorType, node); break; - case 132: + case 133: checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node); break; - case 134: - case 136: + case 135: case 137: + case 138: var methodType = getTypeOfNode(node.parent); var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]); checkTypeAssignableTo(exprType, methodDecoratorType, node); break; - case 129: + case 130: checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node); break; } } function checkTypeNodeAsExpression(node) { - if (node && node.kind === 141) { + if (node && node.kind === 142) { var type = getTypeFromTypeNode(node); var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 | 132 | 258))) { @@ -15451,19 +15540,19 @@ var ts; } function checkTypeAnnotationAsExpression(node) { switch (node.kind) { - case 132: + case 133: checkTypeNodeAsExpression(node.type); break; - case 129: + case 130: checkTypeNodeAsExpression(node.type); break; - case 134: - checkTypeNodeAsExpression(node.type); - break; - case 136: + case 135: checkTypeNodeAsExpression(node.type); break; case 137: + checkTypeNodeAsExpression(node.type); + break; + case 138: checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); break; } @@ -15483,24 +15572,24 @@ var ts; } if (compilerOptions.emitDecoratorMetadata) { switch (node.kind) { - case 201: + case 202: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 134: + case 135: checkParameterTypeAnnotationsAsExpressions(node); + case 138: case 137: - case 136: - case 132: - case 129: + case 133: + case 130: checkTypeAnnotationAsExpression(node); break; } } emitDecorate = true; - if (node.kind === 129) { + if (node.kind === 130) { emitParam = true; } ts.forEach(node.decorators, checkDecorator); @@ -15520,7 +15609,7 @@ var ts; checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 127) { + if (node.name && node.name.kind === 128) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -15545,11 +15634,11 @@ var ts; } } function checkBlock(node) { - if (node.kind === 179) { + if (node.kind === 180) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 206) { + if (ts.isFunctionBlock(node) || node.kind === 207) { checkFunctionExpressionBodies(node); } } @@ -15567,19 +15656,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 132 || - node.kind === 131 || + if (node.kind === 133 || + node.kind === 132 || + node.kind === 135 || node.kind === 134 || - node.kind === 133 || - node.kind === 136 || - node.kind === 137) { + node.kind === 137 || + node.kind === 138) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = getRootDeclaration(node); - if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 130 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -15609,7 +15698,7 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 201); + var enclosingClass = ts.getAncestor(node, 202); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } @@ -15627,12 +15716,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 206 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 227 && ts.isExternalModule(parent)) { - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); + if (parent.kind === 228 && ts.isExternalModule(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)); } } function checkVarDeclaredNamesNotShadowed(node) { @@ -15642,7 +15731,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 12288) !== 0 || isParameterDeclaration(node)) { return; } - if (node.kind === 198 && !node.initializer) { + if (node.kind === 199 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -15652,15 +15741,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 199); - var container = varDeclList.parent.kind === 180 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 200); + var container = varDeclList.parent.kind === 181 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 179 && ts.isFunctionLike(container.parent) || + (container.kind === 180 && ts.isFunctionLike(container.parent) || + container.kind === 207 || container.kind === 206 || - container.kind === 205 || - container.kind === 227); + container.kind === 228); if (!namesShareScope) { var name_9 = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_9, name_9); @@ -15670,13 +15759,13 @@ var ts; } } function isParameterDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 153) { node = node.parent.parent; } - return node.kind === 129; + return node.kind === 130; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 129) { + if (getRootDeclaration(node).kind !== 130) { return; } var func = ts.getContainingFunction(node); @@ -15685,7 +15774,7 @@ var ts; if (n.kind === 65) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 129) { + if (referencedSymbol.valueDeclaration.kind === 130) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -15706,7 +15795,7 @@ var ts; checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 127) { + if (node.name.kind === 128) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -15715,7 +15804,7 @@ var ts; if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 130 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -15743,9 +15832,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 133 && node.kind !== 132) { checkExportsOnMergedDeclarations(node); - if (node.kind === 198 || node.kind === 152) { + if (node.kind === 199 || node.kind === 153) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -15774,7 +15863,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 179 || node.kind === 154) { + if (node.kind === 180 || node.kind === 155) { return true; } node = node.parent; @@ -15802,12 +15891,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 199) { + if (node.initializer && node.initializer.kind == 200) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -15816,19 +15905,19 @@ var ts; } if (node.condition) checkExpression(node.condition); - if (node.iterator) - checkExpression(node.iterator); + if (node.incrementor) + checkExpression(node.incrementor); checkSourceElement(node.statement); } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 153 || varExpr.kind === 154) { + if (varExpr.kind === 154 || varExpr.kind === 155) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -15843,7 +15932,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { 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); @@ -15853,7 +15942,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 153 || varExpr.kind === 154) { + if (varExpr.kind === 154 || varExpr.kind === 155) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { @@ -16014,7 +16103,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); + return !!(node.kind === 137 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 138))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -16028,11 +16117,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 137) { + if (func.kind === 138) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 135) { + if (func.kind === 136) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -16059,7 +16148,7 @@ var ts; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 221 && !hasDuplicateDefaultClause) { + if (clause.kind === 222 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -16071,7 +16160,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 220) { + if (produceDiagnostics && clause.kind === 221) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -16088,7 +16177,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 194 && current.label.text === node.label.text) { + if (current.kind === 195 && 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; @@ -16152,7 +16241,7 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { + if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 202) { var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; @@ -16183,7 +16272,7 @@ var ts; return; } var errorNode; - if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 128 || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -16234,7 +16323,7 @@ var ts; } function checkClassDeclaration(node) { checkGrammarDeclarationNameInStrictMode(node); - if (node.parent.kind !== 206 && node.parent.kind !== 227) { + if (node.parent.kind !== 207 && node.parent.kind !== 228) { grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); } if (!node.name && !(node.flags & 256)) { @@ -16254,11 +16343,11 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - if (!ts.isSupportedHeritageClauseElement(baseTypeNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(baseTypeNode)) { error(baseTypeNode.expression, ts.Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); } emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkHeritageClauseElement(baseTypeNode); + checkExpressionWithTypeArguments(baseTypeNode); } var baseTypes = getBaseTypes(type); if (baseTypes.length) { @@ -16279,12 +16368,12 @@ var ts; var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(typeRefNode)) { error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(typeRefNode); + checkExpressionWithTypeArguments(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromHeritageClauseElement(typeRefNode); + var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096) ? t.target : t; if (declaredType.flags & (1024 | 2048)) { @@ -16364,7 +16453,7 @@ var ts; } } function isAccessor(kind) { - return kind === 136 || kind === 137; + return kind === 137 || kind === 138; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -16397,7 +16486,7 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; for (var _i = 0; _i < baseTypes.length; _i++) { var base = baseTypes[_i]; @@ -16430,7 +16519,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 203); 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); @@ -16447,10 +16536,10 @@ var ts; } } ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { - if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) { error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(heritageElement); + checkExpressionWithTypeArguments(heritageElement); }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { @@ -16471,7 +16560,7 @@ var ts; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 127 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 128 && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; @@ -16507,7 +16596,7 @@ var ts; return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 167: + case 168: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -16518,7 +16607,7 @@ var ts; case 47: return ~value; } return undefined; - case 169: + case 170: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -16543,11 +16632,11 @@ var ts; return undefined; case 7: return +e.text; - case 161: + case 162: return evalConstant(e.expression); case 65: + case 157: case 156: - case 155: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType; @@ -16558,7 +16647,7 @@ var ts; } else { var expression; - if (e.kind === 156) { + if (e.kind === 157) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; @@ -16575,7 +16664,7 @@ var ts; if (current.kind === 65) { break; } - else if (current.kind === 155) { + else if (current.kind === 156) { current = current.expression; } else { @@ -16632,7 +16721,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 204) { + if (declaration.kind !== 205) { return false; } var enumDeclaration = declaration; @@ -16655,8 +16744,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 || - (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 202 || + (declaration.kind === 201 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -16694,13 +16783,13 @@ var ts; var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + 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, 201); + var mergedClass = ts.getDeclarationOfKind(symbol, 202); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048; @@ -16708,10 +16797,10 @@ var ts; } if (node.name.kind === 8) { if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); } if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); } } } @@ -16719,10 +16808,10 @@ var ts; } function getFirstIdentifier(node) { while (true) { - if (node.kind === 126) { + if (node.kind === 127) { node = node.left; } - else if (node.kind === 155) { + else if (node.kind === 156) { node = node.expression; } else { @@ -16738,15 +16827,15 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { - error(moduleName, node.kind === 215 ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + var inAmbientExternalModule = node.parent.kind === 207 && node.parent.parent.name.kind === 8; + if (node.parent.kind !== 228 && !inAmbientExternalModule) { + error(moduleName, node.kind === 216 ? + 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 && isExternalModuleNameRelative(moduleName.text)) { - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); return false; } return true; @@ -16759,7 +16848,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 217 ? + var message = node.kind === 218 ? 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)); @@ -16782,7 +16871,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { + if (importClause.namedBindings.kind === 212) { checkImportBinding(importClause.namedBindings); } else { @@ -16827,15 +16916,15 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { - error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); + var inAmbientExternalModule = node.parent.kind === 207 && node.parent.parent.name.kind === 8; + if (node.parent.kind !== 228 && !inAmbientExternalModule) { + error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { - error(node.moduleSpecifier, ts.Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); + error(node.moduleSpecifier, ts.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); } } } @@ -16847,9 +16936,9 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 227 ? node.parent : node.parent.parent; - if (container.kind === 205 && container.name.kind === 65) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + var container = node.parent.kind === 228 ? node.parent : node.parent.parent; + if (container.kind === 206 && container.name.kind === 65) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { @@ -16862,15 +16951,20 @@ var ts; checkExpressionCached(node.expression); } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= 2) { - grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + if (node.isExportEquals && !ts.isInAmbientContext(node)) { + if (languageVersion >= 2) { + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + } + else if (compilerOptions.module === 4) { + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } } } function getModuleStatements(node) { - if (node.kind === 227) { + if (node.kind === 228) { return node.statements; } - if (node.kind === 205 && node.body.kind === 206) { + if (node.kind === 206 && node.body.kind === 207) { return node.body.statements; } return emptyArray; @@ -16899,163 +16993,162 @@ var ts; if (!node) return; switch (node.kind) { - case 128: - return checkTypeParameter(node); case 129: + return checkTypeParameter(node); + case 130: return checkParameter(node); + case 133: case 132: - case 131: return checkPropertyDeclaration(node); - case 142: case 143: - case 138: + case 144: case 139: - return checkSignatureDeclaration(node); case 140: return checkSignatureDeclaration(node); - case 134: - case 133: - return checkMethodDeclaration(node); - case 135: - return checkConstructorDeclaration(node); - case 136: - case 137: - return checkAccessorDeclaration(node); case 141: + return checkSignatureDeclaration(node); + case 135: + case 134: + return checkMethodDeclaration(node); + case 136: + return checkConstructorDeclaration(node); + case 137: + case 138: + return checkAccessorDeclaration(node); + case 142: return checkTypeReferenceNode(node); - case 144: - return checkTypeQuery(node); case 145: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 146: - return checkArrayType(node); + return checkTypeLiteral(node); case 147: - return checkTupleType(node); + return checkArrayType(node); case 148: - return checkUnionType(node); + return checkTupleType(node); case 149: + return checkUnionType(node); + case 150: return checkSourceElement(node.type); - case 200: - return checkFunctionDeclaration(node); - case 179: - case 206: - return checkBlock(node); - case 180: - return checkVariableStatement(node); - case 182: - return checkExpressionStatement(node); - case 183: - return checkIfStatement(node); - case 184: - return checkDoStatement(node); - case 185: - return checkWhileStatement(node); - case 186: - return checkForStatement(node); - case 187: - return checkForInStatement(node); - case 188: - return checkForOfStatement(node); - case 189: - case 190: - return checkBreakOrContinueStatement(node); - case 191: - return checkReturnStatement(node); - case 192: - return checkWithStatement(node); - case 193: - return checkSwitchStatement(node); - case 194: - return checkLabeledStatement(node); - case 195: - return checkThrowStatement(node); - case 196: - return checkTryStatement(node); - case 198: - return checkVariableDeclaration(node); - case 152: - return checkBindingElement(node); case 201: - return checkClassDeclaration(node); - case 202: - return checkInterfaceDeclaration(node); - case 203: - return checkTypeAliasDeclaration(node); - case 204: - return checkEnumDeclaration(node); - case 205: - return checkModuleDeclaration(node); - case 209: - return checkImportDeclaration(node); - case 208: - return checkImportEqualsDeclaration(node); - case 215: - return checkExportDeclaration(node); - case 214: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); + case 180: + case 207: + return checkBlock(node); case 181: - checkGrammarStatementInAmbientContext(node); - return; + return checkVariableStatement(node); + case 183: + return checkExpressionStatement(node); + case 184: + return checkIfStatement(node); + case 185: + return checkDoStatement(node); + case 186: + return checkWhileStatement(node); + case 187: + return checkForStatement(node); + case 188: + return checkForInStatement(node); + case 189: + return checkForOfStatement(node); + case 190: + case 191: + return checkBreakOrContinueStatement(node); + case 192: + return checkReturnStatement(node); + case 193: + return checkWithStatement(node); + case 194: + return checkSwitchStatement(node); + case 195: + return checkLabeledStatement(node); + case 196: + return checkThrowStatement(node); case 197: + return checkTryStatement(node); + case 199: + return checkVariableDeclaration(node); + case 153: + return checkBindingElement(node); + case 202: + return checkClassDeclaration(node); + case 203: + return checkInterfaceDeclaration(node); + case 204: + return checkTypeAliasDeclaration(node); + case 205: + return checkEnumDeclaration(node); + case 206: + return checkModuleDeclaration(node); + case 210: + return checkImportDeclaration(node); + case 209: + return checkImportEqualsDeclaration(node); + case 216: + return checkExportDeclaration(node); + case 215: + return checkExportAssignment(node); + case 182: checkGrammarStatementInAmbientContext(node); return; - case 218: + case 198: + checkGrammarStatementInAmbientContext(node); + return; + case 219: return checkMissingDeclaration(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 162: case 163: + case 164: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; + case 135: case 134: - case 133: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 135: case 136: case 137: - case 200: + case 138: + case 201: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 192: + case 193: checkFunctionExpressionBodies(node.expression); break; - case 129: + case 130: + case 133: case 132: - case 131: - case 150: case 151: case 152: case 153: case 154: - case 224: case 155: + case 225: case 156: case 157: case 158: case 159: - case 171: - case 176: case 160: + case 172: + case 178: case 161: - case 165: + case 162: case 166: - case 164: case 167: + case 165: case 168: case 169: case 170: - case 173: - case 179: - case 206: + case 171: + case 174: case 180: - case 182: + case 207: + case 181: case 183: case 184: case 185: @@ -17065,21 +17158,22 @@ var ts; case 189: case 190: case 191: - case 193: - case 207: - case 220: - case 221: + case 192: case 194: + case 208: + case 221: + case 222: case 195: case 196: - case 223: - case 198: + case 197: + case 224: case 199: - case 201: - case 204: - case 226: - case 214: + case 200: + case 202: + case 205: case 227: + case 215: + case 228: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -17139,7 +17233,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 192 && node.parent.statement === node) { + if (node.parent.kind === 193 && node.parent.statement === node) { return true; } node = node.parent; @@ -17161,23 +17255,23 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 228: if (!ts.isExternalModule(location)) { break; } - case 205: + case 206: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 204: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 201: case 202: + case 203: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 162: + case 163: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17213,22 +17307,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 228: if (!ts.isExternalModule(location)) break; - case 205: + case 206: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 204: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 201: case 202: + case 203: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 162: + case 163: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17247,104 +17341,104 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 128: - case 201: + case 129: case 202: case 203: case 204: + case 205: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 126) { + while (node.parent && node.parent.kind === 127) { node = node.parent; } - return node.parent && node.parent.kind === 141; + return node.parent && node.parent.kind === 142; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 155) { + while (node.parent && node.parent.kind === 156) { node = node.parent; } return node.parent && node.parent.kind === 177; } function isTypeNode(node) { - if (141 <= node.kind && node.kind <= 149) { + if (142 <= node.kind && node.kind <= 150) { return true; } switch (node.kind) { case 112: - case 119: - case 121: - case 113: + case 120: case 122: + case 113: + case 123: return true; case 99: - return node.parent.kind !== 166; + return node.parent.kind !== 167; case 8: - return node.parent.kind === 129; + return node.parent.kind === 130; case 177: return true; case 65: - if (node.parent.kind === 126 && node.parent.right === node) { + if (node.parent.kind === 127 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 155 && node.parent.name === node) { + else if (node.parent.kind === 156 && node.parent.name === node) { node = node.parent; } - case 126: - case 155: - ts.Debug.assert(node.kind === 65 || node.kind === 126 || node.kind === 155, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + case 127: + case 156: + ts.Debug.assert(node.kind === 65 || node.kind === 127 || node.kind === 156, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); var parent_5 = node.parent; - if (parent_5.kind === 144) { + if (parent_5.kind === 145) { return false; } - if (141 <= parent_5.kind && parent_5.kind <= 149) { + if (142 <= parent_5.kind && parent_5.kind <= 150) { return true; } switch (parent_5.kind) { case 177: return true; - case 128: - return node === parent_5.constraint; - case 132: - case 131: case 129: - case 198: + return node === parent_5.constraint; + case 133: + case 132: + case 130: + case 199: return node === parent_5.type; - case 200: - case 162: + case 201: case 163: + case 164: + case 136: case 135: case 134: - case 133: - case 136: case 137: - return node === parent_5.type; case 138: + return node === parent_5.type; case 139: case 140: + case 141: return node === parent_5.type; - case 160: + case 161: return node === parent_5.type; - case 157: case 158: - return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; case 159: + return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; + case 160: return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 126) { + while (nodeOnRightSide.parent.kind === 127) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 209) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 214) { + if (nodeOnRightSide.parent.kind === 215) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -17356,10 +17450,10 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 214) { + if (entityName.parent.kind === 215) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 155) { + if (entityName.kind !== 156) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } @@ -17380,14 +17474,14 @@ var ts; var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 155) { + else if (entityName.kind === 156) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 126) { + else if (entityName.kind === 127) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -17396,7 +17490,7 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 141 ? 793056 : 1536; + var meaning = entityName.parent.kind === 142 ? 793056 : 1536; meaning |= 8388608; return resolveEntityName(entityName, meaning); } @@ -17410,14 +17504,14 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 214 + return node.parent.kind === 215 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 65: - case 155: - case 126: + case 156: + case 127: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 93: case 91: @@ -17425,7 +17519,7 @@ var ts; return type.symbol; case 114: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 135) { + if (constructorDeclaration && constructorDeclaration.kind === 136) { return constructorDeclaration.parent.symbol; } return undefined; @@ -17433,12 +17527,12 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 209 || node.parent.kind === 215) && + ((node.parent.kind === 210 || node.parent.kind === 216) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: - if (node.parent.kind == 156 && node.parent.argumentExpression === node) { + if (node.parent.kind == 157 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -17452,7 +17546,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 225) { + if (location && location.kind === 226) { return resolveEntityName(location.name, 107455); } return undefined; @@ -17526,7 +17620,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 228; } function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { if (languageVersion >= 2) { @@ -17534,7 +17628,7 @@ var ts; } var node = getDeclarationOfAliasSymbol(symbol); if (node) { - if (node.kind === 210) { + if (node.kind === 211) { var defaultKeyword; if (languageVersion === 0) { defaultKeyword = "[\"default\"]"; @@ -17544,7 +17638,7 @@ var ts; } return getGeneratedNameForNode(node.parent) + defaultKeyword; } - if (node.kind === 213) { + if (node.kind === 214) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); var propertyName = node.propertyName || node.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -17553,7 +17647,7 @@ var ts; } function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { - if (languageVersion >= 2) { + if (languageVersion >= 2 || compilerOptions.module === 4) { return undefined; } return "exports." + ts.unescapeIdentifier(symbol.name); @@ -17561,7 +17655,7 @@ var ts; var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 206 || node.kind === 205) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; @@ -17584,22 +17678,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 208: - case 210: + case 209: case 211: - case 213: - case 217: + case 212: + case 214: + case 218: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 215: + case 216: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 214: + case 215: return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 228 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -17644,7 +17738,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 226) { + if (node.kind === 227) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -17675,7 +17769,7 @@ var ts; } } function serializeTypeReferenceNode(node, getGeneratedNameForNode) { - var type = getTypeFromTypeReference(node); + var type = getTypeFromTypeNode(node); if (type.flags & 16) { return "void 0"; } @@ -17712,26 +17806,26 @@ var ts; switch (node.kind) { case 99: return "void 0"; - case 149: + case 150: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 142: case 143: + case 144: return "Function"; - case 146: case 147: + case 148: return "Array"; case 113: return "Boolean"; - case 121: + case 122: case 8: return "String"; - case 119: + case 120: return "Number"; - case 141: + case 142: return serializeTypeReferenceNode(node, getGeneratedNameForNode); - case 144: case 145: - case 148: + case 146: + case 149: case 112: break; default: @@ -17743,11 +17837,11 @@ var ts; } function serializeTypeOfNode(node, getGeneratedNameForNode) { switch (node.kind) { - case 201: return "Function"; - case 132: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 129: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 136: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 137: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + case 202: return "Function"; + case 133: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 130: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 138: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); } if (ts.isFunctionLike(node)) { return "Function"; @@ -17757,7 +17851,7 @@ var ts; function serializeParameterTypesOfNode(node, getGeneratedNameForNode) { if (node) { var valueDeclaration; - if (node.kind === 201) { + if (node.kind === 202) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -17772,10 +17866,10 @@ var ts; for (var i = 0; i < parameterCount; i++) { if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 146) { + if (parameterType.kind === 147) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 141 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 142 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -17821,15 +17915,21 @@ var ts; ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); return !!resolveName(location, name, 107455, undefined, undefined); } + function getReferencedValueDeclaration(reference) { + ts.Debug.assert(!ts.nodeIsSynthesized(reference)); + var symbol = getNodeLinks(reference).resolvedSymbol || + resolveName(reference, reference.text, 107455 | 8388608, undefined, undefined); + return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && n.parent.name === n); + var isVariableDeclarationOrBindingElement = n.parent.kind === 153 || (n.parent.kind === 199 && n.parent.name === n); var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 107455 | 8388608, undefined, undefined); var isLetOrConst = symbol && (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 223; + symbol.valueDeclaration.parent.kind !== 224; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -17866,6 +17966,7 @@ var ts; resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId, + getReferencedValueDeclaration: getReferencedValueDeclaration, serializeTypeOfNode: serializeTypeOfNode, serializeParameterTypesOfNode: serializeParameterTypesOfNode, serializeReturnTypeOfNode: serializeReturnTypeOfNode @@ -17914,7 +18015,7 @@ var ts; (102 <= node.originalKeywordKind && node.originalKeywordKind <= 110); } function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { - if (ts.getAncestor(identifier, 201) || ts.getAncestor(identifier, 174)) { + if (ts.getAncestor(identifier, 202) || ts.getAncestor(identifier, 175)) { return grammarErrorOnNode(identifier, message, arg0); } return false; @@ -17924,14 +18025,14 @@ var ts; var impotClause = node.importClause; if (impotClause.namedBindings) { var nameBindings = impotClause.namedBindings; - if (nameBindings.kind === 211) { + if (nameBindings.kind === 212) { var name_11 = nameBindings.name; if (isReservedWordInStrictMode(name_11)) { var nameText = ts.declarationNameToString(name_11); return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } } - else if (nameBindings.kind === 212) { + else if (nameBindings.kind === 213) { var reportError = false; for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -17952,20 +18053,20 @@ var ts; if (name && name.kind === 65 && isReservedWordInStrictMode(name)) { var nameText = ts.declarationNameToString(name); switch (node.kind) { + case 130: + case 199: + case 201: case 129: - case 198: - case 200: - case 128: - case 152: - case 202: + case 153: case 203: case 204: - return checkGrammarIdentifierInStrictMode(name); - case 201: - return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); case 205: + return checkGrammarIdentifierInStrictMode(name); + case 202: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + case 206: return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - case 208: + case 209: return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } } @@ -17975,17 +18076,17 @@ var ts; if (typeName.kind === 65) { checkGrammarTypeNameInStrictMode(typeName); } - else if (typeName.kind === 126) { + else if (typeName.kind === 127) { checkGrammarTypeNameInStrictMode(typeName.right); checkGrammarTypeReferenceInStrictMode(typeName.left); } } - function checkGrammarHeritageClauseElementInStrictMode(expression) { + function checkGrammarExpressionWithTypeArgumentsInStrictMode(expression) { if (expression && expression.kind === 65) { return checkGrammarIdentifierInStrictMode(expression); } - else if (expression && expression.kind === 155) { - checkGrammarHeritageClauseElementInStrictMode(expression.expression); + else if (expression && expression.kind === 156) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(expression.expression); } } function checkGrammarIdentifierInStrictMode(node, nameText) { @@ -18018,7 +18119,7 @@ var ts; else if (languageVersion < 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } - else if (node.kind === 136 || node.kind === 137) { + else if (node.kind === 137 || node.kind === 138) { 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); @@ -18028,26 +18129,26 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 136: case 137: - case 135: - case 132: - case 131: - case 134: + case 138: + case 136: case 133: - case 140: - case 201: + case 132: + case 135: + case 134: + case 141: case 202: - case 205: - case 204: - case 180: - case 200: case 203: + case 206: + case 205: + case 181: + case 201: + case 204: + case 210: case 209: - case 208: + case 216: case 215: - case 214: - case 129: + case 130: break; default: return false; @@ -18081,7 +18182,7 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 207 || node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -18090,10 +18191,10 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 207 || node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 129) { + else if (node.kind === 130) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128; @@ -18106,10 +18207,10 @@ var ts; else if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 202) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 129) { + else if (node.kind === 130) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; @@ -18118,13 +18219,13 @@ var ts; if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 202) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 129) { + else if (node.kind === 130) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 207) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -18132,7 +18233,7 @@ var ts; break; } } - if (node.kind === 135) { + if (node.kind === 136) { if (flags & 128) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -18143,13 +18244,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 209 || node.kind === 208) && flags & 2) { + else if ((node.kind === 210 || node.kind === 209) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 202 && flags & 2) { + else if (node.kind === 203 && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 130 && (flags & 112) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -18212,7 +18313,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 163) { + if (node.kind === 164) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -18247,7 +18348,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { + if (parameter.type.kind !== 122 && parameter.type.kind !== 120) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -18279,7 +18380,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 175) { + if (arg.kind === 176) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -18350,11 +18451,11 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 127) { + if (node.kind !== 128) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 170 && computedPropertyName.expression.operatorToken.kind === 23) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -18381,26 +18482,26 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; var name_13 = prop.name; - if (prop.kind === 175 || - name_13.kind === 127) { + if (prop.kind === 176 || + name_13.kind === 128) { checkGrammarComputedPropertyName(name_13); continue; } var currentKind = void 0; - if (prop.kind === 224 || prop.kind === 225) { + if (prop.kind === 225 || prop.kind === 226) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_13.kind === 7) { checkGrammarNumericLiteral(name_13); } currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 135) { currentKind = Property; } - else if (prop.kind === 136) { + else if (prop.kind === 137) { currentKind = GetAccessor; } - else if (prop.kind === 137) { + else if (prop.kind === 138) { currentKind = SetAccesor; } else { @@ -18434,24 +18535,24 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 199) { + if (forInOrOfStatement.initializer.kind === 200) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 188 ? 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 188 ? 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 === 187 + var diagnostic = forInOrOfStatement.kind === 188 ? 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); @@ -18474,10 +18575,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 136 && accessor.parameters.length) { + else if (kind === 137 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 137) { + else if (kind === 138) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -18502,7 +18603,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 128 && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -18512,7 +18613,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 154) { + if (node.parent.kind === 155) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -18520,7 +18621,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 201) { + if (node.parent.kind === 202) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -18531,22 +18632,22 @@ 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 === 202) { + else if (node.parent.kind === 203) { 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 === 145) { + else if (node.parent.kind === 146) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 186: case 187: case 188: - case 184: + case 189: case 185: + case 186: return true; - case 194: + case 195: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -18558,9 +18659,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 194: + case 195: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 189 + var isMisplacedContinueLabel = node.kind === 190 && !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); @@ -18568,8 +18669,8 @@ var ts; return false; } break; - case 193: - if (node.kind === 190 && !node.label) { + case 194: + if (node.kind === 191 && !node.label) { return false; } break; @@ -18582,13 +18683,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 190 + var message = node.kind === 191 ? 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 === 190 + var message = node.kind === 191 ? 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); @@ -18597,10 +18698,10 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== elements[elements.length - 1]) { + 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 === 151 || node.name.kind === 150) { + if (node.name.kind === 152 || node.name.kind === 151) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -18610,7 +18711,7 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { + if (node.parent.parent.kind !== 188 && node.parent.parent.kind !== 189) { if (ts.isInAmbientContext(node)) { if (node.initializer) { var equalsTokenLength = "=".length; @@ -18640,7 +18741,7 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - if (element.kind !== 175) { + if (element.kind !== 176) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -18657,15 +18758,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 183: case 184: case 185: - case 192: case 186: + case 193: case 187: case 188: + case 189: return false; - case 194: + case 195: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -18681,7 +18782,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 167) { + if (expression.kind === 168) { var unaryExpression = expression; if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { expression = unaryExpression.operand; @@ -18700,7 +18801,7 @@ var ts; var inAmbientContext = ts.isInAmbientContext(enumDecl); for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 127) { + if (node.name.kind === 128) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -18770,18 +18871,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 201) { + if (node.parent.kind === 202) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 202) { + else if (node.parent.kind === 203) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 145) { + else if (node.parent.kind === 146) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -18791,11 +18892,11 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 202 || + if (node.kind === 203 || + node.kind === 210 || node.kind === 209 || - node.kind === 208 || + node.kind === 216 || node.kind === 215 || - node.kind === 214 || (node.flags & 2) || (node.flags & (1 | 256))) { return false; @@ -18805,7 +18906,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 === 180) { + if (ts.isDeclaration(decl) || decl.kind === 181) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -18824,7 +18925,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 === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + if (node.parent.kind === 180 || node.parent.kind === 207 || node.parent.kind === 228) { 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); @@ -18867,10 +18968,6 @@ var ts; return diagnostics; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -18898,7 +18995,7 @@ var ts; ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } @@ -18909,7 +19006,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 209); + ts.Debug.assert(aliasEmitInfo.node.kind === 210); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0); writeImportDeclaration(aliasEmitInfo.node); @@ -18922,11 +19019,11 @@ var ts; else { var emittedReferencedFiles = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && + if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); @@ -18982,10 +19079,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 198) { + if (declaration.kind === 199) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + else if (declaration.kind === 213 || declaration.kind === 214 || declaration.kind === 211) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -18996,7 +19093,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 209) { + if (moduleElementEmitInfo.node.kind === 210) { moduleElementEmitInfo.isVisible = true; } else { @@ -19004,12 +19101,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 206) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 206) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -19097,39 +19194,39 @@ var ts; function emitType(type) { switch (type.kind) { case 112: - case 121: - case 119: - case 113: case 122: + case 120: + case 113: + case 123: case 99: case 8: return writeTextOfNode(currentSourceFile, type); case 177: - return emitHeritageClauseElement(type); - case 141: - return emitTypeReference(type); - case 144: - return emitTypeQuery(type); - case 146: - return emitArrayType(type); - case 147: - return emitTupleType(type); - case 148: - return emitUnionType(type); - case 149: - return emitParenType(type); + return emitExpressionWithTypeArguments(type); case 142: - case 143: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 145: + return emitTypeQuery(type); + case 147: + return emitArrayType(type); + case 148: + return emitTupleType(type); + case 149: + return emitUnionType(type); + case 150: + return emitParenType(type); + case 143: + case 144: + return emitSignatureDeclarationWithJsDocComments(type); + case 146: return emitTypeLiteral(type); case 65: return emitEntityName(type); - case 126: + case 127: return emitEntityName(type); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 209 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -19137,17 +19234,17 @@ var ts; writeTextOfNode(currentSourceFile, entityName); } else { - var left = entityName.kind === 126 ? entityName.left : entityName.expression; - var right = entityName.kind === 126 ? entityName.right : entityName.name; + var left = entityName.kind === 127 ? entityName.left : entityName.expression; + var right = entityName.kind === 127 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentSourceFile, right); } } } - function emitHeritageClauseElement(node) { - if (ts.isSupportedHeritageClauseElement(node)) { - ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + function emitExpressionWithTypeArguments(node) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { + ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 156); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -19251,10 +19348,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 208 || - (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + else if (node.kind === 209 || + (node.parent.kind === 228 && ts.isExternalModule(currentSourceFile))) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 228) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -19263,7 +19360,7 @@ var ts; }); } else { - if (node.kind === 209) { + if (node.kind === 210) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -19281,23 +19378,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 200: - return writeFunctionDeclaration(node); - case 180: - return writeVariableStatement(node); - case 202: - return writeInterfaceDeclaration(node); case 201: - return writeClassDeclaration(node); + return writeFunctionDeclaration(node); + case 181: + return writeVariableStatement(node); case 203: - return writeTypeAliasDeclaration(node); + return writeInterfaceDeclaration(node); + case 202: + return writeClassDeclaration(node); case 204: - return writeEnumDeclaration(node); + return writeTypeAliasDeclaration(node); case 205: + return writeEnumDeclaration(node); + case 206: return writeModuleDeclaration(node); - case 208: - return writeImportEqualsDeclaration(node); case 209: + return writeImportEqualsDeclaration(node); + case 210: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -19311,7 +19408,7 @@ var ts; if (node.flags & 256) { write("default "); } - else if (node.kind !== 202) { + else if (node.kind !== 203) { write("declare "); } } @@ -19355,7 +19452,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 211) { + if (namedBindings.kind === 212) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -19381,7 +19478,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 212) { write("* as "); writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); } @@ -19432,7 +19529,7 @@ var ts; emitModuleElementDeclarationFlags(node); write("module "); writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 206) { + while (node.body.kind !== 207) { node = node.body; write("."); writeTextOfNode(currentSourceFile, node.name); @@ -19493,7 +19590,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 134 && (node.parent.flags & 32); + return node.parent.kind === 135 && (node.parent.flags & 32); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -19503,15 +19600,15 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 142 || - node.parent.kind === 143 || - (node.parent.parent && node.parent.parent.kind === 145)) { - ts.Debug.assert(node.parent.kind === 134 || - node.parent.kind === 133 || - node.parent.kind === 142 || + if (node.parent.kind === 143 || + node.parent.kind === 144 || + (node.parent.parent && node.parent.parent.kind === 146)) { + ts.Debug.assert(node.parent.kind === 135 || + node.parent.kind === 134 || node.parent.kind === 143 || - node.parent.kind === 138 || - node.parent.kind === 139); + node.parent.kind === 144 || + node.parent.kind === 139 || + node.parent.kind === 140); emitType(node.constraint); } else { @@ -19521,31 +19618,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 201: + case 202: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 202: + case 203: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 139: + case 140: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 138: + case 139: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 135: case 134: - case 133: if (node.parent.flags & 128) { 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 === 201) { + else if (node.parent.parent.kind === 202) { 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 200: + case 201: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -19570,12 +19667,12 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - if (ts.isSupportedHeritageClauseElement(node)) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 201) { + if (node.parent.parent.kind === 202) { 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; @@ -19652,16 +19749,16 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 199 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + if ((node.kind === 133 || node.kind === 132) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + if ((node.kind === 133 || node.kind === 132) && node.parent.kind === 146) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 32)) { @@ -19670,14 +19767,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 198) { + if (node.kind === 199) { 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 === 132 || node.kind === 131) { + else if (node.kind === 133 || node.kind === 132) { if (node.flags & 128) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -19685,7 +19782,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 === 201) { + else if (node.parent.kind === 202) { 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 : @@ -19711,7 +19808,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 175) { + if (element.kind !== 176) { elements.push(element); } } @@ -19777,7 +19874,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 137 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -19790,7 +19887,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 136 + return accessor.kind === 137 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -19799,7 +19896,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 137) { + if (accessorWithTypeAnnotation.kind === 138) { if (accessorWithTypeAnnotation.parent.flags & 128) { 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 : @@ -19845,17 +19942,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 200) { + if (node.kind === 201) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 134) { + else if (node.kind === 135) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 200) { + if (node.kind === 201) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 135) { + else if (node.kind === 136) { write("constructor"); } else { @@ -19872,11 +19969,11 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 139 || node.kind === 143) { + if (node.kind === 140 || node.kind === 144) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 140) { + if (node.kind === 141) { write("["); } else { @@ -19885,20 +19982,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 140) { + if (node.kind === 141) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; - if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { + var isFunctionTypeOrConstructorType = node.kind === 143 || node.kind === 144; + if (isFunctionTypeOrConstructorType || node.parent.kind === 146) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 135 && !(node.flags & 32)) { + else if (node.kind !== 136 && !(node.flags & 32)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -19909,23 +20006,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 139: + case 140: 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 138: + case 139: 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 140: + case 141: 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 135: case 134: - case 133: if (node.flags & 128) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -19933,7 +20030,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 === 201) { + else if (node.parent.kind === 202) { 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 : @@ -19946,7 +20043,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 200: + case 201: 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 : @@ -19978,9 +20075,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 142 || - node.parent.kind === 143 || - node.parent.parent.kind === 145) { + if (node.parent.kind === 143 || + node.parent.kind === 144 || + node.parent.parent.kind === 146) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { @@ -19996,22 +20093,22 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 135: + case 136: 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 139: + case 140: 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 138: + case 139: 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 135: case 134: - case 133: if (node.parent.flags & 128) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -20019,7 +20116,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 === 201) { + else if (node.parent.parent.kind === 202) { 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 : @@ -20031,7 +20128,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 200: + case 201: 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 : @@ -20042,12 +20139,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 150) { + if (bindingPattern.kind === 151) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 151) { + else if (bindingPattern.kind === 152) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -20066,10 +20163,10 @@ var ts; typeName: bindingElement.name } : undefined; } - if (bindingElement.kind === 175) { + if (bindingElement.kind === 176) { write(" "); } - else if (bindingElement.kind === 152) { + else if (bindingElement.kind === 153) { if (bindingElement.propertyName) { writeTextOfNode(currentSourceFile, bindingElement.propertyName); write(": "); @@ -20092,39 +20189,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 200: - case 205: - case 208: - case 202: case 201: - case 203: - case 204: - return emitModuleElement(node, isModuleElementVisible(node)); - case 180: - return emitModuleElement(node, isVariableStatementVisible(node)); + case 206: case 209: + case 203: + case 202: + case 204: + case 205: + return emitModuleElement(node, isModuleElementVisible(node)); + case 181: + return emitModuleElement(node, isVariableStatementVisible(node)); + case 210: return emitModuleElement(node, !node.importClause); - case 215: + case 216: return emitExportDeclaration(node); + case 136: case 135: case 134: - case 133: return writeFunctionDeclaration(node); - case 139: - case 138: case 140: + case 139: + case 141: return emitSignatureDeclarationWithJsDocComments(node); - case 136: case 137: + case 138: return emitAccessorDeclaration(node); + case 133: case 132: - case 131: return emitPropertyDeclaration(node); - case 226: - return emitEnumMemberDeclaration(node); - case 214: - return emitExportAssignment(node); case 227: + return emitEnumMemberDeclaration(node); + case 215: + return emitExportAssignment(node); + case 228: return emitSourceFile(node); } } @@ -20165,14 +20262,18 @@ var ts; /// var ts; (function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { - var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; - var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; - var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; - var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; + var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\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 compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; - var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var diagnostics = []; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { @@ -20227,6 +20328,7 @@ var ts; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; var currentSourceFile; + var exportFunctionForFile; var generatedNameSet = {}; var nodeToGeneratedName = []; var blockScopedVariableToGeneratedName; @@ -20244,14 +20346,14 @@ var ts; var writeEmittedFiles = writeJavaScriptFile; var detachedCommentsInfo; var writeComment = ts.writeCommentRange; - var emitSourceFileStart = function (node) { }; + var emit = emitNodeWithoutSourceMap; var emitStart = function (node) { }; var emitEnd = function (node) { }; var emitToken = emitTokenText; var scopeEmitStart = function (scopeDeclaration, scopeName) { }; var scopeEmitEnd = function () { }; var sourceMapData; - if (compilerOptions.sourceMap) { + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { initializeEmitterWithSourceMaps(); } if (root) { @@ -20259,7 +20361,7 @@ var ts; } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { emitSourceFile(sourceFile); } }); @@ -20269,6 +20371,7 @@ var ts; return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + exportFunctionForFile = undefined; emit(sourceFile); } function isUniqueName(name) { @@ -20345,25 +20448,25 @@ var ts; } function generateNameForNode(node) { switch (node.kind) { - case 200: case 201: - case 174: + case 202: + case 175: generateNameForFunctionOrClassDeclaration(node); break; - case 205: + case 206: generateNameForModuleOrEnum(node); generateNameForNode(node.body); break; - case 204: + case 205: generateNameForModuleOrEnum(node); break; - case 209: + case 210: generateNameForImportDeclaration(node); break; - case 215: + case 216: generateNameForExportDeclaration(node); break; - case 214: + case 215: generateNameForExportAssignment(node); break; } @@ -20381,7 +20484,7 @@ var ts; var sourceMapNameIndexMap = {}; var sourceMapNameIndices = []; function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; } var lastRecordedSourceMapSpan; var lastEncodedSourceMapSpan = { @@ -20489,6 +20592,12 @@ var ts; sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; sourceMapData.inputSourceFileNames.push(node.fileName); + if (compilerOptions.inlineSources) { + if (!sourceMapData.sourceMapSourcesContent) { + sourceMapData.sourceMapSourcesContent = []; + } + sourceMapData.sourceMapSourcesContent.push(node.text); + } } function recordScopeNameOfNode(node, scopeName) { function recordScopeNameIndex(scopeNameIndex) { @@ -20500,7 +20609,7 @@ var ts; var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { var name_17 = node.name; - if (!name_17 || name_17.kind !== 127) { + if (!name_17 || name_17.kind !== 128) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -20517,18 +20626,18 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 200 || - node.kind === 162 || + else if (node.kind === 201 || + node.kind === 163 || + node.kind === 135 || node.kind === 134 || - node.kind === 133 || - node.kind === 136 || node.kind === 137 || - node.kind === 205 || - node.kind === 201 || - node.kind === 204) { + node.kind === 138 || + node.kind === 206 || + node.kind === 202 || + node.kind === 205) { if (node.name) { var name_18 = node.name; - scopeName = name_18.kind === 127 + scopeName = name_18.kind === 128 ? ts.getTextOfNode(name_18) : node.name.text; } @@ -20547,18 +20656,22 @@ var ts; ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { + function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { if (typeof JSON !== "undefined") { - return JSON.stringify({ + var map_1 = { version: version, file: file, sourceRoot: sourceRoot, sources: sources, names: names, mappings: mappings - }); + }; + if (sourcesContent !== undefined) { + map_1.sourcesContent = sourcesContent; + } + return JSON.stringify(map_1); } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; + return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; function serializeStringArray(list) { var output = ""; for (var i = 0, n = list.length; i < n; i++) { @@ -20572,9 +20685,18 @@ var ts; } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); + var sourceMapUrl; + if (compilerOptions.inlineSourceMap) { + var base64SourceMapText = ts.convertToBase64(sourceMapText); + sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; + } + else { + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); + sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; + } + writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); } var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); sourceMapData = { @@ -20586,6 +20708,7 @@ var ts; inputSourceFileNames: [], sourceMapNames: [], sourceMapMappings: "", + sourceMapSourcesContent: undefined, sourceMapDecodedMappings: [] }; sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); @@ -20608,8 +20731,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { + if (node) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node, false); + } + if (node.kind != 228) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); + recordEmitNodeEndSpan(node); + } + else { + recordNewSourceFileStart(node); + emitNodeWithoutSourceMap(node, false); + } + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emitSourceFileStart = recordNewSourceFileStart; + emit = emitNodeWithSourceMap; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -20770,7 +20909,7 @@ var ts; } function emitLiteral(node) { var text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === 8 || ts.isTemplateLiteralKind(node.kind))) { + if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) && (node.kind === 8 || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { @@ -20842,10 +20981,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 171) { + if (node.template.kind === 172) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 169 + var needsParens = templateSpan.expression.kind === 170 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -20869,7 +21008,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 161 + var needsParens = templateSpan.expression.kind !== 162 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -20902,11 +21041,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 157: case 158: - return parent.expression === template; case 159: - case 161: + return parent.expression === template; + case 160: + case 162: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -20914,7 +21053,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 169: + case 170: switch (expression.operatorToken.kind) { case 35: case 36: @@ -20926,8 +21065,8 @@ var ts; default: return -1; } - case 172: - case 170: + case 173: + case 171: return -1; default: return 1; @@ -20939,11 +21078,11 @@ var ts; emit(span.literal); } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 152); + ts.Debug.assert(node.kind !== 153); if (node.kind === 8) { emitLiteral(node); } - else if (node.kind === 127) { + else if (node.kind === 128) { if (ts.nodeIsDecorated(node.parent)) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; @@ -20974,36 +21113,36 @@ var ts; function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 129: - case 198: - case 152: + case 130: + case 199: + case 153: + case 133: case 132: - case 131: - case 224: case 225: case 226: + case 227: + case 135: case 134: - case 133: - case 200: - case 136: - case 137: - case 162: case 201: + case 137: + case 138: + case 163: case 202: - case 204: + case 203: case 205: - case 208: - case 210: + case 206: + case 209: case 211: + case 212: return parent.name === node; - case 213: - case 217: - return parent.name === node || parent.propertyName === node; - case 190: - case 189: case 214: + case 218: + return parent.name === node || parent.propertyName === node; + case 191: + case 190: + case 215: return false; - case 194: + case 195: return node.parent.label === node; } } @@ -21080,7 +21219,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emitVerbatimDeclarationName(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -21111,11 +21250,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 65: - case 153: - case 155: + case 154: case 156: case 157: - case 161: + case 158: + case 162: return false; } return true; @@ -21132,14 +21271,14 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 173) { + if (e.kind === 174) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < length && elements[i].kind !== 173) { + while (i < length && elements[i].kind !== 174) { i++; } write("["); @@ -21160,7 +21299,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 173; + return node.kind === 174; } function emitArrayLiteral(node) { var elements = node.elements; @@ -21221,7 +21360,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 136 || property.kind === 137) { + if (property.kind === 137 || property.kind === 138) { var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { continue; @@ -21272,13 +21411,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 224) { + if (property.kind === 225) { emit(property.initializer); } - else if (property.kind === 225) { + else if (property.kind === 226) { emitExpressionIdentifier(property.name); } - else if (property.kind === 134) { + else if (property.kind === 135) { emitFunctionDeclaration(property); } else { @@ -21310,7 +21449,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 === 127) { + if (properties[i].name.kind === 128) { numInitialNonComputedProperties = i; break; } @@ -21324,30 +21463,30 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(169, startsOnNewLine); + var result = ts.createSynthesizedNode(170, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(155); + var result = ts.createSynthesizedNode(156); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(20); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(156); + var result = ts.createSynthesizedNode(157); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } function parenthesizeForAccess(expr) { - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 && expr.kind !== 7) { + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 && expr.kind !== 7) { return expr; } - var node = ts.createSynthesizedNode(161); + var node = ts.createSynthesizedNode(162); node.expression = expr; return node; } @@ -21360,19 +21499,19 @@ var ts; if (languageVersion >= 2 && node.asteriskToken) { write("*"); } - emitVerbatimDeclarationName(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": "); var generatedName = getGeneratedNameForIdentifier(node.name); @@ -21396,7 +21535,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 156 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -21426,7 +21565,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emitVerbatimDeclarationName(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -21444,10 +21583,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 173; }); + return ts.forEach(elements, function (e) { return e.kind === 174; }); } function skipParentheses(node) { - while (node.kind === 161 || node.kind === 160) { + while (node.kind === 162 || node.kind === 161) { node = node.expression; } return node; @@ -21468,12 +21607,12 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 155) { + if (expr.kind === 156) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 156) { + else if (expr.kind === 157) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); @@ -21514,7 +21653,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; + superCall = node.expression.kind === 156 && node.expression.expression.kind === 91; } if (superCall && languageVersion < 2) { write(".call("); @@ -21551,20 +21690,20 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 163) { - if (node.expression.kind === 160) { + if (!node.parent || node.parent.kind !== 164) { + if (node.expression.kind === 161) { var operand = node.expression.expression; - while (operand.kind == 160) { + while (operand.kind == 161) { operand = operand.expression; } - if (operand.kind !== 167 && + if (operand.kind !== 168 && + operand.kind !== 167 && operand.kind !== 166 && operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 168 && - operand.kind !== 158 && - !(operand.kind === 157 && node.parent.kind === 158) && - !(operand.kind === 162 && node.parent.kind === 157)) { + operand.kind !== 169 && + operand.kind !== 159 && + !(operand.kind === 158 && node.parent.kind === 159) && + !(operand.kind === 163 && node.parent.kind === 158)) { emit(operand); return; } @@ -21589,9 +21728,25 @@ var ts; write(" "); emit(node.expression); } + function isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node) { + if (!isCurrentFileSystemExternalModule() || node.kind !== 65 || ts.nodeIsSynthesized(node)) { + return false; + } + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 199 || node.parent.kind === 153); + var targetDeclaration = isVariableDeclarationOrBindingElement + ? node.parent + : resolver.getReferencedValueDeclaration(node); + return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); + } function emitPrefixUnaryExpression(node) { + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + } write(ts.tokenToString(node.operator)); - if (node.operand.kind === 167) { + if (node.operand.kind === 168) { var operand = node.operand; if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { write(" "); @@ -21601,23 +21756,73 @@ var ts; } } emit(node.operand); + if (exportChanged) { + write(")"); + } } function emitPostfixUnaryExpression(node) { - emit(node.operand); - write(ts.tokenToString(node.operator)); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + write("(" + exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + write(ts.tokenToString(node.operator)); + emit(node.operand); + if (node.operator === 38) { + write(") - 1)"); + } + else { + write(") + 1)"); + } + } + else { + emit(node.operand); + write(ts.tokenToString(node.operator)); + } + } + function shouldHoistDeclarationInSystemJsModule(node) { + return isSourceFileLevelDeclarationInSystemJsModule(node, false); + } + function isSourceFileLevelDeclarationInSystemJsModule(node, isExported) { + if (!node || languageVersion >= 2 || !isCurrentFileSystemExternalModule()) { + return false; + } + var current = node; + while (current) { + if (current.kind === 228) { + return !isExported || ((ts.getCombinedNodeFlags(node) & 1) !== 0); + } + else if (ts.isFunctionLike(current) || current.kind === 207) { + return false; + } + else { + current = current.parent; + } + } } function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 53 && - (node.left.kind === 154 || node.left.kind === 153)) { - emitDestructuring(node, node.parent.kind === 182); + (node.left.kind === 155 || node.left.kind === 154)) { + emitDestructuring(node, node.parent.kind === 183); } else { + var exportChanged = node.operatorToken.kind >= 53 && + node.operatorToken.kind <= 64 && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.left); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.left); + write("\", "); + } emit(node.left); var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + if (exportChanged) { + write(")"); + } } } function synthesizedNodeStartsOnNewLine(node) { @@ -21645,7 +21850,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 179) { + if (node && node.kind === 180) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -21660,12 +21865,12 @@ var ts; emitToken(14, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 206) { - ts.Debug.assert(node.parent.kind === 205); + if (node.kind === 207) { + ts.Debug.assert(node.parent.kind === 206); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 206) { + if (node.kind === 207) { emitTempDeclarations(true); } decreaseIndent(); @@ -21674,7 +21879,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 179) { + if (node.kind === 180) { write(" "); emit(node); } @@ -21686,7 +21891,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 163); + emitParenthesizedIf(node.expression, node.expression.kind === 164); write(";"); } function emitIfStatement(node) { @@ -21699,7 +21904,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(76, node.thenStatement.end); - if (node.elseStatement.kind === 183) { + if (node.elseStatement.kind === 184) { write(" "); emit(node.elseStatement); } @@ -21711,7 +21916,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 179) { + if (node.statement.kind === 180) { write(" "); } else { @@ -21727,7 +21932,10 @@ var ts; write(")"); emitEmbeddedStatement(node.statement); } - function emitStartOfVariableDeclarationList(decl, startPos) { + function tryEmitStartOfVariableDeclarationList(decl, startPos) { + if (shouldHoistVariable(decl, true)) { + return false; + } var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { @@ -21739,28 +21947,53 @@ var ts; } if (startPos !== undefined) { emitToken(tokenKind, startPos); + write(" "); } else { switch (tokenKind) { case 98: - return write("var "); + write("var "); + break; case 104: - return write("let "); + write("let "); + break; case 70: - return write("const "); + write("const "); + break; } } + return true; + } + function emitVariableDeclarationListSkippingUninitializedEntries(list) { + var started = false; + for (var _a = 0, _b = list.declarations; _a < _b.length; _a++) { + var decl = _b[_a]; + if (!decl.initializer) { + continue; + } + if (!started) { + started = true; + } + else { + write(", "); + } + emit(decl); + } + return started; } function emitForStatement(node) { var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 199) { + if (node.initializer && node.initializer.kind === 200) { var variableDeclarationList = node.initializer; - var declarations = variableDeclarationList.declarations; - emitStartOfVariableDeclarationList(declarations[0], endPos); - write(" "); - emitCommaList(declarations); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + if (startIsEmitted) { + emitCommaList(variableDeclarationList.declarations); + } + else { + emitVariableDeclarationListSkippingUninitializedEntries(variableDeclarationList); + } } else if (node.initializer) { emit(node.initializer); @@ -21768,30 +22001,28 @@ var ts; write(";"); emitOptional(" ", node.condition); write(";"); - emitOptional(" ", node.iterator); + emitOptional(" ", node.incrementor); write(")"); emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 188) { + if (languageVersion < 2 && node.kind === 189) { return emitDownLevelForOfStatement(node); } var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - var decl = variableDeclarationList.declarations[0]; - emitStartOfVariableDeclarationList(decl, endPos); - write(" "); - emit(decl); + tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 187) { + if (node.kind === 188) { write(" in "); } else { @@ -21830,27 +22061,27 @@ var ts; var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); emitStart(node.expression); write("var "); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); if (!rhsIsIdentifier) { write(", "); emitStart(node.expression); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(" = "); - emitWithoutSourceMap(node.expression); + emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } write("; "); emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" < "); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(".length"); emitEnd(node.initializer); write("; "); emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); emitToken(17, node.expression.end); @@ -21859,7 +22090,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -21868,29 +22099,29 @@ var ts; emitDestructuring(declaration, false, rhsIterationValue); } else { - emitWithoutSourceMap(declaration); + emitNodeWithoutSourceMap(declaration); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { - emitWithoutSourceMap(createTempVariable(0)); + emitNodeWithoutSourceMap(createTempVariable(0)); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); - if (node.initializer.kind === 153 || node.initializer.kind === 154) { + if (node.initializer.kind === 154 || node.initializer.kind === 155) { emitDestructuring(assignmentExpression, true, undefined); } else { - emitWithoutSourceMap(assignmentExpression); + emitNodeWithoutSourceMap(assignmentExpression); } } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 179) { + if (node.statement.kind === 180) { emitLines(node.statement.statements); } else { @@ -21902,7 +22133,7 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 190 ? 66 : 71, node.pos); + emitToken(node.kind === 191 ? 66 : 71, node.pos); emitOptional(" ", node.label); write(";"); } @@ -21947,7 +22178,7 @@ var ts; ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 220) { + if (node.kind === 221) { write("case "); emit(node.expression); write(":"); @@ -22002,7 +22233,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 205); + } while (node && node.kind !== 206); return node; } function emitContainingModuleName(node) { @@ -22017,17 +22248,17 @@ var ts; write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < 2) { + else if (languageVersion < 2 && compilerOptions.module !== 4) { write("exports."); } } - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { var zero = ts.createSynthesizedNode(7); zero.text = "0"; - var result = ts.createSynthesizedNode(166); + var result = ts.createSynthesizedNode(167); result.expression = zero; return result; } @@ -22035,19 +22266,33 @@ var ts; if (node.flags & 1) { writeLine(); emitStart(node); - if (node.flags & 256) { - if (languageVersion === 0) { - write("exports[\"default\"]"); + if (compilerOptions.module === 4) { + write(exportFunctionForFile + "(\""); + if (node.flags & 256) { + write("default"); } else { - write("exports.default"); + emitNodeWithoutSourceMap(node.name); } + write("\", "); + emitDeclarationName(node); + write(")"); } else { - emitModuleMemberName(node); + if (node.flags & 256) { + if (languageVersion === 0) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); } - write(" = "); - emitNameOfDeclaration(node); emitEnd(node); write(";"); } @@ -22057,21 +22302,40 @@ var ts; for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { var specifier = _b[_a]; writeLine(); - emitStart(specifier.name); - emitContainingModuleName(specifier); - write("."); - emitWithoutSourceMap(specifier.name); - emitEnd(specifier.name); - write(" = "); - emitExpressionIdentifier(name); + if (compilerOptions.module === 4) { + emitStart(specifier.name); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(specifier.name); + write("\", "); + emitExpressionIdentifier(name); + write(")"); + emitEnd(specifier.name); + } + else { + emitStart(specifier.name); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier.name); + write(" = "); + emitExpressionIdentifier(name); + } write(";"); } } } function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; - var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; - if (root.kind === 169) { + var canDefineTempVariablesInPlace = false; + if (root.kind === 199) { + var isExported = ts.getCombinedNodeFlags(root) & 1; + var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); + canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; + } + else if (root.kind === 130) { + canDefineTempVariablesInPlace = true; + } + if (root.kind === 170) { emitAssignmentExpression(root); } else { @@ -22083,7 +22347,14 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 199 || name.parent.kind === 153); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(name); + write("\", "); + } + if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } else { @@ -22091,11 +22362,14 @@ var ts; } write(" = "); emit(value); + if (exportChanged) { + write(")"); + } } function ensureIdentifier(expr) { if (expr.kind !== 65) { var identifier = createTempVariable(0); - if (!isDeclaration) { + if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -22105,14 +22379,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(169); + var equals = ts.createSynthesizedNode(170); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(30); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(170); + var cond = ts.createSynthesizedNode(171); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50); cond.whenTrue = whenTrue; @@ -22132,7 +22406,7 @@ var ts; return createPropertyAccessExpression(object, propName); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(157); + var call = ts.createSynthesizedNode(158); var sliceIdentifier = ts.createSynthesizedNode(65); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -22147,7 +22421,7 @@ var ts; } for (var _a = 0; _a < properties.length; _a++) { var p = properties[_a]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 225 || p.kind === 226) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } @@ -22160,8 +22434,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { + if (e.kind !== 176) { + if (e.kind !== 174) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -22171,14 +22445,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 170 && target.operatorToken.kind === 53) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 154) { + if (target.kind === 155) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 153) { + else if (target.kind === 154) { emitArrayLiteralAssignment(target, value); } else { @@ -22192,14 +22466,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 161) { + if (root.parent.kind !== 162) { write("("); } value = ensureIdentifier(value); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 161) { + if (root.parent.kind !== 162) { write(")"); } } @@ -22219,11 +22493,11 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 150) { + if (pattern.kind === 151) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 175) { + else if (element.kind !== 176) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } @@ -22250,22 +22524,31 @@ var ts; } else { renameNonTopLevelLetAndConst(node.name); - emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2) { var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); if (isUninitializedLet && - node.parent.parent.kind !== 187 && - node.parent.parent.kind !== 188) { + node.parent.parent.kind !== 188 && + node.parent.parent.kind !== 189) { initializer = createVoidZero(); } } + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.name); + write("\", "); + } + emitModuleMemberName(node); emitOptional(" = ", initializer); + if (exportChanged) { + write(")"); + } } } function emitExportVariableAssignments(node) { - if (node.kind === 175) { + if (node.kind === 176) { return; } var name = node.name; @@ -22277,7 +22560,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { + if (!node.parent || (node.parent.kind !== 199 && node.parent.kind !== 153)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -22286,24 +22569,24 @@ var ts; if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || node.kind !== 65 || - (node.parent.kind !== 198 && node.parent.kind !== 152)) { + (node.parent.kind !== 199 && node.parent.kind !== 153)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { return; } - var list = ts.getAncestor(node, 199); - if (list.parent.kind === 180) { - var isSourceFileLevelBinding = list.parent.parent.kind === 227; - var isModuleLevelBinding = list.parent.parent.kind === 206; - var isFunctionLevelBinding = list.parent.parent.kind === 179 && ts.isFunctionLike(list.parent.parent.parent); + var list = ts.getAncestor(node, 200); + if (list.parent.kind === 181) { + var isSourceFileLevelBinding = list.parent.parent.kind === 228; + var isModuleLevelBinding = list.parent.parent.kind === 207; + var isFunctionLevelBinding = list.parent.parent.kind === 180 && ts.isFunctionLike(list.parent.parent.parent); if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { return; } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 227 + var parent = blockScopeContainer.kind === 228 ? blockScopeContainer : blockScopeContainer.parent; if (resolver.resolvesToSomeValue(parent, node.text)) { @@ -22318,18 +22601,27 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 1) && languageVersion >= 2 && - node.parent.kind === 227; + node.parent.kind === 228; } function emitVariableStatement(node) { + var startIsEmitted = true; if (!(node.flags & 1)) { - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { write("export "); - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); + } + if (startIsEmitted) { + emitCommaList(node.declarationList.declarations); + write(";"); + } + else { + var atLeastOneItem = emitVariableDeclarationListSkippingUninitializedEntries(node.declarationList); + if (atLeastOneItem) { + write(";"); + } } - emitCommaList(node.declarationList.declarations); - write(";"); if (languageVersion < 2 && node.parent === currentSourceFile) { ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); } @@ -22374,14 +22666,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitWithoutSourceMap(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -22400,7 +22692,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -22421,7 +22713,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -22430,26 +22722,26 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 136 ? "get " : "set "); - emitVerbatimDeclarationName(node.name); + write(node.kind === 137 ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 163 && languageVersion >= 2; + return node.kind === 164 && languageVersion >= 2; } - function emitNameOfDeclaration(node) { + function emitDeclarationName(node) { if (node.name) { - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(getGeneratedNameForNode(node)); } } function shouldEmitFunctionName(node) { - if (node.kind === 162) { + if (node.kind === 163) { return !!node.name; } - if (node.kind === 200) { + if (node.kind === 201) { return !!node.name || languageVersion < 2; } } @@ -22457,6 +22749,9 @@ var ts; if (ts.nodeIsMissing(node.body)) { return emitOnlyPinnedOrTripleSlashComments(node); } + if (node.kind !== 135 && node.kind !== 134) { + emitLeadingComments(node); + } if (!shouldEmitAsArrowFunction(node)) { if (isES6ExportedDeclaration(node)) { write("export "); @@ -22471,12 +22766,15 @@ var ts; write(" "); } if (shouldEmitFunctionName(node)) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 && node.kind === 201 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } + if (node.kind !== 135 && node.kind !== 134) { + emitTrailingComments(node); + } } function emitCaptureThisForNodeIfNecessary(node) { if (resolver.getNodeCheckFlags(node) & 4) { @@ -22521,7 +22819,7 @@ var ts; if (!node.body) { write(" { }"); } - else if (node.body.kind === 179) { + else if (node.body.kind === 180) { emitBlockFunctionBody(node, node.body); } else { @@ -22546,10 +22844,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 160) { + while (current.kind === 161) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 154); + emitParenthesizedIf(body, current.kind === 155); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -22621,9 +22919,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 182) { + if (statement && statement.kind === 183) { var expr = statement.expression; - if (expr && expr.kind === 157) { + if (expr && expr.kind === 158) { var func = expr.expression; if (func && func.kind === 91) { return statement; @@ -22639,7 +22937,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitWithoutSourceMap(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -22651,22 +22949,22 @@ var ts; function emitMemberAccessForPropertyName(memberName) { if (memberName.kind === 8 || memberName.kind === 7) { write("["); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 127) { + else if (memberName.kind === 128) { emitComputedPropertyName(memberName); } else { write("."); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); } } - function getInitializedProperties(node, static) { + function getInitializedProperties(node, isStatic) { var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 132 && static === ((member.flags & 128) !== 0) && member.initializer) { + if (member.kind === 133 && isStatic === ((member.flags & 128) !== 0) && member.initializer) { properties.push(member); } } @@ -22688,7 +22986,7 @@ var ts; } else { if (property.flags & 128) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } else { write("this"); @@ -22706,11 +23004,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 178) { + if (member.kind === 179) { writeLine(); write(";"); } - else if (member.kind === 134 || node.kind === 133) { + else if (member.kind === 135 || node.kind === 134) { if (!member.body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -22729,7 +23027,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 136 || member.kind === 137) { + else if (member.kind === 137 || member.kind === 138) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -22779,22 +23077,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 134 || node.kind === 133) && !member.body) { + if ((member.kind === 135 || node.kind === 134) && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === 134 || - member.kind === 136 || - member.kind === 137) { + else if (member.kind === 135 || + member.kind === 137 || + member.kind === 138) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 128) { write("static "); } - if (member.kind === 136) { + if (member.kind === 137) { write("get "); } - else if (member.kind === 137) { + else if (member.kind === 138) { write("set "); } if (member.asteriskToken) { @@ -22805,7 +23103,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 178) { + else if (member.kind === 179) { writeLine(); write(";"); } @@ -22826,10 +23124,10 @@ var ts; function emitConstructorWorker(node, baseTypeElement) { var hasInstancePropertyWithInitializer = false; ts.forEach(node.members, function (member) { - if (member.kind === 135 && !member.body) { + if (member.kind === 136 && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + if (member.kind === 133 && member.initializer && (member.flags & 128) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -22843,7 +23141,7 @@ var ts; emitStart(ctor || node); if (languageVersion < 2) { write("function "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitSignatureParameters(ctor); } else { @@ -22929,13 +23227,13 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 201) { + if (node.kind === 202) { if (thisNodeIsDecorated) { if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { write("export "); } write("let "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = "); } else if (isES6ExportedDeclaration(node)) { @@ -22946,7 +23244,7 @@ var ts; } } var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 175; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0); @@ -22958,7 +23256,7 @@ var ts; write("class"); if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { write(" "); - emitNameOfDeclaration(node); + emitDeclarationName(node); } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { @@ -22977,15 +23275,6 @@ var ts; scopeEmitEnd(); if (thisNodeIsDecorated) { write(";"); - if (node.name) { - writeLine(); - write("Object.defineProperty("); - emitNameOfDeclaration(node); - write(", \"name\", { value: \""); - emitNameOfDeclaration(node); - write("\", configurable: true });"); - writeLine(); - } } if (isClassExpressionWithStaticProperties) { for (var _a = 0; _a < staticProperties.length; _a++) { @@ -23010,21 +23299,23 @@ var ts; emitStart(node); emitModuleMemberName(node); write(" = "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitEnd(node); write(";"); } else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { writeLine(); write("export default "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(";"); } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 201) { - write("var "); - emitNameOfDeclaration(node); + if (node.kind === 202) { + if (!shouldHoistDeclarationInSystemJsModule(node)) { + write("var "); + } + emitDeclarationName(node); write(" = "); } write("(function ("); @@ -23047,7 +23338,7 @@ var ts; writeLine(); emitStart(baseTypeNode); write("__extends("); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(", _super);"); emitEnd(baseTypeNode); } @@ -23060,7 +23351,7 @@ var ts; writeLine(); emitToken(15, node.members.end, function () { write("return "); - emitNameOfDeclaration(node); + emitDeclarationName(node); }); write(";"); emitTempDeclarations(true); @@ -23078,11 +23369,11 @@ var ts; emit(baseTypeNode.expression); } write(")"); - if (node.kind === 201) { + if (node.kind === 202) { write(";"); } emitEnd(node); - if (node.kind === 201) { + if (node.kind === 202) { emitExportMemberAssignment(node); } if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { @@ -23090,7 +23381,7 @@ var ts; } } function emitClassMemberPrefix(node, member) { - emitNameOfDeclaration(node); + emitDeclarationName(node); if (!(member.flags & 128)) { write(".prototype"); } @@ -23109,7 +23400,7 @@ var ts; } writeLine(); emitStart(node); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); @@ -23124,7 +23415,7 @@ var ts; decreaseIndent(); writeLine(); write("], "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); @@ -23156,13 +23447,13 @@ var ts; } else { decorators = member.decorators; - if (member.kind === 134) { + if (member.kind === 135) { functionLikeMember = member; } } writeLine(); emitStart(member); - if (member.kind !== 132) { + if (member.kind !== 133) { write("Object.defineProperty("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -23192,7 +23483,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - if (member.kind !== 132) { + if (member.kind !== 133) { write(", Object.getOwnPropertyDescriptor("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -23231,26 +23522,26 @@ var ts; } function shouldEmitTypeMetadata(node) { switch (node.kind) { - case 134: - case 136: + case 135: case 137: - case 132: + case 138: + case 133: return true; } return false; } function shouldEmitReturnTypeMetadata(node) { switch (node.kind) { - case 134: + case 135: return true; } return false; } function shouldEmitParamTypesMetadata(node) { switch (node.kind) { - case 201: - case 134: - case 137: + case 202: + case 135: + case 138: return true; } return false; @@ -23410,7 +23701,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 205) { + if (moduleDeclaration.body.kind === 206) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -23426,7 +23717,9 @@ var ts; if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - if (!isModuleMergedWithES6Class(node)) { + var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); + var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); + if (emitVarForModule) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); @@ -23443,7 +23736,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 206) { + if (node.body.kind === 207) { var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; tempFlags = 0; @@ -23476,6 +23769,14 @@ var ts; write(" = {}));"); emitEnd(node); if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { + if (compilerOptions.module === 4 && (node.flags & 1)) { + writeLine(); + write(exportFunctionForFile + "(\""); + emitDeclarationName(node); + write("\", "); + emitDeclarationName(node); + write(")"); + } emitExportMemberAssignments(node.name); } } @@ -23492,16 +23793,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 212) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 209 && node.importClause && !!node.importClause.name; + return node.kind === 210 && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -23528,7 +23829,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 212) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -23554,7 +23855,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var isExportedImport = node.kind === 209 && (node.flags & 1) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2) { emitLeadingComments(node); @@ -23566,7 +23867,7 @@ var ts; write(" = "); } else { - var isNakedImport = 209 && !node.importClause; + var isNakedImport = 210 && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -23629,6 +23930,7 @@ var ts; } } function emitExportDeclaration(node) { + ts.Debug.assert(compilerOptions.module !== 4); if (languageVersion < 2) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); @@ -23648,11 +23950,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitWithoutSourceMap(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); } @@ -23686,7 +23988,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitWithoutSourceMap(node.moduleSpecifier); + emitNodeWithoutSourceMap(node.moduleSpecifier); } write(";"); emitEnd(node); @@ -23704,10 +24006,10 @@ var ts; } emitStart(specifier); if (specifier.propertyName) { - emitWithoutSourceMap(specifier.propertyName); + emitNodeWithoutSourceMap(specifier.propertyName); write(" as "); } - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier); needsComma = true; } @@ -23721,8 +24023,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 200 && - expression.kind !== 201) { + if (expression.kind !== 201 && + expression.kind !== 202) { write(";"); } emitEnd(node); @@ -23730,14 +24032,21 @@ var ts; else { writeLine(); emitStart(node); - emitContainingModuleName(node); - if (languageVersion === 0) { - write("[\"default\"] = "); + if (compilerOptions.module === 4) { + write(exportFunctionForFile + "(\"default\","); + emit(node.expression); + write(")"); } else { - write(".default = "); + emitContainingModuleName(node); + if (languageVersion === 0) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } + emit(node.expression); } - emit(node.expression); write(";"); emitEnd(node); } @@ -23751,18 +24060,18 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 209: + case 210: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { externalImports.push(node); } break; - case 208: - if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + case 209: + if (node.moduleReference.kind === 220 && resolver.isReferencedAliasDeclaration(node)) { externalImports.push(node); } break; - case 215: + case 216: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -23780,7 +24089,7 @@ var ts; } } break; - case 214: + case 215: if (node.isExportEquals && !exportEquals) { exportEquals = node; } @@ -23800,8 +24109,387 @@ var ts; write("}"); } } - function emitAMDModule(node, startIndex) { + function getLocalNameForExternalImport(importNode) { + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + return getGeneratedNameForNode(importNode); + } + } + function getExternalModuleNameText(importNode) { + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8) { + return getLiteralText(moduleName); + } + return undefined; + } + function emitVariableDeclarationsForImports() { + if (externalImports.length === 0) { + return; + } + writeLine(); + var started = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; + var skipNode = importNode.kind === 216 || + (importNode.kind === 210 && !importNode.importClause); + if (skipNode) { + continue; + } + if (!started) { + write("var "); + started = true; + } + else { + write(", "); + } + write(getLocalNameForExternalImport(importNode)); + } + if (started) { + write(";"); + } + } + function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { + if (!hasExportStars) { + return undefined; + } + if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { + var hasExportDeclarationWithExportClause = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var externalImport = externalImports[_a]; + if (externalImport.kind === 216 && externalImport.exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + if (!hasExportDeclarationWithExportClause) { + return emitExportStarFunction(undefined); + } + } + var exportedNamesStorageRef = makeUniqueName("exportedNames"); + writeLine(); + write("var " + exportedNamesStorageRef + " = {"); + increaseIndent(); + var started = false; + if (exportedDeclarations) { + for (var i = 0; i < exportedDeclarations.length; ++i) { + writeExportedName(exportedDeclarations[i]); + } + } + if (exportSpecifiers) { + for (var n in exportSpecifiers) { + for (var _b = 0, _c = exportSpecifiers[n]; _b < _c.length; _b++) { + var specifier = _c[_b]; + writeExportedName(specifier.name); + } + } + } + for (var _d = 0; _d < externalImports.length; _d++) { + var externalImport = externalImports[_d]; + if (externalImport.kind !== 216) { + continue; + } + var exportDecl = externalImport; + if (!exportDecl.exportClause) { + continue; + } + for (var _e = 0, _f = exportDecl.exportClause.elements; _e < _f.length; _e++) { + var element = _f[_e]; + writeExportedName(element.name || element.propertyName); + } + } + decreaseIndent(); + writeLine(); + write("};"); + return emitExportStarFunction(exportedNamesStorageRef); + function emitExportStarFunction(localNames) { + var exportStarFunction = makeUniqueName("exportStar"); + writeLine(); + write("function " + exportStarFunction + "(m) {"); + increaseIndent(); + writeLine(); + write("for(var n in m) {"); + increaseIndent(); + writeLine(); + write("if (n !== \"default\""); + if (localNames) { + write("&& !" + localNames + ".hasOwnProperty(n)"); + } + write(") " + exportFunctionForFile + "(n, m[n]);"); + decreaseIndent(); + writeLine(); + write("}"); + decreaseIndent(); + writeLine(); + write("}"); + return exportStarFunction; + } + function writeExportedName(node) { + if (node.kind !== 65 && node.flags & 256) { + return; + } + if (started) { + write(","); + } + else { + started = true; + } + writeLine(); + write("'"); + if (node.kind === 65) { + emitNodeWithoutSourceMap(node); + } + else { + emitDeclarationName(node); + } + write("': true"); + } + } + function processTopLevelVariableAndFunctionDeclarations(node) { + var hoistedVars; + var hoistedFunctionDeclarations; + var exportedDeclarations; + visit(node); + if (hoistedVars) { + writeLine(); + write("var "); + for (var i = 0; i < hoistedVars.length; ++i) { + var local = hoistedVars[i]; + if (i !== 0) { + write(", "); + } + if (local.kind === 202 || local.kind === 206) { + emitDeclarationName(local); + } + else { + emit(local); + } + var flags = ts.getCombinedNodeFlags(local.kind === 65 ? local.parent : local); + if (flags & 1) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(local); + } + } + write(";"); + } + if (hoistedFunctionDeclarations) { + for (var _a = 0; _a < hoistedFunctionDeclarations.length; _a++) { + var f = hoistedFunctionDeclarations[_a]; + writeLine(); + emit(f); + if (f.flags & 1) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(f); + } + } + } + return exportedDeclarations; + function visit(node) { + if (node.kind === 201) { + if (!hoistedFunctionDeclarations) { + hoistedFunctionDeclarations = []; + } + hoistedFunctionDeclarations.push(node); + return; + } + if (node.kind === 202) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 206 && shouldEmitModuleDeclaration(node)) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 199 || node.kind === 153) { + if (shouldHoistVariable(node, false)) { + var name_21 = node.name; + if (name_21.kind === 65) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(name_21); + } + else { + ts.forEachChild(name_21, visit); + } + } + return; + } + if (ts.isBindingPattern(node)) { + ts.forEach(node.elements, visit); + return; + } + if (!ts.isDeclaration(node)) { + ts.forEachChild(node, visit); + } + } + } + function shouldHoistVariable(node, checkIfSourceFileLevelDecl) { + if (checkIfSourceFileLevelDecl && !shouldHoistDeclarationInSystemJsModule(node)) { + return false; + } + return (ts.getCombinedNodeFlags(node) & 12288) === 0 || + ts.getEnclosingBlockScopeContainer(node).kind === 228; + } + function isCurrentFileSystemExternalModule() { + return compilerOptions.module === 4 && ts.isExternalModule(currentSourceFile); + } + function emitSystemModuleBody(node, startIndex) { + emitVariableDeclarationsForImports(); + writeLine(); + var exportedDeclarations = processTopLevelVariableAndFunctionDeclarations(node); + var exportStarFunction = emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations); + writeLine(); + write("return {"); + increaseIndent(); + writeLine(); + emitSetters(exportStarFunction); + writeLine(); + emitExecute(node, startIndex); + emitTempDeclarations(true); + decreaseIndent(); + writeLine(); + write("}"); + } + function emitSetters(exportStarFunction) { + write("setters:["); + for (var i = 0; i < externalImports.length; ++i) { + if (i !== 0) { + write(","); + } + writeLine(); + increaseIndent(); + var importNode = externalImports[i]; + var importVariableName = getLocalNameForExternalImport(importNode) || ""; + var parameterName = "_" + importVariableName; + write("function (" + parameterName + ") {"); + switch (importNode.kind) { + case 210: + if (!importNode.importClause) { + break; + } + case 209: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + writeLine(); + write(importVariableName + " = " + parameterName + ";"); + writeLine(); + var defaultName = importNode.kind === 210 + ? importNode.importClause.name + : importNode.name; + if (defaultName) { + emitExportMemberAssignments(defaultName); + writeLine(); + } + if (importNode.kind === 210 && + importNode.importClause.namedBindings) { + var namedBindings = importNode.importClause.namedBindings; + if (namedBindings.kind === 212) { + emitExportMemberAssignments(namedBindings.name); + writeLine(); + } + else { + for (var _a = 0, _b = namedBindings.elements; _a < _b.length; _a++) { + var element = _b[_a]; + emitExportMemberAssignments(element.name || element.propertyName); + writeLine(); + } + } + } + decreaseIndent(); + break; + case 216: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + if (importNode.exportClause) { + for (var _c = 0, _d = importNode.exportClause.elements; _c < _d.length; _c++) { + var e = _d[_c]; + writeLine(); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(e.name); + write("\", " + parameterName + "[\""); + emitNodeWithoutSourceMap(e.propertyName || e.name); + write("\"]);"); + } + } + else { + writeLine(); + write(exportStarFunction + "(" + parameterName + ");"); + } + writeLine(); + decreaseIndent(); + break; + } + write("}"); + decreaseIndent(); + } + write("],"); + } + function emitExecute(node, startIndex) { + write("execute: function() {"); + increaseIndent(); + writeLine(); + for (var i = startIndex; i < node.statements.length; ++i) { + var statement = node.statements[i]; + switch (statement.kind) { + case 216: + case 210: + case 209: + case 201: + continue; + } + writeLine(); + emit(statement); + } + decreaseIndent(); + writeLine(); + write("}"); + } + function emitSystemModule(node, startIndex) { collectExternalModuleInfo(node); + ts.Debug.assert(!exportFunctionForFile); + exportFunctionForFile = makeUniqueName("exports"); + write("System.register(["); + for (var i = 0; i < externalImports.length; ++i) { + var text = getExternalModuleNameText(externalImports[i]); + if (i !== 0) { + write(", "); + } + write(text); + } + write("], function(" + exportFunctionForFile + ") {"); + writeLine(); + increaseIndent(); + emitCaptureThisForNodeIfNecessary(node); + emitSystemModuleBody(node, startIndex); + decreaseIndent(); + writeLine(); + write("});"); + } + function emitAMDDependencies(node, includeNonAmdDependencies) { + // An AMD define function has the following shape: + // define(id?, dependencies?, factory); + // + // This has the shape of + // define(name, ["module1", "module2"], function (module1Alias) { + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` + // we need to add modules without alias names to the end of the dependencies list var aliasedModuleNames = []; var unaliasedModuleNames = []; var importAliasNames = []; @@ -23817,20 +24505,9 @@ var ts; } for (var _c = 0; _c < externalImports.length; _c++) { var importNode = externalImports[_c]; - var externalModuleName = ""; - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8) { - externalModuleName = getLiteralText(moduleName); - } - var importAliasName = void 0; - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); - } - else { - importAliasName = getGeneratedNameForNode(importNode); - } - if (importAliasName) { + var externalModuleName = getExternalModuleNameText(importNode); + var importAliasName = getLocalNameForExternalImport(importNode); + if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); importAliasNames.push(importAliasName); } @@ -23838,11 +24515,6 @@ var ts; unaliasedModuleNames.push(externalModuleName); } } - writeLine(); - write("define("); - if (node.amdModuleName) { - write("\"" + node.amdModuleName + "\", "); - } write("[\"require\", \"exports\""); if (aliasedModuleNames.length) { write(", "); @@ -23857,6 +24529,15 @@ var ts; write(", "); write(importAliasNames.join(", ")); } + } + function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); + writeLine(); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + emitAMDDependencies(node, true); write(") {"); increaseIndent(); emitExportStarHelper(); @@ -23876,6 +24557,21 @@ var ts; emitTempDeclarations(true); emitExportEquals(false); } + function emitUMDModule(node, startIndex) { + collectExternalModuleInfo(node); + writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})("); + emitAMDDependencies(node, false); + write(") {"); + increaseIndent(); + emitExportStarHelper(); + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + emitExportEquals(true); + decreaseIndent(); + writeLine(); + write("});"); + } function emitES6Module(node, startIndex) { externalImports = undefined; exportSpecifiers = undefined; @@ -23923,28 +24619,36 @@ var ts; writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); - if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { - writeLines(extendsHelper); - extendsEmitted = true; - } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { - writeLines(decorateHelper); - if (compilerOptions.emitDecoratorMetadata) { - writeLines(metadataHelper); + if (!compilerOptions.noEmitHelpers) { + if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { + writeLines(extendsHelper); + extendsEmitted = true; + } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } + decorateEmitted = true; + } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024) { + writeLines(paramHelper); + paramEmitted = true; } - decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024) { - writeLines(paramHelper); - paramEmitted = true; - } - if (ts.isExternalModule(node)) { + if (ts.isExternalModule(node) || compilerOptions.separateCompilation) { if (languageVersion >= 2) { emitES6Module(node, startIndex); } else if (compilerOptions.module === 2) { emitAMDModule(node, startIndex); } + else if (compilerOptions.module === 4) { + emitSystemModule(node, startIndex); + } + else if (compilerOptions.module === 3) { + emitUMDModule(node, startIndex); + } else { emitCommonJSModule(node, startIndex); } @@ -23960,81 +24664,57 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - function emit(node) { - emitNodeWorker(node, true, true); - } - function emitWithoutSourceMap(node) { - emitNodeWorker(node, false, true); - } - function emitVerbatimDeclarationName(node) { - emitNodeWorker(node, true, false); - } - function emitNodeWorker(node, shouldEmitSourceMap, allowGeneratedIdentifiers) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2) { - emitOnlyPinnedOrTripleSlashComments(node); - return; - } - if (node.kind === 227) { - if (shouldEmitSourceMap) { - emitSourceFileStart(node); - } - emitBareNode(node, allowGeneratedIdentifiers); - return; + return emitOnlyPinnedOrTripleSlashComments(node); } var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } - if (shouldEmitSourceMap && !ts.nodeIsSynthesized(node)) { - emitStart(node); - emitBareNode(node, allowGeneratedIdentifiers); - emitEnd(node); - } - else { - emitBareNode(node, allowGeneratedIdentifiers); - } + emitJavaScriptWorker(node, allowGeneratedIdentifiers); if (emitComments) { emitTrailingComments(node); } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 202: - case 209: - case 208: case 203: - case 214: - return false; - case 200: - return !!node.body; - case 205: - return shouldEmitModuleDeclaration(node); + case 201: + case 210: + case 209: case 204: + case 215: + return false; + case 206: + return shouldEmitModuleDeclaration(node); + case 205: return shouldEmitEnumDeclaration(node); } - if (node.kind !== 179 && + if (node.kind !== 180 && node.parent && - node.parent.kind === 163 && + node.parent.kind === 164 && node.parent.body === node && compilerOptions.target <= 1) { return false; } return true; } - function emitBareNode(node, allowGeneratedIdentifiers) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } switch (node.kind) { case 65: return emitIdentifier(node, allowGeneratedIdentifiers); - case 129: + case 130: return emitParameter(node); + case 135: case 134: - case 133: return emitMethod(node); - case 136: case 137: + case 138: return emitAccessor(node); case 93: return emitThis(node); @@ -24054,139 +24734,139 @@ var ts; case 12: case 13: return emitLiteral(node); - case 171: - return emitTemplateExpression(node); - case 176: - return emitTemplateSpan(node); - case 126: - return emitQualifiedName(node); - case 150: - return emitObjectBindingPattern(node); - case 151: - return emitArrayBindingPattern(node); - case 152: - return emitBindingElement(node); - case 153: - return emitArrayLiteral(node); - case 154: - return emitObjectLiteral(node); - case 224: - return emitPropertyAssignment(node); - case 225: - return emitShorthandPropertyAssignment(node); - case 127: - return emitComputedPropertyName(node); - case 155: - return emitPropertyAccess(node); - case 156: - return emitIndexedAccess(node); - case 157: - return emitCallExpression(node); - case 158: - return emitNewExpression(node); - case 159: - return emitTaggedTemplateExpression(node); - case 160: - return emit(node.expression); - case 161: - return emitParenExpression(node); - case 200: - case 162: - case 163: - return emitFunctionDeclaration(node); - case 164: - return emitDeleteExpression(node); - case 165: - return emitTypeOfExpression(node); - case 166: - return emitVoidExpression(node); - case 167: - return emitPrefixUnaryExpression(node); - case 168: - return emitPostfixUnaryExpression(node); - case 169: - return emitBinaryExpression(node); - case 170: - return emitConditionalExpression(node); - case 173: - return emitSpreadElementExpression(node); case 172: - return emitYieldExpression(node); - case 175: - return; - case 179: - case 206: - return emitBlock(node); - case 180: - return emitVariableStatement(node); - case 181: - return write(";"); - case 182: - return emitExpressionStatement(node); - case 183: - return emitIfStatement(node); - case 184: - return emitDoStatement(node); - case 185: - return emitWhileStatement(node); - case 186: - return emitForStatement(node); - case 188: - case 187: - return emitForInOrForOfStatement(node); - case 189: - case 190: - return emitBreakOrContinueStatement(node); - case 191: - return emitReturnStatement(node); - case 192: - return emitWithStatement(node); - case 193: - return emitSwitchStatement(node); - case 220: - case 221: - return emitCaseOrDefaultClause(node); - case 194: - return emitLabelledStatement(node); - case 195: - return emitThrowStatement(node); - case 196: - return emitTryStatement(node); - case 223: - return emitCatchClause(node); - case 197: - return emitDebuggerStatement(node); - case 198: - return emitVariableDeclaration(node); - case 174: - return emitClassExpression(node); - case 201: - return emitClassDeclaration(node); - case 202: - return emitInterfaceDeclaration(node); - case 204: - return emitEnumDeclaration(node); + return emitTemplateExpression(node); + case 178: + return emitTemplateSpan(node); + case 127: + return emitQualifiedName(node); + case 151: + return emitObjectBindingPattern(node); + case 152: + return emitArrayBindingPattern(node); + case 153: + return emitBindingElement(node); + case 154: + return emitArrayLiteral(node); + case 155: + return emitObjectLiteral(node); + case 225: + return emitPropertyAssignment(node); case 226: - return emitEnumMember(node); + return emitShorthandPropertyAssignment(node); + case 128: + return emitComputedPropertyName(node); + case 156: + return emitPropertyAccess(node); + case 157: + return emitIndexedAccess(node); + case 158: + return emitCallExpression(node); + case 159: + return emitNewExpression(node); + case 160: + return emitTaggedTemplateExpression(node); + case 161: + return emit(node.expression); + case 162: + return emitParenExpression(node); + case 201: + case 163: + case 164: + return emitFunctionDeclaration(node); + case 165: + return emitDeleteExpression(node); + case 166: + return emitTypeOfExpression(node); + case 167: + return emitVoidExpression(node); + case 168: + return emitPrefixUnaryExpression(node); + case 169: + return emitPostfixUnaryExpression(node); + case 170: + return emitBinaryExpression(node); + case 171: + return emitConditionalExpression(node); + case 174: + return emitSpreadElementExpression(node); + case 173: + return emitYieldExpression(node); + case 176: + return; + case 180: + case 207: + return emitBlock(node); + case 181: + return emitVariableStatement(node); + case 182: + return write(";"); + case 183: + return emitExpressionStatement(node); + case 184: + return emitIfStatement(node); + case 185: + return emitDoStatement(node); + case 186: + return emitWhileStatement(node); + case 187: + return emitForStatement(node); + case 189: + case 188: + return emitForInOrForOfStatement(node); + case 190: + case 191: + return emitBreakOrContinueStatement(node); + case 192: + return emitReturnStatement(node); + case 193: + return emitWithStatement(node); + case 194: + return emitSwitchStatement(node); + case 221: + case 222: + return emitCaseOrDefaultClause(node); + case 195: + return emitLabelledStatement(node); + case 196: + return emitThrowStatement(node); + case 197: + return emitTryStatement(node); + case 224: + return emitCatchClause(node); + case 198: + return emitDebuggerStatement(node); + case 199: + return emitVariableDeclaration(node); + case 175: + return emitClassExpression(node); + case 202: + return emitClassDeclaration(node); + case 203: + return emitInterfaceDeclaration(node); case 205: - return emitModuleDeclaration(node); - case 209: - return emitImportDeclaration(node); - case 208: - return emitImportEqualsDeclaration(node); - case 215: - return emitExportDeclaration(node); - case 214: - return emitExportAssignment(node); + return emitEnumDeclaration(node); case 227: + return emitEnumMember(node); + case 206: + return emitModuleDeclaration(node); + case 210: + return emitImportDeclaration(node); + case 209: + return emitImportEqualsDeclaration(node); + case 216: + return emitExportDeclaration(node); + case 215: + return emitExportAssignment(node); + case 228: return emitSourceFileNode(node); } } function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; + return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -24206,7 +24886,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 227 || node.pos !== node.parent.pos) { + if (node.parent.kind === 228 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { return getLeadingCommentsWithoutDetachedComments(); } @@ -24218,7 +24898,7 @@ var ts; } function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 227 || node.end !== node.parent.end) { + if (node.parent.kind === 228 || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } @@ -24267,12 +24947,12 @@ var ts; lastComment = comment; }); if (detachedComments.length) { - var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } @@ -24312,7 +24992,9 @@ var ts; ts.emitTime = 0; ts.ioReadTime = 0; ts.ioWriteTime = 0; - ts.version = "1.5.0-beta"; + ts.version = "1.5.0"; + var carriageReturnLineFeed = "\r\n"; + var lineFeed = "\n"; function findConfigFile(searchPath) { var fileName = "tsconfig.json"; while (true) { @@ -24383,6 +25065,9 @@ var ts; } } } + var newLine = options.newLine === 0 ? carriageReturnLineFeed : + options.newLine === 1 ? lineFeed : + ts.sys.newLine; return { getSourceFile: getSourceFile, getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, @@ -24390,14 +25075,14 @@ var ts; getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { return newLine; } }; } ts.createCompilerHost = createCompilerHost; - function getPreEmitDiagnostics(program) { - var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + function getPreEmitDiagnostics(program, sourceFile) { + var diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics()); + diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -24635,7 +25320,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 209 || node.kind === 208 || node.kind === 215) { + if (node.kind === 210 || node.kind === 209 || node.kind === 216) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -24655,7 +25340,7 @@ var ts; } } } - else if (node.kind === 205 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 206 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { if (ts.isExternalModuleImportEqualsDeclaration(node) && ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { @@ -24738,6 +25423,22 @@ var ts; diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); } } + if (options.inlineSourceMap) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.mapRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.sourceRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + } + if (options.inlineSources) { + if (!options.sourceMap && !options.inlineSourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); + } + } if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { if (options.mapRoot) { diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); @@ -24756,15 +25457,15 @@ var ts; var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided)); } } else if (firstExternalModuleSourceFile && languageVersion < 2 && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); } if (options.module && languageVersion >= 2) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher)); } if (options.outDir || options.sourceRoot || @@ -24823,6 +25524,14 @@ var ts; type: "boolean", description: ts.Diagnostics.Print_this_message }, + { + name: "inlineSourceMap", + type: "boolean" + }, + { + name: "inlineSources", + type: "boolean" + }, { name: "listFiles", type: "boolean" @@ -24843,17 +25552,33 @@ var ts; shortName: "m", type: { "commonjs": 1, - "amd": 2 + "amd": 2, + "system": 4, + "umd": 3 }, - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd, paramType: ts.Diagnostics.KIND, - error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd + error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd + }, + { + name: "newLine", + type: { + "crlf": 0, + "lf": 1 + }, + description: ts.Diagnostics.Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + paramType: ts.Diagnostics.NEWLINE, + error: ts.Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF }, { name: "noEmit", type: "boolean", description: ts.Diagnostics.Do_not_emit_outputs }, + { + name: "noEmitHelpers", + type: "boolean" + }, { name: "noEmitOnError", type: "boolean", @@ -24943,7 +25668,7 @@ var ts; type: { "es3": 0, "es5": 1, "es6": 2 }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 + error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 }, { name: "version", @@ -25067,13 +25792,23 @@ var ts; function readConfigFile(fileName) { try { var text = ts.sys.readFile(fileName); - return /\S/.test(text) ? JSON.parse(text) : {}; } catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; } + return parseConfigFileText(fileName, text); } ts.readConfigFile = readConfigFile; - function parseConfigFile(json, basePath) { + function parseConfigFileText(fileName, jsonText) { + try { + return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} }; + } + catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; + } + } + ts.parseConfigFileText = parseConfigFileText; + function parseConfigFile(json, host, basePath) { var errors = []; return { options: getCompilerOptions(), @@ -25129,7 +25864,7 @@ var ts; } } else { - var sysFiles = ts.sys.readDirectory(basePath, ".ts"); + var sysFiles = host.readDirectory(basePath, ".ts"); for (var i = 0; i < sysFiles.length; i++) { var name = sysFiles[i]; if (!ts.fileExtensionIs(name, ".d.ts") || !ts.contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) { @@ -25305,12 +26040,13 @@ var ts; function performCompilation() { if (!cachedProgram) { if (configFileName) { - var configObject = ts.readConfigFile(configFileName); - if (!configObject) { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, configFileName)); + var result = ts.readConfigFile(configFileName); + if (result.error) { + reportDiagnostic(result.error); return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } - var configParseResult = ts.parseConfigFile(configObject, ts.getDirectoryPath(configFileName)); + var configObject = result.config; + var configParseResult = ts.parseConfigFile(configObject, ts.sys, ts.getDirectoryPath(configFileName)); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors); return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); diff --git a/bin/tsserver.js b/bin/tsserver.js index 31558ba88cf..1707ef70411 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -444,7 +444,7 @@ var ts; for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + if (part === ".." && normalized.length > 0 && lastOrUndefined(normalized) !== "..") { normalized.pop(); } else { @@ -536,7 +536,7 @@ var ts; function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { directoryComponents.length--; } for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { @@ -960,7 +960,7 @@ var ts; A_get_accessor_cannot_have_parameters: { code: 1054, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, + An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: ts.DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: ts.DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, @@ -1021,8 +1021,8 @@ var ts; or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "'{' or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in a namespace cannot reference a module." }, + Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules unless the '--module' flag is provided." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, var_let_or_const_expected: { code: 1152, category: ts.DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, @@ -1064,9 +1064,9 @@ var ts; The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, An_import_declaration_cannot_have_modifiers: { code: 1191, category: ts.DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "External module '{0}' has no default export." }, + Module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no default export." }, An_export_declaration_cannot_have_modifiers: { code: 1193, category: ts.DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." }, + Export_declarations_are_not_permitted_in_a_namespace: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in a namespace." }, Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: ts.DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." }, Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." }, Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, @@ -1075,28 +1075,27 @@ var ts; Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, - Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, + Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." }, Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." }, Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, - Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." }, + Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, + Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, Circular_definition_of_import_alias_0: { code: 2303, category: ts.DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, Cannot_find_name_0: { code: 2304, category: ts.DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not a module." }, + Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find module '{0}'." }, A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: ts.DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, @@ -1119,7 +1118,7 @@ var ts; Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: ts.DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: ts.DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible: { code: 2330, category: ts.DiagnosticCategory.Error, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_module_or_namespace_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module or namespace body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, @@ -1211,15 +1210,15 @@ var ts; Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient modules cannot be nested in other modules." }, + Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient module declaration cannot specify relative module name." }, Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, @@ -1273,11 +1272,13 @@ var ts; Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, - External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, - External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, + Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "Module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "Module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." }, + Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "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}'." }, 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}'." }, @@ -1353,6 +1354,7 @@ var ts; Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported file encoding." }, + Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." }, Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, @@ -1366,6 +1368,10 @@ var ts; Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." }, Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." }, Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, + Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." }, + Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -1377,7 +1383,7 @@ var ts; Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." }, Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." }, @@ -1398,8 +1404,8 @@ var ts; Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." }, + Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, @@ -1412,6 +1418,9 @@ var ts; Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, + Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." }, + NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" }, + Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -1424,7 +1433,6 @@ var ts; 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." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: ts.DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: ts.DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, _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: { code: 7023, category: ts.DiagnosticCategory.Error, key: "'{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." }, Function_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: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function 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." }, @@ -1480,7 +1488,7 @@ var ts; "false": 80, "finally": 81, "for": 82, - "from": 124, + "from": 125, "function": 83, "get": 116, "if": 84, @@ -1491,33 +1499,34 @@ var ts; "interface": 103, "let": 104, "module": 117, + "namespace": 118, "new": 88, "null": 89, - "number": 119, + "number": 120, "package": 105, "private": 106, "protected": 107, "public": 108, - "require": 118, + "require": 119, "return": 90, - "set": 120, + "set": 121, "static": 109, - "string": 121, + "string": 122, "super": 91, "switch": 92, - "symbol": 122, + "symbol": 123, "this": 93, "throw": 94, "true": 95, "try": 96, - "type": 123, + "type": 124, "typeof": 97, "var": 98, "void": 99, "while": 100, "with": 101, "yield": 110, - "of": 125, + "of": 126, "{": 14, "}": 15, "(": 16, @@ -1699,7 +1708,7 @@ var ts; function isLineBreak(ch) { // ES5 7.3: // The ECMAScript line terminator characters are listed in Table 3. - // Table 3 � Line Terminator Characters + // Table 3: Line Terminator Characters // Code Unit Value Name Formal Name // \u000A Line Feed // \u000D Carriage Return @@ -1839,7 +1848,7 @@ var ts; } collecting = true; if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } continue; case 9: @@ -1885,7 +1894,7 @@ var ts; default: if (ch > 127 && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } pos++; continue; @@ -2729,6 +2738,14 @@ var ts; type: "boolean", description: ts.Diagnostics.Print_this_message }, + { + name: "inlineSourceMap", + type: "boolean" + }, + { + name: "inlineSources", + type: "boolean" + }, { name: "listFiles", type: "boolean" @@ -2749,17 +2766,33 @@ var ts; shortName: "m", type: { "commonjs": 1, - "amd": 2 + "amd": 2, + "system": 4, + "umd": 3 }, - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd, paramType: ts.Diagnostics.KIND, - error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd + error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd + }, + { + name: "newLine", + type: { + "crlf": 0, + "lf": 1 + }, + description: ts.Diagnostics.Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + paramType: ts.Diagnostics.NEWLINE, + error: ts.Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF }, { name: "noEmit", type: "boolean", description: ts.Diagnostics.Do_not_emit_outputs }, + { + name: "noEmitHelpers", + type: "boolean" + }, { name: "noEmitOnError", type: "boolean", @@ -2849,7 +2882,7 @@ var ts; type: { "es3": 0, "es5": 1, "es6": 2 }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 + error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 }, { name: "version", @@ -2973,13 +3006,23 @@ var ts; function readConfigFile(fileName) { try { var text = ts.sys.readFile(fileName); - return /\S/.test(text) ? JSON.parse(text) : {}; } catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; } + return parseConfigFileText(fileName, text); } ts.readConfigFile = readConfigFile; - function parseConfigFile(json, basePath) { + function parseConfigFileText(fileName, jsonText) { + try { + return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} }; + } + catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; + } + } + ts.parseConfigFileText = parseConfigFileText; + function parseConfigFile(json, host, basePath) { var errors = []; return { options: getCompilerOptions(), @@ -3035,7 +3078,7 @@ var ts; } } else { - var sysFiles = ts.sys.readDirectory(basePath, ".ts"); + var sysFiles = host.readDirectory(basePath, ".ts"); for (var i = 0; i < sysFiles.length; i++) { var name = sysFiles[i]; if (!ts.fileExtensionIs(name, ".d.ts") || !ts.contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) { @@ -3111,7 +3154,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 227) { + while (node && node.kind !== 228) { node = node.parent; } return node; @@ -3200,15 +3243,15 @@ var ts; return current; } switch (current.kind) { - case 227: - case 207: - case 223: - case 205: - case 186: + case 228: + case 208: + case 224: + case 206: case 187: case 188: + case 189: return current; - case 179: + case 180: if (!isFunctionLike(current.parent)) { return current; } @@ -3219,9 +3262,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 198 && + declaration.kind === 199 && declaration.parent && - declaration.parent.kind === 223; + declaration.parent.kind === 224; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3257,22 +3300,22 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 227: + case 228: 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 198: - case 152: - case 201: - case 174: + case 199: + case 153: case 202: + case 175: + case 203: + case 206: case 205: - case 204: - case 226: - case 200: - case 162: + case 227: + case 201: + case 163: errorNode = node.name; break; } @@ -3294,11 +3337,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 204 && isConst(node); + return node.kind === 205 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 152 || isBindingPattern(node))) { + while (node && (node.kind === 153 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3306,14 +3349,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 198) { + if (node.kind === 199) { node = node.parent; } - if (node && node.kind === 199) { + if (node && node.kind === 200) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 180) { + if (node && node.kind === 181) { flags |= node.flags; } return flags; @@ -3328,11 +3371,11 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 182 && node.expression.kind === 8; + return node.kind === 183 && node.expression.kind === 8; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - if (node.kind === 129 || node.kind === 128) { + if (node.kind === 130 || node.kind === 129) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -3354,23 +3397,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 191: + case 192: return visitor(node); - case 207: - case 179: - case 183: + case 208: + case 180: case 184: case 185: case 186: case 187: case 188: - case 192: + case 189: case 193: - case 220: - case 221: case 194: - case 196: - case 223: + case 221: + case 222: + case 195: + case 197: + case 224: return ts.forEachChild(node, traverse); } } @@ -3379,14 +3422,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 152: - case 226: - case 129: - case 224: - case 132: - case 131: + case 153: + case 227: + case 130: case 225: - case 198: + case 133: + case 132: + case 226: + case 199: return true; } } @@ -3396,8 +3439,8 @@ var ts; function isAccessor(node) { if (node) { switch (node.kind) { - case 136: case 137: + case 138: return true; } } @@ -3407,22 +3450,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 135: - case 162: - case 200: - case 163: - case 134: - case 133: case 136: + case 163: + case 201: + case 164: + case 135: + case 134: case 137: case 138: case 139: case 140: - case 142: + case 141: case 143: - case 162: + case 144: case 163: - case 200: + case 164: + case 201: return true; } } @@ -3430,11 +3473,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 179 && isFunctionLike(node.parent); + return node && node.kind === 180 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 134 && node.parent.kind === 154; + return node && node.kind === 135 && node.parent.kind === 155; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -3453,36 +3496,36 @@ var ts; return undefined; } switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 128: + if (node.parent.parent.kind === 202) { return node; } node = node.parent; break; - case 130: - if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + case 131: + if (node.parent.kind === 130 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 163: + case 164: if (!includeArrowFunctions) { continue; } - case 200: - case 162: - case 205: - case 132: - case 131: - case 134: + case 201: + case 163: + case 206: case 133: + case 132: case 135: + case 134: case 136: case 137: - case 204: - case 227: + case 138: + case 205: + case 228: return node; } } @@ -3494,40 +3537,40 @@ var ts; if (!node) return node; switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 128: + if (node.parent.parent.kind === 202) { return node; } node = node.parent; break; - case 130: - if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + case 131: + if (node.parent.kind === 130 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 200: - case 162: + case 201: case 163: + case 164: if (!includeFunctions) { continue; } - case 132: - case 131: - case 134: case 133: + case 132: case 135: + case 134: case 136: case 137: + case 138: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 159) { + if (node.kind === 160) { return node.tag; } return node.expression; @@ -3535,40 +3578,40 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 201: + case 202: return true; - case 132: - return node.parent.kind === 201; - case 129: - return node.parent.body && node.parent.parent.kind === 201; - case 136: + case 133: + return node.parent.kind === 202; + case 130: + return node.parent.body && node.parent.parent.kind === 202; case 137: - case 134: - return node.body && node.parent.kind === 201; + case 138: + case 135: + return node.body && node.parent.kind === 202; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 201: + case 202: if (node.decorators) { return true; } return false; - case 132: - case 129: + case 133: + case 130: if (node.decorators) { return true; } return false; - case 136: + case 137: if (node.body && node.decorators) { return true; } return false; - case 134: - case 137: + case 135: + case 138: if (node.body && node.decorators) { return true; } @@ -3579,10 +3622,10 @@ var ts; ts.nodeIsDecorated = nodeIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 201: + case 202: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 134: - case 137: + case 135: + case 138: return ts.forEach(node.parameters, nodeIsDecorated); } return false; @@ -3600,7 +3643,6 @@ var ts; case 95: case 80: case 9: - case 153: case 154: case 155: case 156: @@ -3610,69 +3652,70 @@ var ts; case 160: case 161: case 162: - case 174: case 163: - case 166: + case 175: case 164: - case 165: case 167: + case 165: + case 166: case 168: case 169: case 170: - case 173: case 171: + case 174: + case 172: case 10: - case 175: + case 176: return true; - case 126: - while (node.parent.kind === 126) { + case 127: + while (node.parent.kind === 127) { node = node.parent; } - return node.parent.kind === 144; + return node.parent.kind === 145; case 65: - if (node.parent.kind === 144) { + if (node.parent.kind === 145) { return true; } case 7: case 8: var parent_1 = node.parent; switch (parent_1.kind) { - case 198: - case 129: + case 199: + case 130: + case 133: case 132: - case 131: - case 226: - case 224: - case 152: + case 227: + case 225: + case 153: return parent_1.initializer === node; - case 182: case 183: case 184: case 185: - case 191: + case 186: case 192: case 193: - case 220: - case 195: - case 193: + case 194: + case 221: + case 196: + case 194: return parent_1.expression === node; - case 186: - var forStatement = parent_1; - return (forStatement.initializer === node && forStatement.initializer.kind !== 199) || - forStatement.condition === node || - forStatement.iterator === node; case 187: + var forStatement = parent_1; + return (forStatement.initializer === node && forStatement.initializer.kind !== 200) || + forStatement.condition === node || + forStatement.incrementor === node; case 188: + case 189: var forInStatement = parent_1; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 200) || forInStatement.expression === node; - case 160: + case 161: return node === parent_1.expression; - case 176: + case 178: return node === parent_1.expression; - case 127: + case 128: return node === parent_1.expression; - case 130: + case 131: return true; default: if (isExpression(parent_1)) { @@ -3690,7 +3733,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind === 219; + return node.kind === 209 && node.moduleReference.kind === 220; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3699,40 +3742,40 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind !== 219; + return node.kind === 209 && node.moduleReference.kind !== 220; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 209) { + if (node.kind === 210) { return node.moduleSpecifier; } - if (node.kind === 208) { + if (node.kind === 209) { var reference = node.moduleReference; - if (reference.kind === 219) { + if (reference.kind === 220) { return reference.expression; } } - if (node.kind === 215) { + if (node.kind === 216) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 129 && node.dotDotDotToken !== undefined; + return node && node.kind === 130 && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 129: + case 130: return node.questionToken !== undefined; + case 135: case 134: - case 133: return node.questionToken !== undefined; + case 226: case 225: - case 224: + case 133: case 132: - case 131: return node.questionToken !== undefined; } } @@ -3740,7 +3783,7 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function hasRestParameters(s) { - return s.parameters.length > 0 && s.parameters[s.parameters.length - 1].dotDotDotToken !== undefined; + return s.parameters.length > 0 && ts.lastOrUndefined(s.parameters).dotDotDotToken !== undefined; } ts.hasRestParameters = hasRestParameters; function isLiteralKind(kind) { @@ -3756,7 +3799,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 151 || node.kind === 150); + return !!node && (node.kind === 152 || node.kind === 151); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -3771,33 +3814,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 163: - case 152: - case 201: - case 135: - case 204: - case 226: - case 217: - case 200: - case 162: - case 136: - case 210: - case 208: - case 213: + case 164: + case 153: case 202: - case 134: - case 133: + case 136: case 205: - case 211: - case 129: - case 224: - case 132: - case 131: + case 227: + case 218: + case 201: + case 163: case 137: - case 225: + case 211: + case 209: + case 214: case 203: - case 128: - case 198: + case 135: + case 134: + case 206: + case 212: + case 130: + case 225: + case 133: + case 132: + case 138: + case 226: + case 204: + case 129: + case 199: return true; } return false; @@ -3805,25 +3848,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 190: - case 189: - case 197: - case 184: - case 182: - case 181: - case 187: - case 188: - case 186: - case 183: - case 194: case 191: - case 193: - case 94: - case 196: - case 180: + case 190: + case 198: case 185: + case 183: + case 182: + case 188: + case 189: + case 187: + case 184: + case 195: case 192: - case 214: + case 194: + case 94: + case 197: + case 181: + case 186: + case 193: + case 215: return true; default: return false; @@ -3832,13 +3875,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 135: - case 132: - case 134: case 136: - case 137: case 133: - case 140: + case 135: + case 137: + case 138: + case 134: + case 141: return true; default: return false; @@ -3850,7 +3893,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 213 || parent.kind === 217) { + if (parent.kind === 214 || parent.kind === 218) { if (parent.propertyName) { return true; } @@ -3862,12 +3905,12 @@ var ts; } ts.isDeclarationName = isDeclarationName; function isAliasSymbolDeclaration(node) { - return node.kind === 208 || - node.kind === 210 && !!node.name || - node.kind === 211 || - node.kind === 213 || - node.kind === 217 || - node.kind === 214 && node.expression.kind === 65; + return node.kind === 209 || + node.kind === 211 && !!node.name || + node.kind === 212 || + node.kind === 214 || + node.kind === 218 || + node.kind === 215 && node.expression.kind === 65; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -3950,7 +3993,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 66 <= token && token <= 125; + return 66 <= token && token <= 126; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -3959,19 +4002,19 @@ var ts; ts.isTrivia = isTrivia; function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 127 && + declaration.name.kind === 128 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { - return node.kind === 155 && isESSymbolIdentifier(node.expression); + return node.kind === 156 && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { if (name.kind === 65 || name.kind === 8 || name.kind === 7) { return name.text; } - if (name.kind === 127) { + if (name.kind === 128) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -4005,7 +4048,7 @@ var ts; } ts.isModifier = isModifier; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 205 || n.kind === 227; + return isFunctionLike(n) || n.kind === 206 || n.kind === 228; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -4168,7 +4211,7 @@ var ts; var lineStartsOfS = ts.computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); } } } @@ -4229,7 +4272,7 @@ var ts; ts.getLineOfLocalPosition = getLineOfLocalPosition; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 135 && nodeIsPresent(member.body)) { + if (member.kind === 136 && nodeIsPresent(member.body)) { return member; } }); @@ -4237,8 +4280,8 @@ var ts; ts.getFirstConstructorWithBody = getFirstConstructorWithBody; function shouldEmitToOwnFile(sourceFile, compilerOptions) { if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; + if ((isExternalModule(sourceFile) || !compilerOptions.out)) { + return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js"); } return false; } @@ -4252,10 +4295,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 136) { + if (accessor.kind === 137) { getAccessor = accessor; } - else if (accessor.kind === 137) { + else if (accessor.kind === 138) { setAccessor = accessor; } else { @@ -4264,7 +4307,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 136 || member.kind === 137) + if ((member.kind === 137 || member.kind === 138) && (member.flags & 128) === (accessor.flags & 128)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -4275,10 +4318,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 136 && !getAccessor) { + if (member.kind === 137 && !getAccessor) { getAccessor = member; } - if (member.kind === 137 && !setAccessor) { + if (member.kind === 138 && !setAccessor) { setAccessor = member; } } @@ -4399,22 +4442,22 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 155: case 156: - case 158: case 157: case 159: - case 153: - case 161: + case 158: + case 160: case 154: - case 174: case 162: + case 155: + case 175: + case 163: case 65: case 9: case 7: case 8: case 10: - case 171: + case 172: case 80: case 89: case 93: @@ -4430,30 +4473,84 @@ var ts; return token >= 53 && token <= 64; } ts.isAssignmentOperator = isAssignmentOperator; - function isSupportedHeritageClauseElement(node) { - return isSupportedHeritageClauseElementExpression(node.expression); + function isSupportedExpressionWithTypeArguments(node) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } - ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; - function isSupportedHeritageClauseElementExpression(node) { + ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; + function isSupportedExpressionWithTypeArgumentsRest(node) { if (node.kind === 65) { return true; } - else if (node.kind === 155) { - return isSupportedHeritageClauseElementExpression(node.expression); + else if (node.kind === 156) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } else { return false; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 126 && node.parent.right === node) || - (node.parent.kind === 155 && node.parent.name === node); + return (node.parent.kind === 127 && node.parent.right === node) || + (node.parent.kind === 156 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function getLocalSymbolForExportDefault(symbol) { return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function getExpandedCharCodes(input) { + var output = []; + var length = input.length; + var leadSurrogate = undefined; + for (var i = 0; i < length; i++) { + var charCode = input.charCodeAt(i); + if (charCode < 0x80) { + output.push(charCode); + } + else if (charCode < 0x800) { + output.push((charCode >> 6) | 192); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x10000) { + output.push((charCode >> 12) | 224); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x20000) { + output.push((charCode >> 18) | 240); + output.push(((charCode >> 12) & 63) | 128); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else { + ts.Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + function convertToBase64(input) { + var result = ""; + var charCodes = getExpandedCharCodes(input); + var i = 0; + var length = charCodes.length; + var byte1, byte2, byte3, byte4; + while (i < length) { + byte1 = charCodes[i] >> 2; + byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; + byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; + byte4 = charCodes[i + 2] & 63; + if (i + 1 >= length) { + byte3 = byte4 = 64; + } + else if (i + 2 >= length) { + byte4 = 64; + } + result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i += 3; + } + return result; + } + ts.convertToBase64 = convertToBase64; })(ts || (ts = {})); var ts; (function (ts) { @@ -4575,7 +4672,7 @@ var ts; /// var ts; (function (ts) { - var nodeConstructors = new Array(229); + var nodeConstructors = new Array(230); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4613,20 +4710,20 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 126: + case 127: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 128: + case 129: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 129: + case 130: + case 133: case 132: - case 131: - case 224: case 225: - case 198: - case 152: + case 226: + case 199: + case 153: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -4635,24 +4732,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 142: case 143: - case 138: + case 144: case 139: case 140: + case 141: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 134: - case 133: case 135: + case 134: case 136: case 137: - case 162: - case 200: + case 138: case 163: + case 201: + case 164: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -4663,151 +4760,144 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 141: + case 142: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 144: - return visitNode(cbNode, node.exprName); case 145: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 146: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 147: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 148: - return visitNodes(cbNodes, node.types); + return visitNodes(cbNodes, node.elementTypes); case 149: - return visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.types); case 150: + return visitNode(cbNode, node.type); case 151: - return visitNodes(cbNodes, node.elements); - case 153: + case 152: return visitNodes(cbNodes, node.elements); case 154: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 155: + return visitNodes(cbNodes, node.properties); + case 156: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 156: + case 157: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 157: case 158: + case 159: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 159: + case 160: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 160: + case 161: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 161: - return visitNode(cbNode, node.expression); - case 164: + case 162: return visitNode(cbNode, node.expression); case 165: return visitNode(cbNode, node.expression); case 166: return visitNode(cbNode, node.expression); case 167: - return visitNode(cbNode, node.operand); - case 172: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.expression); case 168: return visitNode(cbNode, node.operand); + case 173: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); case 169: + return visitNode(cbNode, node.operand); + case 170: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 170: + case 171: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 173: + case 174: return visitNode(cbNode, node.expression); - case 179: - case 206: + case 180: + case 207: return visitNodes(cbNodes, node.statements); - case 227: + case 228: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 180: + case 181: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 199: + case 200: return visitNodes(cbNodes, node.declarations); - case 182: - return visitNode(cbNode, node.expression); case 183: + return visitNode(cbNode, node.expression); + case 184: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 184: + case 185: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 185: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 186: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 187: return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || + visitNode(cbNode, node.condition) || + visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); case 188: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 189: - case 190: - return visitNode(cbNode, node.label); - case 191: - return visitNode(cbNode, node.expression); - case 192: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 190: + case 191: + return visitNode(cbNode, node.label); + case 192: + return visitNode(cbNode, node.expression); case 193: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 194: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 207: + case 208: return visitNodes(cbNodes, node.clauses); - case 220: + case 221: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 221: + case 222: return visitNodes(cbNodes, node.statements); - case 194: + case 195: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 195: - return visitNode(cbNode, node.expression); case 196: + return visitNode(cbNode, node.expression); + case 197: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 223: + case 224: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 130: + case 131: return visitNode(cbNode, node.expression); - case 201: - case 174: - 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 202: + case 175: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -4818,65 +4908,72 @@ var ts; return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.typeParameters) || + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 204: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 226: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + visitNode(cbNode, node.type); case 205: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 227: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 206: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 208: + case 209: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 209: + case 210: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 210: + case 211: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 211: - return visitNode(cbNode, node.name); case 212: - case 216: + return visitNode(cbNode, node.name); + case 213: + case 217: return visitNodes(cbNodes, node.elements); - case 215: + case 216: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 213: - case 217: + case 214: + case 218: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 214: + case 215: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 171: + case 172: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 176: + case 178: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 127: + case 128: return visitNode(cbNode, node.expression); - case 222: + case 223: return visitNodes(cbNodes, node.types); case 177: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 219: + case 220: return visitNode(cbNode, node.expression); - case 218: + case 219: return visitNodes(cbNodes, node.decorators); } } @@ -4962,7 +5059,7 @@ var ts; } } function createSourceFile(fileName, languageVersion) { - sourceFile = createNode(227, 0); + sourceFile = createNode(228, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -5255,7 +5352,7 @@ var ts; return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(127); + var node = createNode(128); parseExpected(18); var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { @@ -5549,14 +5646,14 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { + case 210: case 209: - case 208: + case 216: case 215: - case 214: - case 201: case 202: + case 203: + case 206: case 205: - case 204: return true; } return isReusableStatement(node); @@ -5566,13 +5663,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 135: - case 140: - case 134: case 136: + case 141: + case 135: case 137: - case 132: - case 178: + case 138: + case 133: + case 179: return true; } } @@ -5581,8 +5678,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 220: case 221: + case 222: return true; } } @@ -5591,56 +5688,56 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 200: + case 201: + case 181: case 180: - case 179: + case 184: case 183: - case 182: - case 195: + case 196: + case 192: + case 194: case 191: - case 193: case 190: + case 188: case 189: case 187: - case 188: case 186: - case 185: - case 192: - case 181: - case 196: - case 194: - case 184: + case 193: + case 182: case 197: + case 195: + case 185: + case 198: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 226; + return node.kind === 227; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 139: - case 133: case 140: - case 131: - case 138: + case 134: + case 141: + case 132: + case 139: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 198) { + if (node.kind !== 199) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 129) { + if (node.kind !== 130) { return false; } var parameter = node; @@ -5735,7 +5832,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20)) { - var node = createNode(126, entity.pos); + var node = createNode(127, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -5752,20 +5849,20 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(171); + var template = createNode(172); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); do { templateSpans.push(parseTemplateSpan()); - } while (templateSpans[templateSpans.length - 1].literal.kind === 12); + } while (ts.lastOrUndefined(templateSpans).literal.kind === 12); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(176); + var span = createNode(178); span.expression = allowInAnd(parseExpression); var literal; if (token === 15) { @@ -5799,7 +5896,7 @@ var ts; return node; } function parseTypeReference() { - var node = createNode(141); + var node = createNode(142); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24) { node.typeArguments = parseBracketedList(17, parseType, 24, 25); @@ -5807,13 +5904,13 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(144); + var node = createNode(145); parseExpected(97); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(128); + var node = createNode(129); node.name = parseIdentifier(); if (parseOptional(79)) { if (isStartOfType() || !isStartOfExpression()) { @@ -5848,7 +5945,7 @@ var ts; } } function parseParameter() { - var node = createNode(129); + var node = createNode(130); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21); @@ -5900,7 +5997,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 139) { + if (kind === 140) { parseExpected(88); } fillSignature(51, false, false, node); @@ -5940,7 +6037,7 @@ var ts; return token === 51 || token === 23 || token === 19; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(140, fullStart); + var node = createNode(141, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15, parseParameter, 18, 19); @@ -5953,7 +6050,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { - var method = createNode(133, fullStart); + var method = createNode(134, fullStart); method.name = name; method.questionToken = questionToken; fillSignature(51, false, false, method); @@ -5961,7 +6058,7 @@ var ts; return finishNode(method); } else { - var property = createNode(131, fullStart); + var property = createNode(132, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -6003,14 +6100,14 @@ var ts; switch (token) { case 16: case 24: - return parseSignatureMember(138); + return parseSignatureMember(139); case 18: return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); case 88: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(139); + return parseSignatureMember(140); } case 8: case 7: @@ -6040,7 +6137,7 @@ var ts; return token === 16 || token === 24; } function parseTypeLiteral() { - var node = createNode(145); + var node = createNode(146); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -6056,12 +6153,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(147); + var node = createNode(148); node.elementTypes = parseBracketedList(18, parseType, 18, 19); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(149); + var node = createNode(150); parseExpected(16); node.type = parseType(); parseExpected(17); @@ -6069,7 +6166,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 143) { + if (kind === 144) { parseExpected(88); } fillSignature(32, false, false, node); @@ -6082,10 +6179,10 @@ var ts; function parseNonArrayType() { switch (token) { case 112: - case 121: - case 119: - case 113: case 122: + case 120: + case 113: + case 123: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); case 99: @@ -6105,10 +6202,10 @@ var ts; function isStartOfType() { switch (token) { case 112: - case 121: - case 119: - case 113: case 122: + case 120: + case 113: + case 123: case 99: case 97: case 14: @@ -6130,7 +6227,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { parseExpected(19); - var node = createNode(146, type.pos); + var node = createNode(147, type.pos); node.elementType = type; type = finishNode(node); } @@ -6145,7 +6242,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(148, type.pos); + var node = createNode(149, type.pos); node.types = types; type = finishNode(node); } @@ -6190,10 +6287,10 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(142); + return parseFunctionOrConstructorType(143); } if (token === 88) { - return parseFunctionOrConstructorType(143); + return parseFunctionOrConstructorType(144); } return parseUnionTypeOrHigher(); } @@ -6331,7 +6428,7 @@ var ts; (isIdentifier() || token === 14 || token === 18); } function parseYieldExpression() { - var node = createNode(172); + var node = createNode(173); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { @@ -6345,8 +6442,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(163, identifier.pos); - var parameter = createNode(129, identifier.pos); + var node = createNode(164, identifier.pos); + var parameter = createNode(130, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -6424,7 +6521,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(163); + var node = createNode(164); fillSignature(51, false, !allowAmbiguity, node); if (!node.parameters) { return undefined; @@ -6451,7 +6548,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(170, leftOperand.pos); + var node = createNode(171, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -6464,7 +6561,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 86 || t === 125; + return t === 86 || t === 126; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -6525,37 +6622,37 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(169, left.pos); + var node = createNode(170, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(167); + var node = createNode(168); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(164); - nextToken(); - node.expression = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(165); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(166); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(167); + nextToken(); + node.expression = parseUnaryExpressionOrHigher(); + return finishNode(node); + } function parseUnaryExpressionOrHigher() { switch (token) { case 33: @@ -6581,7 +6678,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(168, expression.pos); + var node = createNode(169, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -6604,14 +6701,14 @@ var ts; if (token === 16 || token === 20) { return expression; } - var node = createNode(155, expression.pos); + var node = createNode(156, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(20, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } function parseTypeAssertion() { - var node = createNode(160); + var node = createNode(161); parseExpected(24); node.type = parseType(); parseExpected(25); @@ -6622,7 +6719,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(20); if (dotToken) { - var propertyAccess = createNode(155, expression.pos); + var propertyAccess = createNode(156, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -6630,7 +6727,7 @@ var ts; continue; } if (!inDecoratorContext() && parseOptional(18)) { - var indexedAccess = createNode(156, expression.pos); + var indexedAccess = createNode(157, expression.pos); indexedAccess.expression = expression; if (token !== 19) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -6644,7 +6741,7 @@ var ts; continue; } if (token === 10 || token === 11) { - var tagExpression = createNode(159, expression.pos); + var tagExpression = createNode(160, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 ? parseLiteralNode() @@ -6663,7 +6760,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(157, expression.pos); + var callExpr = createNode(158, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -6671,7 +6768,7 @@ var ts; continue; } else if (token === 16) { - var callExpr = createNode(157, expression.pos); + var callExpr = createNode(158, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -6761,28 +6858,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(161); + var node = createNode(162); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); return finishNode(node); } function parseSpreadElement() { - var node = createNode(173); + var node = createNode(174); parseExpected(21); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(175) : + token === 23 ? createNode(176) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(153); + var node = createNode(154); parseExpected(18); if (scanner.hasPrecedingLineBreak()) node.flags |= 512; @@ -6792,11 +6889,11 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(116)) { - return parseAccessorDeclaration(136, fullStart, decorators, modifiers); - } - else if (parseContextualModifier(120)) { return parseAccessorDeclaration(137, fullStart, decorators, modifiers); } + else if (parseContextualModifier(121)) { + return parseAccessorDeclaration(138, fullStart, decorators, modifiers); + } return undefined; } function parseObjectLiteralElement() { @@ -6816,13 +6913,13 @@ var ts; return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(225, fullStart); + var shorthandDeclaration = createNode(226, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(224, fullStart); + var propertyAssignment = createNode(225, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6831,7 +6928,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(154); + var node = createNode(155); parseExpected(14); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512; @@ -6845,7 +6942,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(162); + var node = createNode(163); parseExpected(83); node.asteriskToken = parseOptionalToken(35); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); @@ -6860,7 +6957,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(158); + var node = createNode(159); parseExpected(88); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -6870,7 +6967,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(179); + var node = createNode(180); if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2, checkForStrictMode, parseStatement); parseExpected(15); @@ -6895,12 +6992,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(181); + var node = createNode(182); parseExpected(22); return finishNode(node); } function parseIfStatement() { - var node = createNode(183); + var node = createNode(184); parseExpected(84); parseExpected(16); node.expression = allowInAnd(parseExpression); @@ -6910,7 +7007,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(184); + var node = createNode(185); parseExpected(75); node.statement = parseStatement(); parseExpected(100); @@ -6921,7 +7018,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(185); + var node = createNode(186); parseExpected(100); parseExpected(16); node.expression = allowInAnd(parseExpression); @@ -6944,21 +7041,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(86)) { - var forInStatement = createNode(187, pos); + var forInStatement = createNode(188, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(125)) { - var forOfStatement = createNode(188, pos); + else if (parseOptional(126)) { + var forOfStatement = createNode(189, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(186, pos); + var forStatement = createNode(187, pos); forStatement.initializer = initializer; parseExpected(22); if (token !== 22 && token !== 17) { @@ -6966,7 +7063,7 @@ var ts; } parseExpected(22); if (token !== 17) { - forStatement.iterator = allowInAnd(parseExpression); + forStatement.incrementor = allowInAnd(parseExpression); } parseExpected(17); forOrForInOrForOfStatement = forStatement; @@ -6976,7 +7073,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 190 ? 66 : 71); + parseExpected(kind === 191 ? 66 : 71); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -6984,7 +7081,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(191); + var node = createNode(192); parseExpected(90); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -6993,7 +7090,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(192); + var node = createNode(193); parseExpected(101); parseExpected(16); node.expression = allowInAnd(parseExpression); @@ -7002,7 +7099,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(220); + var node = createNode(221); parseExpected(67); node.expression = allowInAnd(parseExpression); parseExpected(51); @@ -7010,7 +7107,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(221); + var node = createNode(222); parseExpected(73); parseExpected(51); node.statements = parseList(4, false, parseStatement); @@ -7020,12 +7117,12 @@ var ts; return token === 67 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(193); + var node = createNode(194); parseExpected(92); parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); - var caseBlock = createNode(207, scanner.getStartPos()); + var caseBlock = createNode(208, scanner.getStartPos()); parseExpected(14); caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); @@ -7035,14 +7132,14 @@ var ts; function parseThrowStatement() { // ThrowStatement[Yield] : // throw [no LineTerminator here]Expression[In, ?Yield]; - var node = createNode(195); + var node = createNode(196); parseExpected(94); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(196); + var node = createNode(197); parseExpected(96); node.tryBlock = parseBlock(false, false); node.catchClause = token === 68 ? parseCatchClause() : undefined; @@ -7053,7 +7150,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(223); + var result = createNode(224); parseExpected(68); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); @@ -7063,7 +7160,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(197); + var node = createNode(198); parseExpected(72); parseSemicolon(); return finishNode(node); @@ -7072,13 +7169,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 65 && parseOptional(51)) { - var labeledStatement = createNode(194, fullStart); + var labeledStatement = createNode(195, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(182, fullStart); + var expressionStatement = createNode(183, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -7119,8 +7216,9 @@ var ts; return !isConstEnum; case 103: case 117: + case 118: case 77: - case 123: + case 124: if (isDeclarationStart()) { return false; } @@ -7165,9 +7263,9 @@ var ts; case 82: return parseForOrForInOrForOfStatement(); case 71: - return parseBreakOrContinueStatement(189); - case 66: return parseBreakOrContinueStatement(190); + case 66: + return parseBreakOrContinueStatement(191); case 90: return parseReturnStatement(); case 101: @@ -7230,16 +7328,16 @@ var ts; } function parseArrayBindingElement() { if (token === 23) { - return createNode(175); + return createNode(176); } - var node = createNode(152); + var node = createNode(153); node.dotDotDotToken = parseOptionalToken(21); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(152); + var node = createNode(153); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 51) { @@ -7254,14 +7352,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(150); + var node = createNode(151); parseExpected(14); node.elements = parseDelimitedList(10, parseObjectBindingElement); parseExpected(15); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(151); + var node = createNode(152); parseExpected(18); node.elements = parseDelimitedList(11, parseArrayBindingElement); parseExpected(19); @@ -7280,7 +7378,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(198); + var node = createNode(199); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -7289,7 +7387,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(199); + var node = createNode(200); switch (token) { case 98: break; @@ -7303,7 +7401,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 126 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -7318,7 +7416,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 17; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(180, fullStart); + var node = createNode(181, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -7326,7 +7424,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(200, fullStart); + var node = createNode(201, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(83); @@ -7337,7 +7435,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(135, pos); + var node = createNode(136, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(114); @@ -7346,7 +7444,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(134, fullStart); + var method = createNode(135, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -7357,7 +7455,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(132, fullStart); + var property = createNode(133, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -7424,7 +7522,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { + if (!ts.isKeyword(idToken) || idToken === 121 || idToken === 116) { return true; } switch (token) { @@ -7451,7 +7549,7 @@ var ts; decorators = []; decorators.pos = scanner.getStartPos(); } - var decorator = createNode(130, decoratorStart); + var decorator = createNode(131, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -7484,7 +7582,7 @@ var ts; } function parseClassElement() { if (token === 22) { - var result = createNode(178); + var result = createNode(179); nextToken(); return finishNode(result); } @@ -7515,10 +7613,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 175); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 202); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var savedStrictModeContext = inStrictModeContext(); @@ -7559,15 +7657,15 @@ var ts; } function parseHeritageClause() { if (token === 79 || token === 102) { - var node = createNode(222); + var node = createNode(223); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseHeritageClauseElement); + node.types = parseDelimitedList(8, parseExpressionWithTypeArguments); return finishNode(node); } return undefined; } - function parseHeritageClauseElement() { + function parseExpressionWithTypeArguments() { var node = createNode(177); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 24) { @@ -7582,7 +7680,7 @@ var ts; return parseList(6, false, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(202, fullStart); + var node = createNode(203, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(103); @@ -7593,10 +7691,10 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203, fullStart); + var node = createNode(204, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(123); + parseExpected(124); node.name = parseIdentifier(); parseExpected(53); node.type = parseType(); @@ -7604,13 +7702,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(226, scanner.getStartPos()); + var node = createNode(227, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(204, fullStart); + var node = createNode(205, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(77); @@ -7625,7 +7723,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(206, scanner.getStartPos()); + var node = createNode(207, scanner.getStartPos()); if (parseExpected(14)) { node.statements = parseList(1, false, parseModuleElement); parseExpected(15); @@ -7635,19 +7733,19 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { - var node = createNode(205, fullStart); + function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { + var node = createNode(206, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) + ? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 1) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(206, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -7655,13 +7753,20 @@ var ts; return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { - parseExpected(117); - return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) - : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); + var flags = modifiers ? modifiers.flags : 0; + if (parseOptional(118)) { + flags |= 32768; + } + else { + parseExpected(117); + if (token === 8) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + } + return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); } function isExternalModuleReference() { - return token === 118 && + return token === 119 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -7670,7 +7775,7 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 || - token === 124; + token === 125; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(85); @@ -7678,8 +7783,8 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 124) { - var importEqualsDeclaration = createNode(208, fullStart); + if (token !== 23 && token !== 125) { + var importEqualsDeclaration = createNode(209, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -7689,14 +7794,14 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(209, fullStart); + var importDeclaration = createNode(210, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(124); + parseExpected(125); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -7709,13 +7814,13 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(210, fullStart); + var importClause = createNode(211, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(213); } return finishNode(importClause); } @@ -7725,8 +7830,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(219); - parseExpected(118); + var node = createNode(220); + parseExpected(119); parseExpected(16); node.expression = parseModuleSpecifier(); parseExpected(17); @@ -7740,7 +7845,7 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(211); + var namespaceImport = createNode(212); parseExpected(35); parseExpected(111); namespaceImport.name = parseIdentifier(); @@ -7748,14 +7853,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 213 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(217); + return parseImportOrExportSpecifier(218); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(213); + return parseImportOrExportSpecifier(214); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -7774,22 +7879,22 @@ var ts; else { node.name = identifierName; } - if (kind === 213 && checkIdentifierIsKeyword) { + if (kind === 214 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(216, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35)) { - parseExpected(124); + parseExpected(125); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(216); - if (parseOptional(124)) { + node.exportClause = parseNamedImportsOrExports(217); + if (parseOptional(125)) { node.moduleSpecifier = parseModuleSpecifier(); } } @@ -7797,7 +7902,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(214, fullStart); + var node = createNode(215, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(53)) { @@ -7824,11 +7929,12 @@ var ts; case 69: case 103: case 77: - case 123: + case 124: return lookAhead(nextTokenIsIdentifierOrKeyword); case 85: return lookAhead(nextTokenCanFollowImportKeyword); case 117: + case 118: return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); case 78: return lookAhead(nextTokenCanFollowExportKeyword); @@ -7894,17 +8000,18 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 103: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 123: + case 124: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 77: return parseEnumDeclaration(fullStart, decorators, modifiers); case 117: + case 118: return parseModuleDeclaration(fullStart, decorators, modifiers); case 85: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: if (decorators) { - var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(219, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -7984,10 +8091,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 - || node.kind === 208 && node.moduleReference.kind === 219 - || node.kind === 209 - || node.kind === 214 + || node.kind === 209 && node.moduleReference.kind === 220 + || node.kind === 210 || node.kind === 215 + || node.kind === 216 ? node : undefined; }); @@ -8274,16 +8381,16 @@ var ts; (function (ts) { ts.bindTime = 0; function getModuleInstanceState(node) { - if (node.kind === 202 || node.kind === 203) { + if (node.kind === 203 || node.kind === 204) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { + else if ((node.kind === 210 || node.kind === 209) && !(node.flags & 1)) { return 0; } - else if (node.kind === 206) { + else if (node.kind === 207) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -8299,7 +8406,7 @@ var ts; }); return state; } - else if (node.kind === 205) { + else if (node.kind === 206) { return getModuleInstanceState(node.body); } else { @@ -8352,10 +8459,10 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 205 && node.name.kind === 8) { + if (node.kind === 206 && node.name.kind === 8) { return '"' + node.name.text + '"'; } - if (node.name.kind === 127) { + if (node.name.kind === 128) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -8363,22 +8470,22 @@ var ts; return node.name.text; } switch (node.kind) { - case 143: - case 135: + case 144: + case 136: return "__constructor"; - case 142: - case 138: - return "__call"; + case 143: case 139: - return "__new"; + return "__call"; case 140: + return "__new"; + case 141: return "__index"; - case 215: + case 216: return "__export"; - case 214: + case 215: return node.isExportEquals ? "export=" : "default"; - case 200: case 201: + case 202: return node.flags & 256 ? "default" : undefined; } } @@ -8410,7 +8517,7 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if ((node.kind === 201 || node.kind === 174) && symbol.exports) { + if ((node.kind === 202 || node.kind === 175) && symbol.exports) { var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { @@ -8426,7 +8533,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + if (node.kind === 218 || (node.kind === 209 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -8434,7 +8541,7 @@ var ts; } } else { - if (hasExportModifier || container.flags & 32768) { + if (hasExportModifier || container.flags & 65536) { var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); @@ -8457,56 +8564,59 @@ var ts; parent = node; if (symbolKind & 262128) { container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; + addToContainerChain(container); } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 228); } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } + function addToContainerChain(node) { + if (lastContainer) { + lastContainer.nextContainer = node; + } + lastContainer = node; + } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 205: + case 206: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 228: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 142: case 143: - case 138: + case 144: case 139: case 140: - case 134: - case 133: + case 141: case 135: + case 134: case 136: case 137: - case 200: - case 162: + case 138: + case 201: case 163: + case 164: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 174: - case 201: + case 175: + case 202: if (node.flags & 128) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 145: - case 154: - case 202: + case 146: + case 155: + case 203: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 204: + case 205: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -8521,11 +8631,11 @@ var ts; return false; } function hasExportDeclarations(node) { - var body = node.kind === 227 ? node : node.body; - if (body.kind === 227 || body.kind === 206) { + var body = node.kind === 228 ? node : node.body; + if (body.kind === 228 || body.kind === 207) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 215 || stat.kind === 214) { + if (stat.kind === 216 || stat.kind === 215) { return true; } } @@ -8534,10 +8644,10 @@ var ts; } function setExportContextFlag(node) { if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 32768; + node.flags |= 65536; } else { - node.flags &= ~32768; + node.flags &= ~65536; } } function bindModuleDeclaration(node) { @@ -8575,7 +8685,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 143 ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -8587,10 +8697,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { - case 205: + case 206: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 228: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -8598,6 +8708,7 @@ var ts; default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); } declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } @@ -8612,14 +8723,14 @@ var ts; function bind(node) { node.parent = parent; switch (node.kind) { - case 128: + case 129: bindDeclaration(node, 262144, 530912, false); break; - case 129: + case 130: bindParameter(node); break; - case 198: - case 152: + case 199: + case 153: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -8630,68 +8741,68 @@ var ts; bindDeclaration(node, 1, 107454, false); } break; + case 133: case 132: - case 131: bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 224: case 225: + case 226: bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 226: + case 227: bindPropertyOrMethodOrAccessor(node, 8, 107455, false); break; - case 138: case 139: case 140: + case 141: bindDeclaration(node, 131072, 0, false); break; + case 135: case 134: - case 133: bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); break; - case 200: + case 201: bindDeclaration(node, 16, 106927, true); break; - case 135: + case 136: bindDeclaration(node, 16384, 0, true); break; - case 136: + case 137: bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); break; - case 137: + case 138: bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); break; - case 142: case 143: + case 144: bindFunctionOrConstructorType(node); break; - case 145: + case 146: bindAnonymousDeclaration(node, 2048, "__type", false); break; - case 154: + case 155: bindAnonymousDeclaration(node, 4096, "__object", false); break; - case 162: case 163: + case 164: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 174: + case 175: bindAnonymousDeclaration(node, 32, "__class", false); break; - case 223: + case 224: bindCatchVariableDeclaration(node); break; - case 201: + case 202: bindBlockScopedDeclaration(node, 32, 899583); break; - case 202: + case 203: bindDeclaration(node, 64, 792992, false); break; - case 203: + case 204: bindDeclaration(node, 524288, 793056, false); break; - case 204: + case 205: if (ts.isConst(node)) { bindDeclaration(node, 128, 899967, false); } @@ -8699,16 +8810,16 @@ var ts; bindDeclaration(node, 256, 899327, false); } break; - case 205: + case 206: bindModuleDeclaration(node); break; - case 208: - case 211: - case 213: - case 217: + case 209: + case 212: + case 214: + case 218: bindDeclaration(node, 8388608, 8388608, false); break; - case 210: + case 211: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -8716,13 +8827,13 @@ var ts; bindChildren(node, 0, false); } break; - case 215: + case 216: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 214: + case 215: if (node.expression.kind === 65) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); } @@ -8731,20 +8842,20 @@ var ts; } bindChildren(node, 0, false); break; - case 227: + case 228: setExportContextFlag(node); if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 179: + case 180: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 223: - case 186: + case 224: case 187: case 188: - case 207: + case 189: + case 208: bindChildren(node, 0, true); break; default: @@ -8762,8 +8873,8 @@ var ts; bindDeclaration(node, 1, 107455, false); } if (node.flags & 112 && - node.parent.kind === 135 && - (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + node.parent.kind === 136 && + (node.parent.parent.kind === 202 || node.parent.parent.kind === 175)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -8857,7 +8968,6 @@ var ts; var undefinedType = createIntrinsicType(32 | 262144, "undefined"); var nullType = createIntrinsicType(64 | 262144, "null"); var unknownType = createIntrinsicType(1, "unknown"); - var resolvingType = createIntrinsicType(1, "__resolving__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -8887,6 +8997,8 @@ var ts; var emitExtends = false; var emitDecorate = false; var emitParam = false; + var resolutionTargets = []; + var resolutionResults = []; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -9049,10 +9161,10 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 227); + return ts.getAncestor(node, 228); } function isGlobalSourceFile(node) { - return node.kind === 227 && !ts.isExternalModule(node); + return node.kind === 228 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -9094,34 +9206,34 @@ var ts; } } switch (location.kind) { - case 227: + case 228: if (!ts.isExternalModule(location)) break; - case 205: + case 206: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 218)) { break loop; } result = undefined; } - else if (location.kind === 227 || - (location.kind === 205 && location.name.kind === 8)) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + else if (location.kind === 228 || + (location.kind === 206 && location.name.kind === 8)) { + result = getSymbolOfNode(location).exports["default"]; var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { + if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } break; - case 204: + case 205: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 133: case 132: - case 131: - if (location.parent.kind === 201 && !(location.flags & 128)) { + if (location.parent.kind === 202 && !(location.flags & 128)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455)) { @@ -9130,8 +9242,8 @@ var ts; } } break; - case 201: case 202: + case 203: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { if (lastLocation && lastLocation.flags & 128) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -9140,28 +9252,28 @@ var ts; break loop; } break; - case 127: + case 128: grandparent = location.parent.parent; - if (grandparent.kind === 201 || grandparent.kind === 202) { + if (grandparent.kind === 202 || grandparent.kind === 203) { 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 134: - case 133: case 135: + case 134: case 136: case 137: - case 200: - case 163: + case 138: + case 201: + case 164: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 162: + case 163: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9172,15 +9284,15 @@ var ts; break loop; } break; - case 174: + case 175: var className = location.name; if (className && name === className.text) { result = location.symbol; break loop; } break; - case 130: - if (location.parent && location.parent.kind === 129) { + case 131: + if (location.parent && location.parent.kind === 130) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -9218,14 +9330,14 @@ var ts; ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); if (!isUsedBeforeDeclaration) { - var variableDeclaration = ts.getAncestor(declaration, 198); + var variableDeclaration = ts.getAncestor(declaration, 199); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 180 || - variableDeclaration.parent.parent.kind === 186) { + if (variableDeclaration.parent.parent.kind === 181 || + variableDeclaration.parent.parent.kind === 187) { isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 188 || - variableDeclaration.parent.parent.kind === 187) { + else if (variableDeclaration.parent.parent.kind === 189 || + variableDeclaration.parent.parent.kind === 188) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -9247,10 +9359,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } - while (node && node.kind !== 209) { + while (node && node.kind !== 210) { node = node.parent; } return node; @@ -9260,7 +9372,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 219) { + if (node.moduleReference.kind === 220) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -9270,7 +9382,7 @@ var ts; if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); if (!exportDefaultSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); + error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } return exportDefaultSymbol; } @@ -9349,17 +9461,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 208: + case 209: return getTargetOfImportEqualsDeclaration(node); - case 210: - return getTargetOfImportClause(node); case 211: + return getTargetOfImportClause(node); + case 212: return getTargetOfNamespaceImport(node); - case 213: - return getTargetOfImportSpecifier(node); - case 217: - return getTargetOfExportSpecifier(node); case 214: + return getTargetOfImportSpecifier(node); + case 218: + return getTargetOfExportSpecifier(node); + case 215: return getTargetOfExportAssignment(node); } } @@ -9401,10 +9513,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214) { + if (node.kind === 215) { checkExpressionCached(node.expression); } - else if (node.kind === 217) { + else if (node.kind === 218) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -9414,17 +9526,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 208); + importDeclaration = ts.getAncestor(entityName, 209); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 65 || entityName.parent.kind === 126) { + if (entityName.kind === 65 || entityName.parent.kind === 127) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 208); + ts.Debug.assert(entityName.parent.kind === 209); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -9437,14 +9549,15 @@ var ts; } var symbol; if (name.kind === 65) { - symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + var message = meaning === 1536 ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; + symbol = resolveName(name, name.text, meaning, message, name); if (!symbol) { return undefined; } } - else if (name.kind === 126 || name.kind === 155) { - var left = name.kind === 126 ? name.left : name.expression; - var right = name.kind === 126 ? name.right : name.name; + else if (name.kind === 127 || name.kind === 156) { + var left = name.kind === 127 ? name.left : name.expression; + var right = name.kind === 127 ? name.right : name.name; var namespace = resolveEntityName(left, 1536); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -9497,10 +9610,10 @@ var ts; if (sourceFile.symbol) { return sourceFile.symbol; } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.fileName); + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); return; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); + error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); } function resolveExternalModuleSymbol(moduleSymbol) { return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; @@ -9508,7 +9621,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { var symbol = resolveExternalModuleSymbol(moduleSymbol); if (symbol && !(symbol.flags & (1536 | 3))) { - error(moduleReferenceExpression, ts.Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; @@ -9588,7 +9701,7 @@ var ts; var members = node.members; for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 135 && ts.nodeIsPresent(member.body)) { + if (member.kind === 136 && ts.nodeIsPresent(member.body)) { return member; } } @@ -9653,17 +9766,17 @@ var ts; } } switch (location_1.kind) { - case 227: + case 228: if (!ts.isExternalModule(location_1)) { break; } - case 205: + case 206: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 201: case 202: + case 203: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -9778,8 +9891,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 205 && declaration.name.kind === 8) || - (declaration.kind === 227 && ts.isExternalModule(declaration)); + return (declaration.kind === 206 && declaration.name.kind === 8) || + (declaration.kind === 228 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9811,11 +9924,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 144) { + if (entityName.parent.kind === 145) { meaning = 107455 | 1048576; } - else if (entityName.kind === 126 || entityName.kind === 155 || - entityName.parent.kind === 208) { + else if (entityName.kind === 127 || entityName.kind === 156 || + entityName.parent.kind === 209) { meaning = 1536; } else { @@ -9859,10 +9972,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 149) { + while (node.kind === 150) { node = node.parent; } - if (node.kind === 203) { + if (node.kind === 204) { return getSymbolOfNode(node); } } @@ -10034,7 +10147,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 227 || declaration.parent.kind === 206; + return declaration.parent.kind === 228 || declaration.parent.kind === 207; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -10109,7 +10222,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 121); + writeKeyword(writer, 122); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -10122,7 +10235,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); writePunctuation(writer, 51); writeSpace(writer); - writeKeyword(writer, 119); + writeKeyword(writer, 120); writePunctuation(writer, 19); writePunctuation(writer, 51); writeSpace(writer); @@ -10266,12 +10379,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 205) { + if (node.kind === 206) { if (node.name.kind === 8) { return node; } } - else if (node.kind === 227) { + else if (node.kind === 228) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10314,59 +10427,59 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 152: + case 153: return isDeclarationVisible(node.parent.parent); - case 198: + case 199: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 205: - case 201: + case 206: case 202: case 203: - case 200: case 204: - case 208: + case 201: + case 205: + case 209: var parent_2 = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + !(node.kind !== 209 && parent_2.kind !== 228 && ts.isInAmbientContext(parent_2))) { return isGlobalSourceFile(parent_2); } return isDeclarationVisible(parent_2); - case 132: - case 131: - case 136: - case 137: - case 134: case 133: + case 132: + case 137: + case 138: + case 135: + case 134: if (node.flags & (32 | 64)) { return false; } - case 135: - case 139: - case 138: + case 136: case 140: - case 129: - case 206: - case 142: - case 143: - case 145: + case 139: case 141: + case 130: + case 207: + case 143: + case 144: case 146: + case 142: case 147: case 148: case 149: + case 150: return isDeclarationVisible(node.parent); - case 210: case 211: - case 213: - return false; - case 128: - case 227: - return true; + case 212: case 214: return false; + case 129: + case 228: + return true; + case 215: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -10381,10 +10494,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 214) { + if (node.parent && node.parent.kind === 215) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 218) { exportSymbol = getTargetOfExportSpecifier(node.parent); } var result = []; @@ -10408,15 +10521,35 @@ var ts; }); } } + function pushTypeResolution(target) { + var i = 0; + var count = resolutionTargets.length; + while (i < count && resolutionTargets[i] !== target) { + i++; + } + if (i < count) { + do { + resolutionResults[i++] = false; + } while (i < count); + return false; + } + resolutionTargets.push(target); + resolutionResults.push(true); + return true; + } + function popTypeResolution() { + resolutionTargets.pop(); + return resolutionResults.pop(); + } function getRootDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 153) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 198 ? node.parent.parent.parent : node.parent; + return node.kind === 199 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); @@ -10439,7 +10572,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 150) { + if (pattern.kind === 151) { var name_5 = declaration.propertyName || declaration.name; type = getTypeOfPropertyOfType(parentType, name_5.text) || isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || @@ -10476,10 +10609,10 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 187) { + if (declaration.parent.parent.kind === 188) { return anyType; } - if (declaration.parent.parent.kind === 188) { + if (declaration.parent.parent.kind === 189) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { @@ -10488,10 +10621,10 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 130) { var func = declaration.parent; - if (func.kind === 137 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); + if (func.kind === 138 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 137); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10504,7 +10637,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 225) { + if (declaration.kind === 226) { return checkIdentifier(declaration.name); } return undefined; @@ -10533,7 +10666,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 176 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -10548,7 +10681,7 @@ var ts; return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 150 + return pattern.kind === 151 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -10558,7 +10691,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 224 ? getWidenedType(type) : type; + return declaration.kind !== 225 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -10566,7 +10699,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 130 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -10579,26 +10712,29 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 223) { + if (declaration.parent.kind === 224) { return links.type = anyType; } - if (declaration.kind === 214) { + if (declaration.kind === 215) { return links.type = checkExpression(declaration.expression); } - links.type = resolvingType; + if (!pushTypeResolution(symbol)) { + return unknownType; + } var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + if (!popTypeResolution()) { + if (symbol.valueDeclaration.type) { + type = unknownType; + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + } + else { + type = anyType; + if (compilerOptions.noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + } } + links.type = type; } return links.type; } @@ -10607,7 +10743,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 136) { + if (accessor.kind === 137) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10619,15 +10755,12 @@ var ts; } function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - function checkAndStoreTypeOfAccessors(symbol, links) { - links = links || getSymbolLinks(symbol); if (!links.type) { - links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 136); - var setter = ts.getDeclarationOfKind(symbol, 137); + if (!pushTypeResolution(symbol)) { + return unknownType; + } + var getter = ts.getDeclarationOfKind(symbol, 137); + var setter = ts.getDeclarationOfKind(symbol, 138); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10650,17 +10783,16 @@ var ts; } } } - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 136); - error(getter, 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)); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 137); + 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)); + } } + links.type = type; } + return links.type; } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); @@ -10724,7 +10856,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 202 || node.kind === 201) { + if (node.kind === 203 || node.kind === 202) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10758,10 +10890,10 @@ var ts; } function resolveBaseTypesOfClass(type) { type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(type.symbol, 201); + var declaration = ts.getDeclarationOfKind(type.symbol, 202); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + var baseType = getTypeFromTypeNode(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10781,10 +10913,10 @@ var ts; type.baseTypes = []; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 203 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; - var baseType = getTypeFromHeritageClauseElement(node); + var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 | 2048)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -10802,10 +10934,11 @@ var ts; } } } - function getDeclaredTypeOfClass(symbol) { + function getDeclaredTypeOfClassOrInterface(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024, symbol); + var kind = symbol.flags & 32 ? 1024 : 2048; + var type = links.declaredType = createObjectType(kind, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { type.flags |= 4096; @@ -10815,49 +10948,22 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); - } - return links.declaredType; - } - function getDeclaredTypeOfInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); } return links.declaredType; } function getDeclaredTypeOfTypeAlias(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 203); - var type = getTypeFromTypeNode(declaration.type); - if (links.declaredType === resolvingType) { - links.declaredType = type; + if (!pushTypeResolution(links)) { + return unknownType; } - } - else if (links.declaredType === resolvingType) { - links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 203); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 204); + var type = getTypeFromTypeNode(declaration.type); + if (!popTypeResolution()) { + type = unknownType; + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + links.declaredType = type; } return links.declaredType; } @@ -10875,7 +10981,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 128).constraint) { + if (!ts.getDeclarationOfKind(symbol, 129).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10891,11 +10997,8 @@ var ts; } function getDeclaredTypeOfSymbol(symbol) { ts.Debug.assert((symbol.flags & 16777216) === 0); - if (symbol.flags & 32) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & 64) { - return getDeclaredTypeOfInterface(symbol); + if (symbol.flags & (32 | 64)) { + return getDeclaredTypeOfClassOrInterface(symbol); } if (symbol.flags & 524288) { return getDeclaredTypeOfTypeAlias(symbol); @@ -10943,15 +11046,27 @@ var ts; } } } + function resolveDeclaredMembers(type) { + if (!type.declaredProperties) { + var symbol = type.symbol; + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); + } + return type; + } function resolveClassOrInterfaceMembers(type) { - var members = type.symbol.members; - var callSignatures = type.declaredCallSignatures; - var constructSignatures = type.declaredConstructSignatures; - var stringIndexType = type.declaredStringIndexType; - var numberIndexType = type.declaredNumberIndexType; - var baseTypes = getBaseTypes(type); + var target = resolveDeclaredMembers(type); + var members = target.symbol.members; + var callSignatures = target.declaredCallSignatures; + var constructSignatures = target.declaredConstructSignatures; + var stringIndexType = target.declaredStringIndexType; + var numberIndexType = target.declaredNumberIndexType; + var baseTypes = getBaseTypes(target); if (baseTypes.length) { - members = createSymbolTable(type.declaredProperties); + members = createSymbolTable(target.declaredProperties); for (var _i = 0; _i < baseTypes.length; _i++) { var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); @@ -10964,7 +11079,7 @@ var ts; setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveTypeReferenceMembers(type) { - var target = type.target; + var target = resolveDeclaredMembers(type.target); var mapper = createTypeMapper(target.typeParameters, type.typeArguments); var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); @@ -11102,7 +11217,7 @@ var ts; callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & 32) { - var classType = getDeclaredTypeOfClass(symbol); + var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); @@ -11203,7 +11318,7 @@ var ts; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (!prop) { + if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 | 64)) { return undefined; } if (!props) { @@ -11313,7 +11428,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 136 ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -11342,8 +11457,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 137); + if (declaration.kind === 137 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 138); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -11361,19 +11476,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 142: case 143: - case 200: - case 134: - case 133: + case 144: + case 201: case 135: - case 138: + case 134: + case 136: case 139: case 140: - case 136: + case 141: case 137: - case 162: + case 138: case 163: + case 164: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11387,7 +11502,9 @@ var ts; } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; + if (!pushTypeResolution(signature)) { + return unknownType; + } var type; if (signature.target) { type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); @@ -11398,27 +11515,25 @@ var ts; else { type = getReturnTypeFromBody(signature.declaration); } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, 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, ts.declarationNameToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_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); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, 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, ts.declarationNameToString(declaration.name)); + } + else { + error(declaration, ts.Diagnostics.Function_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); + } } } + signature.resolvedReturnType = type; } return signature.resolvedReturnType; } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { - var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); if (type.flags & 4096 && type.target === globalArrayType) { return type.typeArguments[0]; } @@ -11443,7 +11558,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; + var isConstructor = signature.declaration.kind === 136 || signature.declaration.kind === 140; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; @@ -11457,7 +11572,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 119 : 121; + var syntaxKind = kind === 1 ? 120 : 122; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11487,7 +11602,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 129).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11537,13 +11652,13 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 129; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 141 && n.typeName.kind === 65) { + if (n.kind === 142 && n.typeName.kind === 65) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); @@ -11562,18 +11677,12 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReference(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromHeritageClauseElement(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromTypeReferenceOrHeritageClauseElement(node) { + function getTypeFromTypeReferenceOrExpressionWithTypeArguments(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var type; - if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { - var typeNameOrExpression = node.kind === 141 + if (node.kind !== 177 || ts.isSupportedExpressionWithTypeArguments(node)) { + var typeNameOrExpression = node.kind === 142 ? node.typeName : node.expression; var symbol = resolveEntityName(typeNameOrExpression, 793056); @@ -11619,9 +11728,9 @@ var ts; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 201: case 202: - case 204: + case 203: + case 205: return declaration; } } @@ -11810,38 +11919,38 @@ var ts; switch (node.kind) { case 112: return anyType; - case 121: + case 122: return stringType; - case 119: + case 120: return numberType; case 113: return booleanType; - case 122: + case 123: return esSymbolType; case 99: return voidType; case 8: return getTypeFromStringLiteral(node); - case 141: - return getTypeFromTypeReference(node); - case 177: - return getTypeFromHeritageClauseElement(node); - case 144: - return getTypeFromTypeQueryNode(node); - case 146: - return getTypeFromArrayTypeNode(node); - case 147: - return getTypeFromTupleTypeNode(node); - case 148: - return getTypeFromUnionTypeNode(node); - case 149: - return getTypeFromTypeNode(node.type); case 142: - case 143: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case 177: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); case 145: + return getTypeFromTypeQueryNode(node); + case 147: + return getTypeFromArrayTypeNode(node); + case 148: + return getTypeFromTupleTypeNode(node); + case 149: + return getTypeFromUnionTypeNode(node); + case 150: + return getTypeFromTypeNode(node.type); + case 143: + case 144: + case 146: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); case 65: - case 126: + case 127: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11992,27 +12101,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 162: case 163: + case 164: return isContextSensitiveFunctionLikeDeclaration(node); - case 154: + case 155: return ts.forEach(node.properties, isContextSensitive); - case 153: + case 154: return ts.forEach(node.elements, isContextSensitive); - case 170: + case 171: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 169: + case 170: return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 224: + case 225: return isContextSensitive(node.initializer); + case 135: case 134: - case 133: return isContextSensitiveFunctionLikeDeclaration(node); - case 161: + case 162: return isContextSensitive(node.expression); } return false; @@ -12786,22 +12895,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 133: case 132: - case 131: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 129: + case 130: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 200: + case 201: + case 135: case 134: - case 133: - case 136: case 137: - case 162: + case 138: case 163: + case 164: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -13044,10 +13153,10 @@ var ts; function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 144: + case 145: return true; case 65: - case 126: + case 127: node = node.parent; continue; default: @@ -13089,7 +13198,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { var n = node.left; - while (n.kind === 161) { + while (n.kind === 162) { n = n.expression; } if (n.kind === 65 && getResolvedSymbol(n) === symbol) { @@ -13106,46 +13215,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 169: + case 170: return isAssignedInBinaryExpression(node); - case 198: - case 152: - return isAssignedInVariableDeclaration(node); - case 150: - case 151: + case 199: case 153: + return isAssignedInVariableDeclaration(node); + case 151: + case 152: case 154: case 155: case 156: case 157: case 158: - case 160: + case 159: case 161: - case 167: - case 164: + case 162: + case 168: case 165: case 166: - case 168: - case 170: - case 173: - case 179: + case 167: + case 169: + case 171: + case 174: case 180: - case 182: + case 181: case 183: case 184: case 185: case 186: case 187: case 188: - case 191: + case 189: case 192: case 193: - case 220: - case 221: case 194: + case 221: + case 222: case 195: case 196: - case 223: + case 197: + case 224: return ts.forEachChild(node, isAssignedIn); } return false; @@ -13181,17 +13290,17 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 183: + case 184: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 170: + case 171: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 169: + case 170: if (child === node.right) { if (node.operatorToken.kind === 48) { narrowedType = narrowType(type, node.left, true); @@ -13201,14 +13310,14 @@ var ts; } } break; - case 227: - case 205: - case 200: - case 134: - case 133: - case 136: - case 137: + case 228: + case 206: + case 201: case 135: + case 134: + case 137: + case 138: + case 136: break loop; } if (narrowedType !== type) { @@ -13221,7 +13330,7 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 165 || expr.right.kind !== 8) { + if (expr.left.kind !== 166 || expr.right.kind !== 8) { return type; } var left = expr.left; @@ -13280,23 +13389,38 @@ var ts; return type; } var prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (!prototypeProperty) { - return type; + if (prototypeProperty) { + var targetType = getTypeOfSymbol(prototypeProperty); + if (targetType !== anyType) { + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + if (type.flags & 16384) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + } + } } - var targetType = getTypeOfSymbol(prototypeProperty); - if (isTypeSubtypeOf(targetType, type)) { - return targetType; + var constructSignatures; + if (rightType.flags & 2048) { + constructSignatures = resolveDeclaredMembers(rightType).declaredConstructSignatures; } - if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + else if (rightType.flags & 32768) { + constructSignatures = getSignaturesOfType(rightType, 1); + } + if (constructSignatures && constructSignatures.length !== 0) { + var instanceType = getUnionType(ts.map(constructSignatures, function (signature) { return getReturnTypeOfSignature(getErasedSignature(signature)); })); + if (type.flags & 16384) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, instanceType); })); + } + return instanceType; } return type; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 161: + case 162: return narrowType(type, expr.expression, assumeTrue); - case 169: + case 170: var operator = expr.operatorToken.kind; if (operator === 30 || operator === 31) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -13311,7 +13435,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 167: + case 168: if (expr.operator === 46) { return narrowType(type, expr.operand, !assumeTrue); } @@ -13322,7 +13446,7 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163 && languageVersion < 2) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 164 && 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); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -13346,15 +13470,15 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 223) { + symbol.valueDeclaration.parent.kind === 224) { return; } var container = symbol.valueDeclaration; - while (container.kind !== 199) { + while (container.kind !== 200) { container = container.parent; } container = container.parent; - if (container.kind === 180) { + if (container.kind === 181) { container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -13371,9 +13495,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 ? container.parent : undefined; getNodeLinks(node).flags |= 2; - if (container.kind === 132 || container.kind === 135) { + if (container.kind === 133 || container.kind === 136) { getNodeLinks(classNode).flags |= 4; } else { @@ -13383,36 +13507,36 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 163) { + if (container.kind === 164) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 205: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + case 206: + error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 204: + case 205: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 135: + case 136: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 133: case 132: - case 131: if (container.flags & 128) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 127: + case 128: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -13421,15 +13545,15 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 129) { + if (n.kind === 130) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 201); + var isCallExpression = node.parent.kind === 158 && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 202); var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -13445,31 +13569,31 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 135; + canUseSuperExpression = container.kind === 136; } else { needToCaptureLexicalThis = false; - while (container && container.kind === 163) { + while (container && container.kind === 164) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } - if (container && container.parent && container.parent.kind === 201) { + if (container && container.parent && container.parent.kind === 202) { if (container.flags & 128) { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || - container.kind === 137; + container.kind === 135 || + container.kind === 134 || + container.kind === 137 || + container.kind === 138; } else { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || + container.kind === 135 || + container.kind === 134 || container.kind === 137 || + container.kind === 138 || + container.kind === 133 || container.kind === 132 || - container.kind === 131 || - container.kind === 135; + container.kind === 136; } } } @@ -13483,7 +13607,7 @@ var ts; getNodeLinks(node).flags |= 16; returnType = baseClass; } - if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 136 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -13493,7 +13617,7 @@ var ts; return returnType; } } - if (container && container.kind === 127) { + if (container && container.kind === 128) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -13518,7 +13642,7 @@ var ts; } if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters)); } } } @@ -13531,7 +13655,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 130) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -13546,7 +13670,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { + if (func.type || func.kind === 136 || func.kind === 137 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 138))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignatureForFunctionLikeDeclaration(func); @@ -13566,7 +13690,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 159) { + if (template.parent.kind === 160) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -13674,32 +13798,32 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 198: - case 129: + case 199: + case 130: + case 133: case 132: - case 131: - case 152: - return getContextualTypeForInitializerExpression(node); - case 163: - case 191: - return getContextualTypeForReturnExpression(node); - case 157: - case 158: - return getContextualTypeForArgument(parent, node); - case 160: - return getTypeFromTypeNode(parent.type); - case 169: - return getContextualTypeForBinaryOperand(node); - case 224: - return getContextualTypeForObjectLiteralElement(parent); case 153: - return getContextualTypeForElementExpression(node); - case 170: - return getContextualTypeForConditionalOperand(node); - case 176: - ts.Debug.assert(parent.parent.kind === 171); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 164: + case 192: + return getContextualTypeForReturnExpression(node); + case 158: + case 159: + return getContextualTypeForArgument(parent, node); case 161: + return getTypeFromTypeNode(parent.type); + case 170: + return getContextualTypeForBinaryOperand(node); + case 225: + return getContextualTypeForObjectLiteralElement(parent); + case 154: + return getContextualTypeForElementExpression(node); + case 171: + return getContextualTypeForConditionalOperand(node); + case 178: + ts.Debug.assert(parent.parent.kind === 172); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 162: return getContextualType(parent); } return undefined; @@ -13714,13 +13838,13 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 162 || node.kind === 163; + return node.kind === 163 || node.kind === 164; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -13764,13 +13888,13 @@ var ts; } function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { + if (parent.kind === 170 && parent.operatorToken.kind === 53 && parent.left === node) { return true; } - if (parent.kind === 224) { + if (parent.kind === 225) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 153) { + if (parent.kind === 154) { return isAssignmentTarget(parent); } return false; @@ -13789,7 +13913,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0; _i < elements.length; _i++) { var e = elements[_i]; - if (inDestructuringPattern && e.kind === 173) { + if (inDestructuringPattern && e.kind === 174) { var restArrayType = checkExpression(e.expression, contextualMapper); var restElementType = getIndexTypeOfType(restArrayType, 1) || (languageVersion >= 2 ? checkIteratedType(restArrayType, undefined) : undefined); @@ -13801,7 +13925,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 173; + hasSpreadElement = hasSpreadElement || e.kind === 174; } if (!hasSpreadElement) { var contextualType = getContextualType(node); @@ -13812,7 +13936,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 128 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); @@ -13842,18 +13966,18 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 224 || - memberDecl.kind === 225 || + if (memberDecl.kind === 225 || + memberDecl.kind === 226 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 224) { + if (memberDecl.kind === 225) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 134) { + else if (memberDecl.kind === 135) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 225); + ts.Debug.assert(memberDecl.kind === 226); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -13868,7 +13992,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); + ts.Debug.assert(memberDecl.kind === 137 || memberDecl.kind === 138); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -13901,7 +14025,7 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 132; + return s.valueDeclaration ? s.valueDeclaration.kind : 133; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; @@ -13911,7 +14035,7 @@ var ts; if (!(flags & (32 | 64))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 201); + var enclosingClassDeclaration = ts.getAncestor(node, 202); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32) { @@ -13958,7 +14082,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 135) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13970,14 +14094,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 155 + var left = node.kind === 156 ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 135) { return false; } else { @@ -13992,7 +14116,7 @@ var ts; function checkIndexedAccess(node) { if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 158 && node.parent.expression === node) { + if (node.parent.kind === 159 && 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); @@ -14088,7 +14212,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 159) { + if (node.kind === 160) { checkExpression(node.template); } else { @@ -14141,7 +14265,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 173) { + if (args[i].kind === 174) { return i; } } @@ -14151,11 +14275,11 @@ var ts; var adjustedArgCount; var typeArguments; var callIsIncomplete; - if (node.kind === 159) { + if (node.kind === 160) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 171) { + if (tagExpression.template.kind === 172) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -14170,7 +14294,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 158); + ts.Debug.assert(callExpression.kind === 159); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -14222,10 +14346,10 @@ var ts; } for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { + if (arg.kind !== 176) { var paramType = getTypeAtPosition(signature, i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 159) { + if (i === 0 && args[i].parent.kind === 160) { argType = globalTemplateStringsArrayType; } else { @@ -14265,9 +14389,9 @@ var ts; function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { + if (arg.kind !== 176) { var paramType = getTypeAtPosition(signature, i); - var argType = i === 0 && node.kind === 159 + var argType = i === 0 && node.kind === 160 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) @@ -14281,10 +14405,10 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 159) { + if (node.kind === 160) { var template = node.template; args = [template]; - if (template.kind === 171) { + if (template.kind === 172) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -14297,7 +14421,7 @@ var ts; } function getEffectiveTypeArguments(callExpression) { if (callExpression.expression.kind === 91) { - var containingClass = ts.getAncestor(callExpression, 201); + var containingClass = ts.getAncestor(callExpression, 202); var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } @@ -14306,7 +14430,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 159; + var isTaggedTemplate = node.kind === 160; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); @@ -14516,13 +14640,13 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 157) { + if (node.kind === 158) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 158) { + else if (node.kind === 159) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 159) { + else if (node.kind === 160) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -14537,12 +14661,12 @@ var ts; if (node.expression.kind === 91) { return voidType; } - if (node.kind === 158) { + if (node.kind === 159) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 135 && - declaration.kind !== 139 && - declaration.kind !== 143) { + declaration.kind !== 136 && + declaration.kind !== 140 && + declaration.kind !== 144) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -14578,9 +14702,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; + var parameter = ts.lastOrUndefined(signature.parameters); var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + links.type = instantiateType(getTypeOfSymbol(ts.lastOrUndefined(context.parameters)), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -14589,7 +14713,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 179) { + if (func.body.kind !== 180) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -14627,7 +14751,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 195); + return (body.statements.length === 1) && (body.statements[0].kind === 196); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { @@ -14636,7 +14760,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 180) { return; } var bodyBlock = func.body; @@ -14649,9 +14773,9 @@ var ts; error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 162) { + if (!hasGrammarError && node.kind === 163) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { @@ -14668,10 +14792,9 @@ var ts; if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } - if (!node.type) { - signature.resolvedReturnType = resolvingType; + if (!node.type && !signature.resolvedReturnType) { var returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { + if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } } @@ -14679,19 +14802,19 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { + if (produceDiagnostics && node.kind !== 135 && node.kind !== 134) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 || ts.isObjectLiteralMethod(node)); if (node.type && !node.asteriskToken) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { - if (node.body.kind === 179) { + if (node.body.kind === 180) { checkSourceElement(node.body); } else { @@ -14721,13 +14844,13 @@ var ts; var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 155: { + case 156: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 156: + case 157: return true; - case 161: + case 162: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -14736,11 +14859,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 65: - case 155: { + case 156: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; } - case 156: { + case 157: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 8) { @@ -14750,7 +14873,7 @@ var ts; } return false; } - case 161: + case 162: return isConstVariableReference(n.expression); default: return false; @@ -14875,7 +14998,7 @@ var ts; var properties = node.properties; for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 225 || p.kind === 226) { var name_8 = p.name; var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name_8.text) || @@ -14899,8 +15022,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { + if (e.kind !== 176) { + if (e.kind !== 174) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) @@ -14924,7 +15047,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 169 && restExpression.operatorToken.kind === 53) { + if (restExpression.kind === 170 && restExpression.operatorToken.kind === 53) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -14937,14 +15060,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 170 && target.operatorToken.kind === 53) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 154) { + if (target.kind === 155) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 153) { + if (target.kind === 154) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -14961,7 +15084,7 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { + if (operator === 53 && (node.left.kind === 155 || node.left.kind === 154)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); @@ -15135,14 +15258,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 127) { + if (node.name.kind === 128) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 127) { + if (node.name.kind === 128) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -15169,7 +15292,7 @@ var ts; } function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 126) { + if (node.kind == 127) { type = checkQualifiedName(node); } else { @@ -15177,9 +15300,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 155 && node.parent.expression === node) || - (node.parent.kind === 156 && node.parent.expression === node) || - ((node.kind === 65 || node.kind === 126) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 156 && node.parent.expression === node) || + (node.parent.kind === 157 && node.parent.expression === node) || + ((node.kind === 65 || node.kind === 127) && 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); } @@ -15205,54 +15328,54 @@ var ts; return booleanType; case 7: return checkNumericLiteral(node); - case 171: + case 172: return checkTemplateExpression(node); case 8: case 10: return stringType; case 9: return globalRegExpType; - case 153: - return checkArrayLiteral(node, contextualMapper); case 154: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, contextualMapper); case 155: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, contextualMapper); case 156: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 157: + return checkIndexedAccess(node); case 158: - return checkCallExpression(node); case 159: - return checkTaggedTemplateExpression(node); + return checkCallExpression(node); case 160: - return checkTypeAssertion(node); + return checkTaggedTemplateExpression(node); case 161: - return checkExpression(node.expression, contextualMapper); - case 174: - return checkClassExpression(node); + return checkTypeAssertion(node); case 162: - case 163: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 165: - return checkTypeOfExpression(node); - case 164: - return checkDeleteExpression(node); - case 166: - return checkVoidExpression(node); - case 167: - return checkPrefixUnaryExpression(node); - case 168: - return checkPostfixUnaryExpression(node); - case 169: - return checkBinaryExpression(node, contextualMapper); - case 170: - return checkConditionalExpression(node, contextualMapper); - case 173: - return checkSpreadElementExpression(node, contextualMapper); + return checkExpression(node.expression, contextualMapper); case 175: + return checkClassExpression(node); + case 163: + case 164: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); + case 166: + return checkTypeOfExpression(node); + case 165: + return checkDeleteExpression(node); + case 167: + return checkVoidExpression(node); + case 168: + return checkPrefixUnaryExpression(node); + case 169: + return checkPostfixUnaryExpression(node); + case 170: + return checkBinaryExpression(node, contextualMapper); + case 171: + return checkConditionalExpression(node, contextualMapper); + case 174: + return checkSpreadElementExpression(node, contextualMapper); + case 176: return undefinedType; - case 172: + case 173: checkYieldExpression(node); return unknownType; } @@ -15281,7 +15404,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 112) { func = ts.getContainingFunction(node); - if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 136 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -15293,12 +15416,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 140) { + if (node.kind === 141) { checkGrammarIndexSignature(node); } - else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || - node.kind === 138 || node.kind === 135 || - node.kind === 139) { + else if (node.kind === 143 || node.kind === 201 || node.kind === 144 || + node.kind === 139 || node.kind === 136 || + node.kind === 140) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -15310,10 +15433,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 139: + case 140: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 138: + case 139: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -15322,7 +15445,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 202) { + if (node.kind === 203) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -15337,7 +15460,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 121: + case 122: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -15345,7 +15468,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 119: + case 120: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -15382,17 +15505,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 157 && n.expression.kind === 91; + return n.kind === 158 && n.expression.kind === 91; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 162: - case 200: case 163: - case 154: return false; + case 201: + case 164: + case 155: return false; default: return ts.forEachChild(n, containsSuperCall); } } @@ -15400,12 +15523,12 @@ var ts; if (n.kind === 93) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 162 && n.kind !== 200) { + else if (n.kind !== 163 && n.kind !== 201) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 132 && + return n.kind === 133 && !(n.flags & 128) && !!n.initializer; } @@ -15415,7 +15538,7 @@ var ts; ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 182 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 183 || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -15431,13 +15554,13 @@ var ts; function checkAccessorDeclaration(node) { if (produceDiagnostics) { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 136) { + if (node.kind === 137) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 136 ? 137 : 136; + var otherKind = node.kind === 137 ? 138 : 137; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112) !== (otherAccessor.flags & 112))) { @@ -15452,7 +15575,7 @@ var ts; } } } - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); + getTypeOfAccessors(getSymbolOfNode(node)); } checkFunctionLikeDeclaration(node); } @@ -15461,15 +15584,15 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeReferenceInStrictMode(node.typeName); - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkHeritageClauseElement(node) { - checkGrammarHeritageClauseElementInStrictMode(node.expression); - return checkTypeReferenceOrHeritageClauseElement(node); + function checkExpressionWithTypeArguments(node) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(node.expression); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkTypeReferenceOrHeritageClauseElement(node) { + function checkTypeReferenceOrExpressionWithTypeArguments(node) { checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); + var type = getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); if (type !== unknownType && node.typeArguments) { var len = node.typeArguments.length; for (var i = 0; i < len; i++) { @@ -15522,9 +15645,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 202) { - ts.Debug.assert(signatureDeclarationNode.kind === 138 || signatureDeclarationNode.kind === 139); - var signatureKind = signatureDeclarationNode.kind === 138 ? 0 : 1; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 203) { + ts.Debug.assert(signatureDeclarationNode.kind === 139 || signatureDeclarationNode.kind === 140); + var signatureKind = signatureDeclarationNode.kind === 139 ? 0 : 1; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -15542,7 +15665,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 203 && ts.isInAmbientContext(n)) { if (!(flags & 2)) { flags |= 1; } @@ -15615,7 +15738,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) { - ts.Debug.assert(node.kind === 134 || node.kind === 133); + ts.Debug.assert(node.kind === 135 || node.kind === 134); ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128)); var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); @@ -15642,11 +15765,11 @@ var ts; var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 202 || node.parent.kind === 145 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 203 || node.parent.kind === 146 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { + if (node.kind === 201 || node.kind === 135 || node.kind === 134 || node.kind === 136) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -15743,16 +15866,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 202: + case 203: return 2097152; - case 205: + case 206: return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 201: - case 204: + case 202: + case 205: return 2097152 | 1048576; - case 208: + case 209: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -15766,29 +15889,29 @@ var ts; var expression = node.expression; var exprType = checkExpression(expression); switch (node.parent.kind) { - case 201: + case 202: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]); checkTypeAssignableTo(exprType, classDecoratorType, node); break; - case 132: + case 133: checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node); break; - case 134: - case 136: + case 135: case 137: + case 138: var methodType = getTypeOfNode(node.parent); var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]); checkTypeAssignableTo(exprType, methodDecoratorType, node); break; - case 129: + case 130: checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node); break; } } function checkTypeNodeAsExpression(node) { - if (node && node.kind === 141) { + if (node && node.kind === 142) { var type = getTypeFromTypeNode(node); var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 | 132 | 258))) { @@ -15801,19 +15924,19 @@ var ts; } function checkTypeAnnotationAsExpression(node) { switch (node.kind) { - case 132: + case 133: checkTypeNodeAsExpression(node.type); break; - case 129: + case 130: checkTypeNodeAsExpression(node.type); break; - case 134: - checkTypeNodeAsExpression(node.type); - break; - case 136: + case 135: checkTypeNodeAsExpression(node.type); break; case 137: + checkTypeNodeAsExpression(node.type); + break; + case 138: checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); break; } @@ -15833,24 +15956,24 @@ var ts; } if (compilerOptions.emitDecoratorMetadata) { switch (node.kind) { - case 201: + case 202: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 134: + case 135: checkParameterTypeAnnotationsAsExpressions(node); + case 138: case 137: - case 136: - case 132: - case 129: + case 133: + case 130: checkTypeAnnotationAsExpression(node); break; } } emitDecorate = true; - if (node.kind === 129) { + if (node.kind === 130) { emitParam = true; } ts.forEach(node.decorators, checkDecorator); @@ -15870,7 +15993,7 @@ var ts; checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 127) { + if (node.name && node.name.kind === 128) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { @@ -15895,11 +16018,11 @@ var ts; } } function checkBlock(node) { - if (node.kind === 179) { + if (node.kind === 180) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 206) { + if (ts.isFunctionBlock(node) || node.kind === 207) { checkFunctionExpressionBodies(node); } } @@ -15917,19 +16040,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 132 || - node.kind === 131 || + if (node.kind === 133 || + node.kind === 132 || + node.kind === 135 || node.kind === 134 || - node.kind === 133 || - node.kind === 136 || - node.kind === 137) { + node.kind === 137 || + node.kind === 138) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = getRootDeclaration(node); - if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 130 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -15959,7 +16082,7 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 201); + var enclosingClass = ts.getAncestor(node, 202); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } @@ -15977,12 +16100,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 206 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 227 && ts.isExternalModule(parent)) { - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); + if (parent.kind === 228 && ts.isExternalModule(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)); } } function checkVarDeclaredNamesNotShadowed(node) { @@ -15992,7 +16115,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 12288) !== 0 || isParameterDeclaration(node)) { return; } - if (node.kind === 198 && !node.initializer) { + if (node.kind === 199 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -16002,15 +16125,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 199); - var container = varDeclList.parent.kind === 180 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 200); + var container = varDeclList.parent.kind === 181 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 179 && ts.isFunctionLike(container.parent) || + (container.kind === 180 && ts.isFunctionLike(container.parent) || + container.kind === 207 || container.kind === 206 || - container.kind === 205 || - container.kind === 227); + container.kind === 228); if (!namesShareScope) { var name_9 = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_9, name_9); @@ -16020,13 +16143,13 @@ var ts; } } function isParameterDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 153) { node = node.parent.parent; } - return node.kind === 129; + return node.kind === 130; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 129) { + if (getRootDeclaration(node).kind !== 130) { return; } var func = ts.getContainingFunction(node); @@ -16035,7 +16158,7 @@ var ts; if (n.kind === 65) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 129) { + if (referencedSymbol.valueDeclaration.kind === 130) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -16056,7 +16179,7 @@ var ts; checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 127) { + if (node.name.kind === 128) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -16065,7 +16188,7 @@ var ts; if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 130 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -16093,9 +16216,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 133 && node.kind !== 132) { checkExportsOnMergedDeclarations(node); - if (node.kind === 198 || node.kind === 152) { + if (node.kind === 199 || node.kind === 153) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -16124,7 +16247,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 179 || node.kind === 154) { + if (node.kind === 180 || node.kind === 155) { return true; } node = node.parent; @@ -16152,12 +16275,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 199) { + if (node.initializer && node.initializer.kind == 200) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -16166,19 +16289,19 @@ var ts; } if (node.condition) checkExpression(node.condition); - if (node.iterator) - checkExpression(node.iterator); + if (node.incrementor) + checkExpression(node.incrementor); checkSourceElement(node.statement); } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 153 || varExpr.kind === 154) { + if (varExpr.kind === 154 || varExpr.kind === 155) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -16193,7 +16316,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { 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); @@ -16203,7 +16326,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 153 || varExpr.kind === 154) { + if (varExpr.kind === 154 || varExpr.kind === 155) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { @@ -16364,7 +16487,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); + return !!(node.kind === 137 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 138))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -16378,11 +16501,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 137) { + if (func.kind === 138) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 135) { + if (func.kind === 136) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -16409,7 +16532,7 @@ var ts; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 221 && !hasDuplicateDefaultClause) { + if (clause.kind === 222 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -16421,7 +16544,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 220) { + if (produceDiagnostics && clause.kind === 221) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -16438,7 +16561,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 194 && current.label.text === node.label.text) { + if (current.kind === 195 && 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; @@ -16502,7 +16625,7 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { + if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 202) { var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; @@ -16533,7 +16656,7 @@ var ts; return; } var errorNode; - if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 128 || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -16584,7 +16707,7 @@ var ts; } function checkClassDeclaration(node) { checkGrammarDeclarationNameInStrictMode(node); - if (node.parent.kind !== 206 && node.parent.kind !== 227) { + if (node.parent.kind !== 207 && node.parent.kind !== 228) { grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); } if (!node.name && !(node.flags & 256)) { @@ -16604,11 +16727,11 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - if (!ts.isSupportedHeritageClauseElement(baseTypeNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(baseTypeNode)) { error(baseTypeNode.expression, ts.Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); } emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkHeritageClauseElement(baseTypeNode); + checkExpressionWithTypeArguments(baseTypeNode); } var baseTypes = getBaseTypes(type); if (baseTypes.length) { @@ -16629,12 +16752,12 @@ var ts; var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(typeRefNode)) { error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(typeRefNode); + checkExpressionWithTypeArguments(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromHeritageClauseElement(typeRefNode); + var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096) ? t.target : t; if (declaredType.flags & (1024 | 2048)) { @@ -16714,7 +16837,7 @@ var ts; } } function isAccessor(kind) { - return kind === 136 || kind === 137; + return kind === 137 || kind === 138; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -16747,7 +16870,7 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; for (var _i = 0; _i < baseTypes.length; _i++) { var base = baseTypes[_i]; @@ -16780,7 +16903,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 203); 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); @@ -16797,10 +16920,10 @@ var ts; } } ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { - if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) { error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(heritageElement); + checkExpressionWithTypeArguments(heritageElement); }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { @@ -16821,7 +16944,7 @@ var ts; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 127 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 128 && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; @@ -16857,7 +16980,7 @@ var ts; return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 167: + case 168: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -16868,7 +16991,7 @@ var ts; case 47: return ~value; } return undefined; - case 169: + case 170: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -16893,11 +17016,11 @@ var ts; return undefined; case 7: return +e.text; - case 161: + case 162: return evalConstant(e.expression); case 65: + case 157: case 156: - case 155: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType; @@ -16908,7 +17031,7 @@ var ts; } else { var expression; - if (e.kind === 156) { + if (e.kind === 157) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; @@ -16925,7 +17048,7 @@ var ts; if (current.kind === 65) { break; } - else if (current.kind === 155) { + else if (current.kind === 156) { current = current.expression; } else { @@ -16982,7 +17105,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 204) { + if (declaration.kind !== 205) { return false; } var enumDeclaration = declaration; @@ -17005,8 +17128,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 || - (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 202 || + (declaration.kind === 201 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -17044,13 +17167,13 @@ var ts; var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + 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, 201); + var mergedClass = ts.getDeclarationOfKind(symbol, 202); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048; @@ -17058,10 +17181,10 @@ var ts; } if (node.name.kind === 8) { if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); } if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); } } } @@ -17069,10 +17192,10 @@ var ts; } function getFirstIdentifier(node) { while (true) { - if (node.kind === 126) { + if (node.kind === 127) { node = node.left; } - else if (node.kind === 155) { + else if (node.kind === 156) { node = node.expression; } else { @@ -17088,15 +17211,15 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { - error(moduleName, node.kind === 215 ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + var inAmbientExternalModule = node.parent.kind === 207 && node.parent.parent.name.kind === 8; + if (node.parent.kind !== 228 && !inAmbientExternalModule) { + error(moduleName, node.kind === 216 ? + 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 && isExternalModuleNameRelative(moduleName.text)) { - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); return false; } return true; @@ -17109,7 +17232,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 217 ? + var message = node.kind === 218 ? 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)); @@ -17132,7 +17255,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { + if (importClause.namedBindings.kind === 212) { checkImportBinding(importClause.namedBindings); } else { @@ -17177,15 +17300,15 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { - error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); + var inAmbientExternalModule = node.parent.kind === 207 && node.parent.parent.name.kind === 8; + if (node.parent.kind !== 228 && !inAmbientExternalModule) { + error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { - error(node.moduleSpecifier, ts.Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); + error(node.moduleSpecifier, ts.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); } } } @@ -17197,9 +17320,9 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 227 ? node.parent : node.parent.parent; - if (container.kind === 205 && container.name.kind === 65) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + var container = node.parent.kind === 228 ? node.parent : node.parent.parent; + if (container.kind === 206 && container.name.kind === 65) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { @@ -17212,15 +17335,20 @@ var ts; checkExpressionCached(node.expression); } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= 2) { - grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + if (node.isExportEquals && !ts.isInAmbientContext(node)) { + if (languageVersion >= 2) { + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + } + else if (compilerOptions.module === 4) { + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } } } function getModuleStatements(node) { - if (node.kind === 227) { + if (node.kind === 228) { return node.statements; } - if (node.kind === 205 && node.body.kind === 206) { + if (node.kind === 206 && node.body.kind === 207) { return node.body.statements; } return emptyArray; @@ -17249,163 +17377,162 @@ var ts; if (!node) return; switch (node.kind) { - case 128: - return checkTypeParameter(node); case 129: + return checkTypeParameter(node); + case 130: return checkParameter(node); + case 133: case 132: - case 131: return checkPropertyDeclaration(node); - case 142: case 143: - case 138: + case 144: case 139: - return checkSignatureDeclaration(node); case 140: return checkSignatureDeclaration(node); - case 134: - case 133: - return checkMethodDeclaration(node); - case 135: - return checkConstructorDeclaration(node); - case 136: - case 137: - return checkAccessorDeclaration(node); case 141: + return checkSignatureDeclaration(node); + case 135: + case 134: + return checkMethodDeclaration(node); + case 136: + return checkConstructorDeclaration(node); + case 137: + case 138: + return checkAccessorDeclaration(node); + case 142: return checkTypeReferenceNode(node); - case 144: - return checkTypeQuery(node); case 145: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 146: - return checkArrayType(node); + return checkTypeLiteral(node); case 147: - return checkTupleType(node); + return checkArrayType(node); case 148: - return checkUnionType(node); + return checkTupleType(node); case 149: + return checkUnionType(node); + case 150: return checkSourceElement(node.type); - case 200: - return checkFunctionDeclaration(node); - case 179: - case 206: - return checkBlock(node); - case 180: - return checkVariableStatement(node); - case 182: - return checkExpressionStatement(node); - case 183: - return checkIfStatement(node); - case 184: - return checkDoStatement(node); - case 185: - return checkWhileStatement(node); - case 186: - return checkForStatement(node); - case 187: - return checkForInStatement(node); - case 188: - return checkForOfStatement(node); - case 189: - case 190: - return checkBreakOrContinueStatement(node); - case 191: - return checkReturnStatement(node); - case 192: - return checkWithStatement(node); - case 193: - return checkSwitchStatement(node); - case 194: - return checkLabeledStatement(node); - case 195: - return checkThrowStatement(node); - case 196: - return checkTryStatement(node); - case 198: - return checkVariableDeclaration(node); - case 152: - return checkBindingElement(node); case 201: - return checkClassDeclaration(node); - case 202: - return checkInterfaceDeclaration(node); - case 203: - return checkTypeAliasDeclaration(node); - case 204: - return checkEnumDeclaration(node); - case 205: - return checkModuleDeclaration(node); - case 209: - return checkImportDeclaration(node); - case 208: - return checkImportEqualsDeclaration(node); - case 215: - return checkExportDeclaration(node); - case 214: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); + case 180: + case 207: + return checkBlock(node); case 181: - checkGrammarStatementInAmbientContext(node); - return; + return checkVariableStatement(node); + case 183: + return checkExpressionStatement(node); + case 184: + return checkIfStatement(node); + case 185: + return checkDoStatement(node); + case 186: + return checkWhileStatement(node); + case 187: + return checkForStatement(node); + case 188: + return checkForInStatement(node); + case 189: + return checkForOfStatement(node); + case 190: + case 191: + return checkBreakOrContinueStatement(node); + case 192: + return checkReturnStatement(node); + case 193: + return checkWithStatement(node); + case 194: + return checkSwitchStatement(node); + case 195: + return checkLabeledStatement(node); + case 196: + return checkThrowStatement(node); case 197: + return checkTryStatement(node); + case 199: + return checkVariableDeclaration(node); + case 153: + return checkBindingElement(node); + case 202: + return checkClassDeclaration(node); + case 203: + return checkInterfaceDeclaration(node); + case 204: + return checkTypeAliasDeclaration(node); + case 205: + return checkEnumDeclaration(node); + case 206: + return checkModuleDeclaration(node); + case 210: + return checkImportDeclaration(node); + case 209: + return checkImportEqualsDeclaration(node); + case 216: + return checkExportDeclaration(node); + case 215: + return checkExportAssignment(node); + case 182: checkGrammarStatementInAmbientContext(node); return; - case 218: + case 198: + checkGrammarStatementInAmbientContext(node); + return; + case 219: return checkMissingDeclaration(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 162: case 163: + case 164: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; + case 135: case 134: - case 133: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 135: case 136: case 137: - case 200: + case 138: + case 201: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 192: + case 193: checkFunctionExpressionBodies(node.expression); break; - case 129: + case 130: + case 133: case 132: - case 131: - case 150: case 151: case 152: case 153: case 154: - case 224: case 155: + case 225: case 156: case 157: case 158: case 159: - case 171: - case 176: case 160: + case 172: + case 178: case 161: - case 165: + case 162: case 166: - case 164: case 167: + case 165: case 168: case 169: case 170: - case 173: - case 179: - case 206: + case 171: + case 174: case 180: - case 182: + case 207: + case 181: case 183: case 184: case 185: @@ -17415,21 +17542,22 @@ var ts; case 189: case 190: case 191: - case 193: - case 207: - case 220: - case 221: + case 192: case 194: + case 208: + case 221: + case 222: case 195: case 196: - case 223: - case 198: + case 197: + case 224: case 199: - case 201: - case 204: - case 226: - case 214: + case 200: + case 202: + case 205: case 227: + case 215: + case 228: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -17489,7 +17617,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 192 && node.parent.statement === node) { + if (node.parent.kind === 193 && node.parent.statement === node) { return true; } node = node.parent; @@ -17511,23 +17639,23 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 228: if (!ts.isExternalModule(location)) { break; } - case 205: + case 206: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 204: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 201: case 202: + case 203: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 162: + case 163: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17563,22 +17691,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 228: if (!ts.isExternalModule(location)) break; - case 205: + case 206: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 204: + case 205: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 201: case 202: + case 203: if (!(memberFlags & 128)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 162: + case 163: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17597,104 +17725,104 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 128: - case 201: + case 129: case 202: case 203: case 204: + case 205: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 126) { + while (node.parent && node.parent.kind === 127) { node = node.parent; } - return node.parent && node.parent.kind === 141; + return node.parent && node.parent.kind === 142; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 155) { + while (node.parent && node.parent.kind === 156) { node = node.parent; } return node.parent && node.parent.kind === 177; } function isTypeNode(node) { - if (141 <= node.kind && node.kind <= 149) { + if (142 <= node.kind && node.kind <= 150) { return true; } switch (node.kind) { case 112: - case 119: - case 121: - case 113: + case 120: case 122: + case 113: + case 123: return true; case 99: - return node.parent.kind !== 166; + return node.parent.kind !== 167; case 8: - return node.parent.kind === 129; + return node.parent.kind === 130; case 177: return true; case 65: - if (node.parent.kind === 126 && node.parent.right === node) { + if (node.parent.kind === 127 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 155 && node.parent.name === node) { + else if (node.parent.kind === 156 && node.parent.name === node) { node = node.parent; } - case 126: - case 155: - ts.Debug.assert(node.kind === 65 || node.kind === 126 || node.kind === 155, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + case 127: + case 156: + ts.Debug.assert(node.kind === 65 || node.kind === 127 || node.kind === 156, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); var parent_5 = node.parent; - if (parent_5.kind === 144) { + if (parent_5.kind === 145) { return false; } - if (141 <= parent_5.kind && parent_5.kind <= 149) { + if (142 <= parent_5.kind && parent_5.kind <= 150) { return true; } switch (parent_5.kind) { case 177: return true; - case 128: - return node === parent_5.constraint; - case 132: - case 131: case 129: - case 198: + return node === parent_5.constraint; + case 133: + case 132: + case 130: + case 199: return node === parent_5.type; - case 200: - case 162: + case 201: case 163: + case 164: + case 136: case 135: case 134: - case 133: - case 136: case 137: - return node === parent_5.type; case 138: + return node === parent_5.type; case 139: case 140: + case 141: return node === parent_5.type; - case 160: + case 161: return node === parent_5.type; - case 157: case 158: - return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; case 159: + return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; + case 160: return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 126) { + while (nodeOnRightSide.parent.kind === 127) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 209) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 214) { + if (nodeOnRightSide.parent.kind === 215) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -17706,10 +17834,10 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 214) { + if (entityName.parent.kind === 215) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 155) { + if (entityName.kind !== 156) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } @@ -17730,14 +17858,14 @@ var ts; var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 155) { + else if (entityName.kind === 156) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 126) { + else if (entityName.kind === 127) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -17746,7 +17874,7 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 141 ? 793056 : 1536; + var meaning = entityName.parent.kind === 142 ? 793056 : 1536; meaning |= 8388608; return resolveEntityName(entityName, meaning); } @@ -17760,14 +17888,14 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 214 + return node.parent.kind === 215 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 65: - case 155: - case 126: + case 156: + case 127: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 93: case 91: @@ -17775,7 +17903,7 @@ var ts; return type.symbol; case 114: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 135) { + if (constructorDeclaration && constructorDeclaration.kind === 136) { return constructorDeclaration.parent.symbol; } return undefined; @@ -17783,12 +17911,12 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 209 || node.parent.kind === 215) && + ((node.parent.kind === 210 || node.parent.kind === 216) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: - if (node.parent.kind == 156 && node.parent.argumentExpression === node) { + if (node.parent.kind == 157 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -17802,7 +17930,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 225) { + if (location && location.kind === 226) { return resolveEntityName(location.name, 107455); } return undefined; @@ -17876,7 +18004,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 228; } function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { if (languageVersion >= 2) { @@ -17884,7 +18012,7 @@ var ts; } var node = getDeclarationOfAliasSymbol(symbol); if (node) { - if (node.kind === 210) { + if (node.kind === 211) { var defaultKeyword; if (languageVersion === 0) { defaultKeyword = "[\"default\"]"; @@ -17894,7 +18022,7 @@ var ts; } return getGeneratedNameForNode(node.parent) + defaultKeyword; } - if (node.kind === 213) { + if (node.kind === 214) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); var propertyName = node.propertyName || node.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -17903,7 +18031,7 @@ var ts; } function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { - if (languageVersion >= 2) { + if (languageVersion >= 2 || compilerOptions.module === 4) { return undefined; } return "exports." + ts.unescapeIdentifier(symbol.name); @@ -17911,7 +18039,7 @@ var ts; var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 206 || node.kind === 205) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; @@ -17934,22 +18062,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 208: - case 210: + case 209: case 211: - case 213: - case 217: + case 212: + case 214: + case 218: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 215: + case 216: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 214: + case 215: return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 228 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -17994,7 +18122,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 226) { + if (node.kind === 227) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -18025,7 +18153,7 @@ var ts; } } function serializeTypeReferenceNode(node, getGeneratedNameForNode) { - var type = getTypeFromTypeReference(node); + var type = getTypeFromTypeNode(node); if (type.flags & 16) { return "void 0"; } @@ -18062,26 +18190,26 @@ var ts; switch (node.kind) { case 99: return "void 0"; - case 149: + case 150: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 142: case 143: + case 144: return "Function"; - case 146: case 147: + case 148: return "Array"; case 113: return "Boolean"; - case 121: + case 122: case 8: return "String"; - case 119: + case 120: return "Number"; - case 141: + case 142: return serializeTypeReferenceNode(node, getGeneratedNameForNode); - case 144: case 145: - case 148: + case 146: + case 149: case 112: break; default: @@ -18093,11 +18221,11 @@ var ts; } function serializeTypeOfNode(node, getGeneratedNameForNode) { switch (node.kind) { - case 201: return "Function"; - case 132: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 129: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 136: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 137: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + case 202: return "Function"; + case 133: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 130: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 138: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); } if (ts.isFunctionLike(node)) { return "Function"; @@ -18107,7 +18235,7 @@ var ts; function serializeParameterTypesOfNode(node, getGeneratedNameForNode) { if (node) { var valueDeclaration; - if (node.kind === 201) { + if (node.kind === 202) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -18122,10 +18250,10 @@ var ts; for (var i = 0; i < parameterCount; i++) { if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 146) { + if (parameterType.kind === 147) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 141 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 142 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -18171,15 +18299,21 @@ var ts; ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); return !!resolveName(location, name, 107455, undefined, undefined); } + function getReferencedValueDeclaration(reference) { + ts.Debug.assert(!ts.nodeIsSynthesized(reference)); + var symbol = getNodeLinks(reference).resolvedSymbol || + resolveName(reference, reference.text, 107455 | 8388608, undefined, undefined); + return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && n.parent.name === n); + var isVariableDeclarationOrBindingElement = n.parent.kind === 153 || (n.parent.kind === 199 && n.parent.name === n); var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 107455 | 8388608, undefined, undefined); var isLetOrConst = symbol && (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 223; + symbol.valueDeclaration.parent.kind !== 224; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -18216,6 +18350,7 @@ var ts; resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId, + getReferencedValueDeclaration: getReferencedValueDeclaration, serializeTypeOfNode: serializeTypeOfNode, serializeParameterTypesOfNode: serializeParameterTypesOfNode, serializeReturnTypeOfNode: serializeReturnTypeOfNode @@ -18264,7 +18399,7 @@ var ts; (102 <= node.originalKeywordKind && node.originalKeywordKind <= 110); } function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { - if (ts.getAncestor(identifier, 201) || ts.getAncestor(identifier, 174)) { + if (ts.getAncestor(identifier, 202) || ts.getAncestor(identifier, 175)) { return grammarErrorOnNode(identifier, message, arg0); } return false; @@ -18274,14 +18409,14 @@ var ts; var impotClause = node.importClause; if (impotClause.namedBindings) { var nameBindings = impotClause.namedBindings; - if (nameBindings.kind === 211) { + if (nameBindings.kind === 212) { var name_11 = nameBindings.name; if (isReservedWordInStrictMode(name_11)) { var nameText = ts.declarationNameToString(name_11); return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } } - else if (nameBindings.kind === 212) { + else if (nameBindings.kind === 213) { var reportError = false; for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -18302,20 +18437,20 @@ var ts; if (name && name.kind === 65 && isReservedWordInStrictMode(name)) { var nameText = ts.declarationNameToString(name); switch (node.kind) { + case 130: + case 199: + case 201: case 129: - case 198: - case 200: - case 128: - case 152: - case 202: + case 153: case 203: case 204: - return checkGrammarIdentifierInStrictMode(name); - case 201: - return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); case 205: + return checkGrammarIdentifierInStrictMode(name); + case 202: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + case 206: return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - case 208: + case 209: return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } } @@ -18325,17 +18460,17 @@ var ts; if (typeName.kind === 65) { checkGrammarTypeNameInStrictMode(typeName); } - else if (typeName.kind === 126) { + else if (typeName.kind === 127) { checkGrammarTypeNameInStrictMode(typeName.right); checkGrammarTypeReferenceInStrictMode(typeName.left); } } - function checkGrammarHeritageClauseElementInStrictMode(expression) { + function checkGrammarExpressionWithTypeArgumentsInStrictMode(expression) { if (expression && expression.kind === 65) { return checkGrammarIdentifierInStrictMode(expression); } - else if (expression && expression.kind === 155) { - checkGrammarHeritageClauseElementInStrictMode(expression.expression); + else if (expression && expression.kind === 156) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(expression.expression); } } function checkGrammarIdentifierInStrictMode(node, nameText) { @@ -18368,7 +18503,7 @@ var ts; else if (languageVersion < 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } - else if (node.kind === 136 || node.kind === 137) { + else if (node.kind === 137 || node.kind === 138) { 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); @@ -18378,26 +18513,26 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 136: case 137: - case 135: - case 132: - case 131: - case 134: + case 138: + case 136: case 133: - case 140: - case 201: + case 132: + case 135: + case 134: + case 141: case 202: - case 205: - case 204: - case 180: - case 200: case 203: + case 206: + case 205: + case 181: + case 201: + case 204: + case 210: case 209: - case 208: + case 216: case 215: - case 214: - case 129: + case 130: break; default: return false; @@ -18431,7 +18566,7 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 207 || node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -18440,10 +18575,10 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 207 || node.parent.kind === 228) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 129) { + else if (node.kind === 130) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128; @@ -18456,10 +18591,10 @@ var ts; else if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 202) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 129) { + else if (node.kind === 130) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; @@ -18468,13 +18603,13 @@ var ts; if (flags & 2) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 202) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 129) { + else if (node.kind === 130) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 207) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -18482,7 +18617,7 @@ var ts; break; } } - if (node.kind === 135) { + if (node.kind === 136) { if (flags & 128) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -18493,13 +18628,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 209 || node.kind === 208) && flags & 2) { + else if ((node.kind === 210 || node.kind === 209) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 202 && flags & 2) { + else if (node.kind === 203 && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 130 && (flags & 112) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -18562,7 +18697,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 163) { + if (node.kind === 164) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -18597,7 +18732,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { + if (parameter.type.kind !== 122 && parameter.type.kind !== 120) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -18629,7 +18764,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 175) { + if (arg.kind === 176) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -18700,11 +18835,11 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 127) { + if (node.kind !== 128) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 170 && computedPropertyName.expression.operatorToken.kind === 23) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -18731,26 +18866,26 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; var name_13 = prop.name; - if (prop.kind === 175 || - name_13.kind === 127) { + if (prop.kind === 176 || + name_13.kind === 128) { checkGrammarComputedPropertyName(name_13); continue; } var currentKind = void 0; - if (prop.kind === 224 || prop.kind === 225) { + if (prop.kind === 225 || prop.kind === 226) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_13.kind === 7) { checkGrammarNumericLiteral(name_13); } currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 135) { currentKind = Property; } - else if (prop.kind === 136) { + else if (prop.kind === 137) { currentKind = GetAccessor; } - else if (prop.kind === 137) { + else if (prop.kind === 138) { currentKind = SetAccesor; } else { @@ -18784,24 +18919,24 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 199) { + if (forInOrOfStatement.initializer.kind === 200) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 188 ? 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 188 ? 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 === 187 + var diagnostic = forInOrOfStatement.kind === 188 ? 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); @@ -18824,10 +18959,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 136 && accessor.parameters.length) { + else if (kind === 137 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 137) { + else if (kind === 138) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -18852,7 +18987,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 128 && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -18862,7 +18997,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 154) { + if (node.parent.kind === 155) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -18870,7 +19005,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 201) { + if (node.parent.kind === 202) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -18881,22 +19016,22 @@ 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 === 202) { + else if (node.parent.kind === 203) { 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 === 145) { + else if (node.parent.kind === 146) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 186: case 187: case 188: - case 184: + case 189: case 185: + case 186: return true; - case 194: + case 195: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -18908,9 +19043,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 194: + case 195: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 189 + var isMisplacedContinueLabel = node.kind === 190 && !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); @@ -18918,8 +19053,8 @@ var ts; return false; } break; - case 193: - if (node.kind === 190 && !node.label) { + case 194: + if (node.kind === 191 && !node.label) { return false; } break; @@ -18932,13 +19067,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 190 + var message = node.kind === 191 ? 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 === 190 + var message = node.kind === 191 ? 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); @@ -18947,10 +19082,10 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== elements[elements.length - 1]) { + 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 === 151 || node.name.kind === 150) { + if (node.name.kind === 152 || node.name.kind === 151) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -18960,7 +19095,7 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { + if (node.parent.parent.kind !== 188 && node.parent.parent.kind !== 189) { if (ts.isInAmbientContext(node)) { if (node.initializer) { var equalsTokenLength = "=".length; @@ -18990,7 +19125,7 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - if (element.kind !== 175) { + if (element.kind !== 176) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -19007,15 +19142,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 183: case 184: case 185: - case 192: case 186: + case 193: case 187: case 188: + case 189: return false; - case 194: + case 195: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -19031,7 +19166,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 167) { + if (expression.kind === 168) { var unaryExpression = expression; if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { expression = unaryExpression.operand; @@ -19050,7 +19185,7 @@ var ts; var inAmbientContext = ts.isInAmbientContext(enumDecl); for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 127) { + if (node.name.kind === 128) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -19120,18 +19255,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 201) { + if (node.parent.kind === 202) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 202) { + else if (node.parent.kind === 203) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 145) { + else if (node.parent.kind === 146) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -19141,11 +19276,11 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 202 || + if (node.kind === 203 || + node.kind === 210 || node.kind === 209 || - node.kind === 208 || + node.kind === 216 || node.kind === 215 || - node.kind === 214 || (node.flags & 2) || (node.flags & (1 | 256))) { return false; @@ -19155,7 +19290,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 === 180) { + if (ts.isDeclaration(decl) || decl.kind === 181) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -19174,7 +19309,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 === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + if (node.parent.kind === 180 || node.parent.kind === 207 || node.parent.kind === 228) { 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); @@ -19217,10 +19352,6 @@ var ts; return diagnostics; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -19248,7 +19379,7 @@ var ts; ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } @@ -19259,7 +19390,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 209); + ts.Debug.assert(aliasEmitInfo.node.kind === 210); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0); writeImportDeclaration(aliasEmitInfo.node); @@ -19272,11 +19403,11 @@ var ts; else { var emittedReferencedFiles = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && + if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); @@ -19332,10 +19463,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 198) { + if (declaration.kind === 199) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + else if (declaration.kind === 213 || declaration.kind === 214 || declaration.kind === 211) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -19346,7 +19477,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 209) { + if (moduleElementEmitInfo.node.kind === 210) { moduleElementEmitInfo.isVisible = true; } else { @@ -19354,12 +19485,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 206) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 206) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -19447,39 +19578,39 @@ var ts; function emitType(type) { switch (type.kind) { case 112: - case 121: - case 119: - case 113: case 122: + case 120: + case 113: + case 123: case 99: case 8: return writeTextOfNode(currentSourceFile, type); case 177: - return emitHeritageClauseElement(type); - case 141: - return emitTypeReference(type); - case 144: - return emitTypeQuery(type); - case 146: - return emitArrayType(type); - case 147: - return emitTupleType(type); - case 148: - return emitUnionType(type); - case 149: - return emitParenType(type); + return emitExpressionWithTypeArguments(type); case 142: - case 143: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 145: + return emitTypeQuery(type); + case 147: + return emitArrayType(type); + case 148: + return emitTupleType(type); + case 149: + return emitUnionType(type); + case 150: + return emitParenType(type); + case 143: + case 144: + return emitSignatureDeclarationWithJsDocComments(type); + case 146: return emitTypeLiteral(type); case 65: return emitEntityName(type); - case 126: + case 127: return emitEntityName(type); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 209 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -19487,17 +19618,17 @@ var ts; writeTextOfNode(currentSourceFile, entityName); } else { - var left = entityName.kind === 126 ? entityName.left : entityName.expression; - var right = entityName.kind === 126 ? entityName.right : entityName.name; + var left = entityName.kind === 127 ? entityName.left : entityName.expression; + var right = entityName.kind === 127 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentSourceFile, right); } } } - function emitHeritageClauseElement(node) { - if (ts.isSupportedHeritageClauseElement(node)) { - ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + function emitExpressionWithTypeArguments(node) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { + ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 156); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -19601,10 +19732,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 208 || - (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + else if (node.kind === 209 || + (node.parent.kind === 228 && ts.isExternalModule(currentSourceFile))) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 228) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -19613,7 +19744,7 @@ var ts; }); } else { - if (node.kind === 209) { + if (node.kind === 210) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -19631,23 +19762,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 200: - return writeFunctionDeclaration(node); - case 180: - return writeVariableStatement(node); - case 202: - return writeInterfaceDeclaration(node); case 201: - return writeClassDeclaration(node); + return writeFunctionDeclaration(node); + case 181: + return writeVariableStatement(node); case 203: - return writeTypeAliasDeclaration(node); + return writeInterfaceDeclaration(node); + case 202: + return writeClassDeclaration(node); case 204: - return writeEnumDeclaration(node); + return writeTypeAliasDeclaration(node); case 205: + return writeEnumDeclaration(node); + case 206: return writeModuleDeclaration(node); - case 208: - return writeImportEqualsDeclaration(node); case 209: + return writeImportEqualsDeclaration(node); + case 210: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -19661,7 +19792,7 @@ var ts; if (node.flags & 256) { write("default "); } - else if (node.kind !== 202) { + else if (node.kind !== 203) { write("declare "); } } @@ -19705,7 +19836,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 211) { + if (namedBindings.kind === 212) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -19731,7 +19862,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 212) { write("* as "); writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); } @@ -19782,7 +19913,7 @@ var ts; emitModuleElementDeclarationFlags(node); write("module "); writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 206) { + while (node.body.kind !== 207) { node = node.body; write("."); writeTextOfNode(currentSourceFile, node.name); @@ -19843,7 +19974,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 134 && (node.parent.flags & 32); + return node.parent.kind === 135 && (node.parent.flags & 32); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -19853,15 +19984,15 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 142 || - node.parent.kind === 143 || - (node.parent.parent && node.parent.parent.kind === 145)) { - ts.Debug.assert(node.parent.kind === 134 || - node.parent.kind === 133 || - node.parent.kind === 142 || + if (node.parent.kind === 143 || + node.parent.kind === 144 || + (node.parent.parent && node.parent.parent.kind === 146)) { + ts.Debug.assert(node.parent.kind === 135 || + node.parent.kind === 134 || node.parent.kind === 143 || - node.parent.kind === 138 || - node.parent.kind === 139); + node.parent.kind === 144 || + node.parent.kind === 139 || + node.parent.kind === 140); emitType(node.constraint); } else { @@ -19871,31 +20002,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 201: + case 202: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 202: + case 203: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 139: + case 140: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 138: + case 139: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 135: case 134: - case 133: if (node.parent.flags & 128) { 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 === 201) { + else if (node.parent.parent.kind === 202) { 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 200: + case 201: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -19920,12 +20051,12 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - if (ts.isSupportedHeritageClauseElement(node)) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 201) { + if (node.parent.parent.kind === 202) { 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; @@ -20002,16 +20133,16 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 199 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + if ((node.kind === 133 || node.kind === 132) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + if ((node.kind === 133 || node.kind === 132) && node.parent.kind === 146) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 32)) { @@ -20020,14 +20151,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 198) { + if (node.kind === 199) { 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 === 132 || node.kind === 131) { + else if (node.kind === 133 || node.kind === 132) { if (node.flags & 128) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -20035,7 +20166,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 === 201) { + else if (node.parent.kind === 202) { 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 : @@ -20061,7 +20192,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 175) { + if (element.kind !== 176) { elements.push(element); } } @@ -20127,7 +20258,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 137 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -20140,7 +20271,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 136 + return accessor.kind === 137 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -20149,7 +20280,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 137) { + if (accessorWithTypeAnnotation.kind === 138) { if (accessorWithTypeAnnotation.parent.flags & 128) { 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 : @@ -20195,17 +20326,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 200) { + if (node.kind === 201) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 134) { + else if (node.kind === 135) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 200) { + if (node.kind === 201) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 135) { + else if (node.kind === 136) { write("constructor"); } else { @@ -20222,11 +20353,11 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 139 || node.kind === 143) { + if (node.kind === 140 || node.kind === 144) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 140) { + if (node.kind === 141) { write("["); } else { @@ -20235,20 +20366,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 140) { + if (node.kind === 141) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; - if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { + var isFunctionTypeOrConstructorType = node.kind === 143 || node.kind === 144; + if (isFunctionTypeOrConstructorType || node.parent.kind === 146) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 135 && !(node.flags & 32)) { + else if (node.kind !== 136 && !(node.flags & 32)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -20259,23 +20390,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 139: + case 140: 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 138: + case 139: 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 140: + case 141: 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 135: case 134: - case 133: if (node.flags & 128) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -20283,7 +20414,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 === 201) { + else if (node.parent.kind === 202) { 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 : @@ -20296,7 +20427,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 200: + case 201: 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 : @@ -20328,9 +20459,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 142 || - node.parent.kind === 143 || - node.parent.parent.kind === 145) { + if (node.parent.kind === 143 || + node.parent.kind === 144 || + node.parent.parent.kind === 146) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { @@ -20346,22 +20477,22 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 135: + case 136: 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 139: + case 140: 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 138: + case 139: 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 135: case 134: - case 133: if (node.parent.flags & 128) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -20369,7 +20500,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 === 201) { + else if (node.parent.parent.kind === 202) { 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 : @@ -20381,7 +20512,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 200: + case 201: 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 : @@ -20392,12 +20523,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 150) { + if (bindingPattern.kind === 151) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 151) { + else if (bindingPattern.kind === 152) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -20416,10 +20547,10 @@ var ts; typeName: bindingElement.name } : undefined; } - if (bindingElement.kind === 175) { + if (bindingElement.kind === 176) { write(" "); } - else if (bindingElement.kind === 152) { + else if (bindingElement.kind === 153) { if (bindingElement.propertyName) { writeTextOfNode(currentSourceFile, bindingElement.propertyName); write(": "); @@ -20442,39 +20573,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 200: - case 205: - case 208: - case 202: case 201: - case 203: - case 204: - return emitModuleElement(node, isModuleElementVisible(node)); - case 180: - return emitModuleElement(node, isVariableStatementVisible(node)); + case 206: case 209: + case 203: + case 202: + case 204: + case 205: + return emitModuleElement(node, isModuleElementVisible(node)); + case 181: + return emitModuleElement(node, isVariableStatementVisible(node)); + case 210: return emitModuleElement(node, !node.importClause); - case 215: + case 216: return emitExportDeclaration(node); + case 136: case 135: case 134: - case 133: return writeFunctionDeclaration(node); - case 139: - case 138: case 140: + case 139: + case 141: return emitSignatureDeclarationWithJsDocComments(node); - case 136: case 137: + case 138: return emitAccessorDeclaration(node); + case 133: case 132: - case 131: return emitPropertyDeclaration(node); - case 226: - return emitEnumMemberDeclaration(node); - case 214: - return emitExportAssignment(node); case 227: + return emitEnumMemberDeclaration(node); + case 215: + return emitExportAssignment(node); + case 228: return emitSourceFile(node); } } @@ -20515,14 +20646,18 @@ var ts; /// var ts; (function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { - var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; - var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; - var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; - var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; + var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\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 compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; - var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var diagnostics = []; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { @@ -20577,6 +20712,7 @@ var ts; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; var currentSourceFile; + var exportFunctionForFile; var generatedNameSet = {}; var nodeToGeneratedName = []; var blockScopedVariableToGeneratedName; @@ -20594,14 +20730,14 @@ var ts; var writeEmittedFiles = writeJavaScriptFile; var detachedCommentsInfo; var writeComment = ts.writeCommentRange; - var emitSourceFileStart = function (node) { }; + var emit = emitNodeWithoutSourceMap; var emitStart = function (node) { }; var emitEnd = function (node) { }; var emitToken = emitTokenText; var scopeEmitStart = function (scopeDeclaration, scopeName) { }; var scopeEmitEnd = function () { }; var sourceMapData; - if (compilerOptions.sourceMap) { + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { initializeEmitterWithSourceMaps(); } if (root) { @@ -20609,7 +20745,7 @@ var ts; } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { emitSourceFile(sourceFile); } }); @@ -20619,6 +20755,7 @@ var ts; return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + exportFunctionForFile = undefined; emit(sourceFile); } function isUniqueName(name) { @@ -20695,25 +20832,25 @@ var ts; } function generateNameForNode(node) { switch (node.kind) { - case 200: case 201: - case 174: + case 202: + case 175: generateNameForFunctionOrClassDeclaration(node); break; - case 205: + case 206: generateNameForModuleOrEnum(node); generateNameForNode(node.body); break; - case 204: + case 205: generateNameForModuleOrEnum(node); break; - case 209: + case 210: generateNameForImportDeclaration(node); break; - case 215: + case 216: generateNameForExportDeclaration(node); break; - case 214: + case 215: generateNameForExportAssignment(node); break; } @@ -20731,7 +20868,7 @@ var ts; var sourceMapNameIndexMap = {}; var sourceMapNameIndices = []; function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; } var lastRecordedSourceMapSpan; var lastEncodedSourceMapSpan = { @@ -20839,6 +20976,12 @@ var ts; sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; sourceMapData.inputSourceFileNames.push(node.fileName); + if (compilerOptions.inlineSources) { + if (!sourceMapData.sourceMapSourcesContent) { + sourceMapData.sourceMapSourcesContent = []; + } + sourceMapData.sourceMapSourcesContent.push(node.text); + } } function recordScopeNameOfNode(node, scopeName) { function recordScopeNameIndex(scopeNameIndex) { @@ -20850,7 +20993,7 @@ var ts; var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { var name_17 = node.name; - if (!name_17 || name_17.kind !== 127) { + if (!name_17 || name_17.kind !== 128) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -20867,18 +21010,18 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 200 || - node.kind === 162 || + else if (node.kind === 201 || + node.kind === 163 || + node.kind === 135 || node.kind === 134 || - node.kind === 133 || - node.kind === 136 || node.kind === 137 || - node.kind === 205 || - node.kind === 201 || - node.kind === 204) { + node.kind === 138 || + node.kind === 206 || + node.kind === 202 || + node.kind === 205) { if (node.name) { var name_18 = node.name; - scopeName = name_18.kind === 127 + scopeName = name_18.kind === 128 ? ts.getTextOfNode(name_18) : node.name.text; } @@ -20897,18 +21040,22 @@ var ts; ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { + function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { if (typeof JSON !== "undefined") { - return JSON.stringify({ + var map_1 = { version: version, file: file, sourceRoot: sourceRoot, sources: sources, names: names, mappings: mappings - }); + }; + if (sourcesContent !== undefined) { + map_1.sourcesContent = sourcesContent; + } + return JSON.stringify(map_1); } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; + return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; function serializeStringArray(list) { var output = ""; for (var i = 0, n = list.length; i < n; i++) { @@ -20922,9 +21069,18 @@ var ts; } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); + var sourceMapUrl; + if (compilerOptions.inlineSourceMap) { + var base64SourceMapText = ts.convertToBase64(sourceMapText); + sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; + } + else { + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); + sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; + } + writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); } var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); sourceMapData = { @@ -20936,6 +21092,7 @@ var ts; inputSourceFileNames: [], sourceMapNames: [], sourceMapMappings: "", + sourceMapSourcesContent: undefined, sourceMapDecodedMappings: [] }; sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); @@ -20958,8 +21115,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { + if (node) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node, false); + } + if (node.kind != 228) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); + recordEmitNodeEndSpan(node); + } + else { + recordNewSourceFileStart(node); + emitNodeWithoutSourceMap(node, false); + } + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emitSourceFileStart = recordNewSourceFileStart; + emit = emitNodeWithSourceMap; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -21120,7 +21293,7 @@ var ts; } function emitLiteral(node) { var text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === 8 || ts.isTemplateLiteralKind(node.kind))) { + if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) && (node.kind === 8 || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { @@ -21192,10 +21365,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 171) { + if (node.template.kind === 172) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 169 + var needsParens = templateSpan.expression.kind === 170 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -21219,7 +21392,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 161 + var needsParens = templateSpan.expression.kind !== 162 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -21252,11 +21425,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 157: case 158: - return parent.expression === template; case 159: - case 161: + return parent.expression === template; + case 160: + case 162: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -21264,7 +21437,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 169: + case 170: switch (expression.operatorToken.kind) { case 35: case 36: @@ -21276,8 +21449,8 @@ var ts; default: return -1; } - case 172: - case 170: + case 173: + case 171: return -1; default: return 1; @@ -21289,11 +21462,11 @@ var ts; emit(span.literal); } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 152); + ts.Debug.assert(node.kind !== 153); if (node.kind === 8) { emitLiteral(node); } - else if (node.kind === 127) { + else if (node.kind === 128) { if (ts.nodeIsDecorated(node.parent)) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; @@ -21324,36 +21497,36 @@ var ts; function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 129: - case 198: - case 152: + case 130: + case 199: + case 153: + case 133: case 132: - case 131: - case 224: case 225: case 226: + case 227: + case 135: case 134: - case 133: - case 200: - case 136: - case 137: - case 162: case 201: + case 137: + case 138: + case 163: case 202: - case 204: + case 203: case 205: - case 208: - case 210: + case 206: + case 209: case 211: + case 212: return parent.name === node; - case 213: - case 217: - return parent.name === node || parent.propertyName === node; - case 190: - case 189: case 214: + case 218: + return parent.name === node || parent.propertyName === node; + case 191: + case 190: + case 215: return false; - case 194: + case 195: return node.parent.label === node; } } @@ -21430,7 +21603,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emitVerbatimDeclarationName(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -21461,11 +21634,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 65: - case 153: - case 155: + case 154: case 156: case 157: - case 161: + case 158: + case 162: return false; } return true; @@ -21482,14 +21655,14 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 173) { + if (e.kind === 174) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < length && elements[i].kind !== 173) { + while (i < length && elements[i].kind !== 174) { i++; } write("["); @@ -21510,7 +21683,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 173; + return node.kind === 174; } function emitArrayLiteral(node) { var elements = node.elements; @@ -21571,7 +21744,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 136 || property.kind === 137) { + if (property.kind === 137 || property.kind === 138) { var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { continue; @@ -21622,13 +21795,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 224) { + if (property.kind === 225) { emit(property.initializer); } - else if (property.kind === 225) { + else if (property.kind === 226) { emitExpressionIdentifier(property.name); } - else if (property.kind === 134) { + else if (property.kind === 135) { emitFunctionDeclaration(property); } else { @@ -21660,7 +21833,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 === 127) { + if (properties[i].name.kind === 128) { numInitialNonComputedProperties = i; break; } @@ -21674,30 +21847,30 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(169, startsOnNewLine); + var result = ts.createSynthesizedNode(170, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(155); + var result = ts.createSynthesizedNode(156); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(20); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(156); + var result = ts.createSynthesizedNode(157); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } function parenthesizeForAccess(expr) { - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 && expr.kind !== 7) { + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 && expr.kind !== 7) { return expr; } - var node = ts.createSynthesizedNode(161); + var node = ts.createSynthesizedNode(162); node.expression = expr; return node; } @@ -21710,19 +21883,19 @@ var ts; if (languageVersion >= 2 && node.asteriskToken) { write("*"); } - emitVerbatimDeclarationName(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); if (languageVersion < 2) { write(": "); var generatedName = getGeneratedNameForIdentifier(node.name); @@ -21746,7 +21919,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 156 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -21776,7 +21949,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emitVerbatimDeclarationName(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -21794,10 +21967,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 173; }); + return ts.forEach(elements, function (e) { return e.kind === 174; }); } function skipParentheses(node) { - while (node.kind === 161 || node.kind === 160) { + while (node.kind === 162 || node.kind === 161) { node = node.expression; } return node; @@ -21818,12 +21991,12 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 155) { + if (expr.kind === 156) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 156) { + else if (expr.kind === 157) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); @@ -21864,7 +22037,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; + superCall = node.expression.kind === 156 && node.expression.expression.kind === 91; } if (superCall && languageVersion < 2) { write(".call("); @@ -21901,20 +22074,20 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 163) { - if (node.expression.kind === 160) { + if (!node.parent || node.parent.kind !== 164) { + if (node.expression.kind === 161) { var operand = node.expression.expression; - while (operand.kind == 160) { + while (operand.kind == 161) { operand = operand.expression; } - if (operand.kind !== 167 && + if (operand.kind !== 168 && + operand.kind !== 167 && operand.kind !== 166 && operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 168 && - operand.kind !== 158 && - !(operand.kind === 157 && node.parent.kind === 158) && - !(operand.kind === 162 && node.parent.kind === 157)) { + operand.kind !== 169 && + operand.kind !== 159 && + !(operand.kind === 158 && node.parent.kind === 159) && + !(operand.kind === 163 && node.parent.kind === 158)) { emit(operand); return; } @@ -21939,9 +22112,25 @@ var ts; write(" "); emit(node.expression); } + function isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node) { + if (!isCurrentFileSystemExternalModule() || node.kind !== 65 || ts.nodeIsSynthesized(node)) { + return false; + } + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 199 || node.parent.kind === 153); + var targetDeclaration = isVariableDeclarationOrBindingElement + ? node.parent + : resolver.getReferencedValueDeclaration(node); + return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); + } function emitPrefixUnaryExpression(node) { + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + } write(ts.tokenToString(node.operator)); - if (node.operand.kind === 167) { + if (node.operand.kind === 168) { var operand = node.operand; if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { write(" "); @@ -21951,23 +22140,73 @@ var ts; } } emit(node.operand); + if (exportChanged) { + write(")"); + } } function emitPostfixUnaryExpression(node) { - emit(node.operand); - write(ts.tokenToString(node.operator)); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + write("(" + exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + write(ts.tokenToString(node.operator)); + emit(node.operand); + if (node.operator === 38) { + write(") - 1)"); + } + else { + write(") + 1)"); + } + } + else { + emit(node.operand); + write(ts.tokenToString(node.operator)); + } + } + function shouldHoistDeclarationInSystemJsModule(node) { + return isSourceFileLevelDeclarationInSystemJsModule(node, false); + } + function isSourceFileLevelDeclarationInSystemJsModule(node, isExported) { + if (!node || languageVersion >= 2 || !isCurrentFileSystemExternalModule()) { + return false; + } + var current = node; + while (current) { + if (current.kind === 228) { + return !isExported || ((ts.getCombinedNodeFlags(node) & 1) !== 0); + } + else if (ts.isFunctionLike(current) || current.kind === 207) { + return false; + } + else { + current = current.parent; + } + } } function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 53 && - (node.left.kind === 154 || node.left.kind === 153)) { - emitDestructuring(node, node.parent.kind === 182); + (node.left.kind === 155 || node.left.kind === 154)) { + emitDestructuring(node, node.parent.kind === 183); } else { + var exportChanged = node.operatorToken.kind >= 53 && + node.operatorToken.kind <= 64 && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.left); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.left); + write("\", "); + } emit(node.left); var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + if (exportChanged) { + write(")"); + } } } function synthesizedNodeStartsOnNewLine(node) { @@ -21995,7 +22234,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 179) { + if (node && node.kind === 180) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -22010,12 +22249,12 @@ var ts; emitToken(14, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 206) { - ts.Debug.assert(node.parent.kind === 205); + if (node.kind === 207) { + ts.Debug.assert(node.parent.kind === 206); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 206) { + if (node.kind === 207) { emitTempDeclarations(true); } decreaseIndent(); @@ -22024,7 +22263,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 179) { + if (node.kind === 180) { write(" "); emit(node); } @@ -22036,7 +22275,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 163); + emitParenthesizedIf(node.expression, node.expression.kind === 164); write(";"); } function emitIfStatement(node) { @@ -22049,7 +22288,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(76, node.thenStatement.end); - if (node.elseStatement.kind === 183) { + if (node.elseStatement.kind === 184) { write(" "); emit(node.elseStatement); } @@ -22061,7 +22300,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 179) { + if (node.statement.kind === 180) { write(" "); } else { @@ -22077,7 +22316,10 @@ var ts; write(")"); emitEmbeddedStatement(node.statement); } - function emitStartOfVariableDeclarationList(decl, startPos) { + function tryEmitStartOfVariableDeclarationList(decl, startPos) { + if (shouldHoistVariable(decl, true)) { + return false; + } var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { @@ -22089,28 +22331,53 @@ var ts; } if (startPos !== undefined) { emitToken(tokenKind, startPos); + write(" "); } else { switch (tokenKind) { case 98: - return write("var "); + write("var "); + break; case 104: - return write("let "); + write("let "); + break; case 70: - return write("const "); + write("const "); + break; } } + return true; + } + function emitVariableDeclarationListSkippingUninitializedEntries(list) { + var started = false; + for (var _a = 0, _b = list.declarations; _a < _b.length; _a++) { + var decl = _b[_a]; + if (!decl.initializer) { + continue; + } + if (!started) { + started = true; + } + else { + write(", "); + } + emit(decl); + } + return started; } function emitForStatement(node) { var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 199) { + if (node.initializer && node.initializer.kind === 200) { var variableDeclarationList = node.initializer; - var declarations = variableDeclarationList.declarations; - emitStartOfVariableDeclarationList(declarations[0], endPos); - write(" "); - emitCommaList(declarations); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + if (startIsEmitted) { + emitCommaList(variableDeclarationList.declarations); + } + else { + emitVariableDeclarationListSkippingUninitializedEntries(variableDeclarationList); + } } else if (node.initializer) { emit(node.initializer); @@ -22118,30 +22385,28 @@ var ts; write(";"); emitOptional(" ", node.condition); write(";"); - emitOptional(" ", node.iterator); + emitOptional(" ", node.incrementor); write(")"); emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 188) { + if (languageVersion < 2 && node.kind === 189) { return emitDownLevelForOfStatement(node); } var endPos = emitToken(82, node.pos); write(" "); endPos = emitToken(16, endPos); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - var decl = variableDeclarationList.declarations[0]; - emitStartOfVariableDeclarationList(decl, endPos); - write(" "); - emit(decl); + tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 187) { + if (node.kind === 188) { write(" in "); } else { @@ -22180,27 +22445,27 @@ var ts; var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); emitStart(node.expression); write("var "); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); if (!rhsIsIdentifier) { write(", "); emitStart(node.expression); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(" = "); - emitWithoutSourceMap(node.expression); + emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } write("; "); emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" < "); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(".length"); emitEnd(node.initializer); write("; "); emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); emitToken(17, node.expression.end); @@ -22209,7 +22474,7 @@ var ts; increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 200) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -22218,29 +22483,29 @@ var ts; emitDestructuring(declaration, false, rhsIterationValue); } else { - emitWithoutSourceMap(declaration); + emitNodeWithoutSourceMap(declaration); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { - emitWithoutSourceMap(createTempVariable(0)); + emitNodeWithoutSourceMap(createTempVariable(0)); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); - if (node.initializer.kind === 153 || node.initializer.kind === 154) { + if (node.initializer.kind === 154 || node.initializer.kind === 155) { emitDestructuring(assignmentExpression, true, undefined); } else { - emitWithoutSourceMap(assignmentExpression); + emitNodeWithoutSourceMap(assignmentExpression); } } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 179) { + if (node.statement.kind === 180) { emitLines(node.statement.statements); } else { @@ -22252,7 +22517,7 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 190 ? 66 : 71, node.pos); + emitToken(node.kind === 191 ? 66 : 71, node.pos); emitOptional(" ", node.label); write(";"); } @@ -22297,7 +22562,7 @@ var ts; ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 220) { + if (node.kind === 221) { write("case "); emit(node.expression); write(":"); @@ -22352,7 +22617,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 205); + } while (node && node.kind !== 206); return node; } function emitContainingModuleName(node) { @@ -22367,17 +22632,17 @@ var ts; write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < 2) { + else if (languageVersion < 2 && compilerOptions.module !== 4) { write("exports."); } } - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { var zero = ts.createSynthesizedNode(7); zero.text = "0"; - var result = ts.createSynthesizedNode(166); + var result = ts.createSynthesizedNode(167); result.expression = zero; return result; } @@ -22385,19 +22650,33 @@ var ts; if (node.flags & 1) { writeLine(); emitStart(node); - if (node.flags & 256) { - if (languageVersion === 0) { - write("exports[\"default\"]"); + if (compilerOptions.module === 4) { + write(exportFunctionForFile + "(\""); + if (node.flags & 256) { + write("default"); } else { - write("exports.default"); + emitNodeWithoutSourceMap(node.name); } + write("\", "); + emitDeclarationName(node); + write(")"); } else { - emitModuleMemberName(node); + if (node.flags & 256) { + if (languageVersion === 0) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); } - write(" = "); - emitNameOfDeclaration(node); emitEnd(node); write(";"); } @@ -22407,21 +22686,40 @@ var ts; for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { var specifier = _b[_a]; writeLine(); - emitStart(specifier.name); - emitContainingModuleName(specifier); - write("."); - emitWithoutSourceMap(specifier.name); - emitEnd(specifier.name); - write(" = "); - emitExpressionIdentifier(name); + if (compilerOptions.module === 4) { + emitStart(specifier.name); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(specifier.name); + write("\", "); + emitExpressionIdentifier(name); + write(")"); + emitEnd(specifier.name); + } + else { + emitStart(specifier.name); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier.name); + write(" = "); + emitExpressionIdentifier(name); + } write(";"); } } } function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; - var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; - if (root.kind === 169) { + var canDefineTempVariablesInPlace = false; + if (root.kind === 199) { + var isExported = ts.getCombinedNodeFlags(root) & 1; + var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); + canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; + } + else if (root.kind === 130) { + canDefineTempVariablesInPlace = true; + } + if (root.kind === 170) { emitAssignmentExpression(root); } else { @@ -22433,7 +22731,14 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 199 || name.parent.kind === 153); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(name); + write("\", "); + } + if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } else { @@ -22441,11 +22746,14 @@ var ts; } write(" = "); emit(value); + if (exportChanged) { + write(")"); + } } function ensureIdentifier(expr) { if (expr.kind !== 65) { var identifier = createTempVariable(0); - if (!isDeclaration) { + if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -22455,14 +22763,14 @@ var ts; } function createDefaultValueCheck(value, defaultValue) { value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(169); + var equals = ts.createSynthesizedNode(170); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(30); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(170); + var cond = ts.createSynthesizedNode(171); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50); cond.whenTrue = whenTrue; @@ -22482,7 +22790,7 @@ var ts; return createPropertyAccessExpression(object, propName); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(157); + var call = ts.createSynthesizedNode(158); var sliceIdentifier = ts.createSynthesizedNode(65); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -22497,7 +22805,7 @@ var ts; } for (var _a = 0; _a < properties.length; _a++) { var p = properties[_a]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 225 || p.kind === 226) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } @@ -22510,8 +22818,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { + if (e.kind !== 176) { + if (e.kind !== 174) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -22521,14 +22829,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 170 && target.operatorToken.kind === 53) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 154) { + if (target.kind === 155) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 153) { + else if (target.kind === 154) { emitArrayLiteralAssignment(target, value); } else { @@ -22542,14 +22850,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 161) { + if (root.parent.kind !== 162) { write("("); } value = ensureIdentifier(value); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 161) { + if (root.parent.kind !== 162) { write(")"); } } @@ -22569,11 +22877,11 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 150) { + if (pattern.kind === 151) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 175) { + else if (element.kind !== 176) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } @@ -22600,22 +22908,31 @@ var ts; } else { renameNonTopLevelLetAndConst(node.name); - emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2) { var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); if (isUninitializedLet && - node.parent.parent.kind !== 187 && - node.parent.parent.kind !== 188) { + node.parent.parent.kind !== 188 && + node.parent.parent.kind !== 189) { initializer = createVoidZero(); } } + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.name); + write("\", "); + } + emitModuleMemberName(node); emitOptional(" = ", initializer); + if (exportChanged) { + write(")"); + } } } function emitExportVariableAssignments(node) { - if (node.kind === 175) { + if (node.kind === 176) { return; } var name = node.name; @@ -22627,7 +22944,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { + if (!node.parent || (node.parent.kind !== 199 && node.parent.kind !== 153)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -22636,24 +22953,24 @@ var ts; if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || node.kind !== 65 || - (node.parent.kind !== 198 && node.parent.kind !== 152)) { + (node.parent.kind !== 199 && node.parent.kind !== 153)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { return; } - var list = ts.getAncestor(node, 199); - if (list.parent.kind === 180) { - var isSourceFileLevelBinding = list.parent.parent.kind === 227; - var isModuleLevelBinding = list.parent.parent.kind === 206; - var isFunctionLevelBinding = list.parent.parent.kind === 179 && ts.isFunctionLike(list.parent.parent.parent); + var list = ts.getAncestor(node, 200); + if (list.parent.kind === 181) { + var isSourceFileLevelBinding = list.parent.parent.kind === 228; + var isModuleLevelBinding = list.parent.parent.kind === 207; + var isFunctionLevelBinding = list.parent.parent.kind === 180 && ts.isFunctionLike(list.parent.parent.parent); if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { return; } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 227 + var parent = blockScopeContainer.kind === 228 ? blockScopeContainer : blockScopeContainer.parent; if (resolver.resolvesToSomeValue(parent, node.text)) { @@ -22668,18 +22985,27 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 1) && languageVersion >= 2 && - node.parent.kind === 227; + node.parent.kind === 228; } function emitVariableStatement(node) { + var startIsEmitted = true; if (!(node.flags & 1)) { - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { write("export "); - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); + } + if (startIsEmitted) { + emitCommaList(node.declarationList.declarations); + write(";"); + } + else { + var atLeastOneItem = emitVariableDeclarationListSkippingUninitializedEntries(node.declarationList); + if (atLeastOneItem) { + write(";"); + } } - emitCommaList(node.declarationList.declarations); - write(";"); if (languageVersion < 2 && node.parent === currentSourceFile) { ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); } @@ -22724,14 +23050,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitWithoutSourceMap(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -22750,7 +23076,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -22771,7 +23097,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -22780,26 +23106,26 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 136 ? "get " : "set "); - emitVerbatimDeclarationName(node.name); + write(node.kind === 137 ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 163 && languageVersion >= 2; + return node.kind === 164 && languageVersion >= 2; } - function emitNameOfDeclaration(node) { + function emitDeclarationName(node) { if (node.name) { - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(getGeneratedNameForNode(node)); } } function shouldEmitFunctionName(node) { - if (node.kind === 162) { + if (node.kind === 163) { return !!node.name; } - if (node.kind === 200) { + if (node.kind === 201) { return !!node.name || languageVersion < 2; } } @@ -22807,6 +23133,9 @@ var ts; if (ts.nodeIsMissing(node.body)) { return emitOnlyPinnedOrTripleSlashComments(node); } + if (node.kind !== 135 && node.kind !== 134) { + emitLeadingComments(node); + } if (!shouldEmitAsArrowFunction(node)) { if (isES6ExportedDeclaration(node)) { write("export "); @@ -22821,12 +23150,15 @@ var ts; write(" "); } if (shouldEmitFunctionName(node)) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 && node.kind === 201 && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } + if (node.kind !== 135 && node.kind !== 134) { + emitTrailingComments(node); + } } function emitCaptureThisForNodeIfNecessary(node) { if (resolver.getNodeCheckFlags(node) & 4) { @@ -22871,7 +23203,7 @@ var ts; if (!node.body) { write(" { }"); } - else if (node.body.kind === 179) { + else if (node.body.kind === 180) { emitBlockFunctionBody(node, node.body); } else { @@ -22896,10 +23228,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 160) { + while (current.kind === 161) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 154); + emitParenthesizedIf(body, current.kind === 155); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -22971,9 +23303,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 182) { + if (statement && statement.kind === 183) { var expr = statement.expression; - if (expr && expr.kind === 157) { + if (expr && expr.kind === 158) { var func = expr.expression; if (func && func.kind === 91) { return statement; @@ -22989,7 +23321,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitWithoutSourceMap(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -23001,22 +23333,22 @@ var ts; function emitMemberAccessForPropertyName(memberName) { if (memberName.kind === 8 || memberName.kind === 7) { write("["); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 127) { + else if (memberName.kind === 128) { emitComputedPropertyName(memberName); } else { write("."); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); } } - function getInitializedProperties(node, static) { + function getInitializedProperties(node, isStatic) { var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 132 && static === ((member.flags & 128) !== 0) && member.initializer) { + if (member.kind === 133 && isStatic === ((member.flags & 128) !== 0) && member.initializer) { properties.push(member); } } @@ -23038,7 +23370,7 @@ var ts; } else { if (property.flags & 128) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } else { write("this"); @@ -23056,11 +23388,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 178) { + if (member.kind === 179) { writeLine(); write(";"); } - else if (member.kind === 134 || node.kind === 133) { + else if (member.kind === 135 || node.kind === 134) { if (!member.body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -23079,7 +23411,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 136 || member.kind === 137) { + else if (member.kind === 137 || member.kind === 138) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -23129,22 +23461,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 134 || node.kind === 133) && !member.body) { + if ((member.kind === 135 || node.kind === 134) && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === 134 || - member.kind === 136 || - member.kind === 137) { + else if (member.kind === 135 || + member.kind === 137 || + member.kind === 138) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 128) { write("static "); } - if (member.kind === 136) { + if (member.kind === 137) { write("get "); } - else if (member.kind === 137) { + else if (member.kind === 138) { write("set "); } if (member.asteriskToken) { @@ -23155,7 +23487,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 178) { + else if (member.kind === 179) { writeLine(); write(";"); } @@ -23176,10 +23508,10 @@ var ts; function emitConstructorWorker(node, baseTypeElement) { var hasInstancePropertyWithInitializer = false; ts.forEach(node.members, function (member) { - if (member.kind === 135 && !member.body) { + if (member.kind === 136 && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + if (member.kind === 133 && member.initializer && (member.flags & 128) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -23193,7 +23525,7 @@ var ts; emitStart(ctor || node); if (languageVersion < 2) { write("function "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitSignatureParameters(ctor); } else { @@ -23279,13 +23611,13 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 201) { + if (node.kind === 202) { if (thisNodeIsDecorated) { if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { write("export "); } write("let "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = "); } else if (isES6ExportedDeclaration(node)) { @@ -23296,7 +23628,7 @@ var ts; } } var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 175; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0); @@ -23308,7 +23640,7 @@ var ts; write("class"); if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { write(" "); - emitNameOfDeclaration(node); + emitDeclarationName(node); } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { @@ -23327,15 +23659,6 @@ var ts; scopeEmitEnd(); if (thisNodeIsDecorated) { write(";"); - if (node.name) { - writeLine(); - write("Object.defineProperty("); - emitNameOfDeclaration(node); - write(", \"name\", { value: \""); - emitNameOfDeclaration(node); - write("\", configurable: true });"); - writeLine(); - } } if (isClassExpressionWithStaticProperties) { for (var _a = 0; _a < staticProperties.length; _a++) { @@ -23360,21 +23683,23 @@ var ts; emitStart(node); emitModuleMemberName(node); write(" = "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitEnd(node); write(";"); } else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { writeLine(); write("export default "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(";"); } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 201) { - write("var "); - emitNameOfDeclaration(node); + if (node.kind === 202) { + if (!shouldHoistDeclarationInSystemJsModule(node)) { + write("var "); + } + emitDeclarationName(node); write(" = "); } write("(function ("); @@ -23397,7 +23722,7 @@ var ts; writeLine(); emitStart(baseTypeNode); write("__extends("); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(", _super);"); emitEnd(baseTypeNode); } @@ -23410,7 +23735,7 @@ var ts; writeLine(); emitToken(15, node.members.end, function () { write("return "); - emitNameOfDeclaration(node); + emitDeclarationName(node); }); write(";"); emitTempDeclarations(true); @@ -23428,11 +23753,11 @@ var ts; emit(baseTypeNode.expression); } write(")"); - if (node.kind === 201) { + if (node.kind === 202) { write(";"); } emitEnd(node); - if (node.kind === 201) { + if (node.kind === 202) { emitExportMemberAssignment(node); } if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { @@ -23440,7 +23765,7 @@ var ts; } } function emitClassMemberPrefix(node, member) { - emitNameOfDeclaration(node); + emitDeclarationName(node); if (!(member.flags & 128)) { write(".prototype"); } @@ -23459,7 +23784,7 @@ var ts; } writeLine(); emitStart(node); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); @@ -23474,7 +23799,7 @@ var ts; decreaseIndent(); writeLine(); write("], "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); @@ -23506,13 +23831,13 @@ var ts; } else { decorators = member.decorators; - if (member.kind === 134) { + if (member.kind === 135) { functionLikeMember = member; } } writeLine(); emitStart(member); - if (member.kind !== 132) { + if (member.kind !== 133) { write("Object.defineProperty("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -23542,7 +23867,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - if (member.kind !== 132) { + if (member.kind !== 133) { write(", Object.getOwnPropertyDescriptor("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -23581,26 +23906,26 @@ var ts; } function shouldEmitTypeMetadata(node) { switch (node.kind) { - case 134: - case 136: + case 135: case 137: - case 132: + case 138: + case 133: return true; } return false; } function shouldEmitReturnTypeMetadata(node) { switch (node.kind) { - case 134: + case 135: return true; } return false; } function shouldEmitParamTypesMetadata(node) { switch (node.kind) { - case 201: - case 134: - case 137: + case 202: + case 135: + case 138: return true; } return false; @@ -23760,7 +24085,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 205) { + if (moduleDeclaration.body.kind === 206) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -23776,7 +24101,9 @@ var ts; if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - if (!isModuleMergedWithES6Class(node)) { + var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); + var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); + if (emitVarForModule) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); @@ -23793,7 +24120,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 206) { + if (node.body.kind === 207) { var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; tempFlags = 0; @@ -23826,6 +24153,14 @@ var ts; write(" = {}));"); emitEnd(node); if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { + if (compilerOptions.module === 4 && (node.flags & 1)) { + writeLine(); + write(exportFunctionForFile + "(\""); + emitDeclarationName(node); + write("\", "); + emitDeclarationName(node); + write(")"); + } emitExportMemberAssignments(node.name); } } @@ -23842,16 +24177,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 212) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 209 && node.importClause && !!node.importClause.name; + return node.kind === 210 && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -23878,7 +24213,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 212) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -23904,7 +24239,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var isExportedImport = node.kind === 209 && (node.flags & 1) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2) { emitLeadingComments(node); @@ -23916,7 +24251,7 @@ var ts; write(" = "); } else { - var isNakedImport = 209 && !node.importClause; + var isNakedImport = 210 && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -23979,6 +24314,7 @@ var ts; } } function emitExportDeclaration(node) { + ts.Debug.assert(compilerOptions.module !== 4); if (languageVersion < 2) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); @@ -23998,11 +24334,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitWithoutSourceMap(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); } @@ -24036,7 +24372,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitWithoutSourceMap(node.moduleSpecifier); + emitNodeWithoutSourceMap(node.moduleSpecifier); } write(";"); emitEnd(node); @@ -24054,10 +24390,10 @@ var ts; } emitStart(specifier); if (specifier.propertyName) { - emitWithoutSourceMap(specifier.propertyName); + emitNodeWithoutSourceMap(specifier.propertyName); write(" as "); } - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier); needsComma = true; } @@ -24071,8 +24407,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 200 && - expression.kind !== 201) { + if (expression.kind !== 201 && + expression.kind !== 202) { write(";"); } emitEnd(node); @@ -24080,14 +24416,21 @@ var ts; else { writeLine(); emitStart(node); - emitContainingModuleName(node); - if (languageVersion === 0) { - write("[\"default\"] = "); + if (compilerOptions.module === 4) { + write(exportFunctionForFile + "(\"default\","); + emit(node.expression); + write(")"); } else { - write(".default = "); + emitContainingModuleName(node); + if (languageVersion === 0) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } + emit(node.expression); } - emit(node.expression); write(";"); emitEnd(node); } @@ -24101,18 +24444,18 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 209: + case 210: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { externalImports.push(node); } break; - case 208: - if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + case 209: + if (node.moduleReference.kind === 220 && resolver.isReferencedAliasDeclaration(node)) { externalImports.push(node); } break; - case 215: + case 216: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -24130,7 +24473,7 @@ var ts; } } break; - case 214: + case 215: if (node.isExportEquals && !exportEquals) { exportEquals = node; } @@ -24150,8 +24493,387 @@ var ts; write("}"); } } - function emitAMDModule(node, startIndex) { + function getLocalNameForExternalImport(importNode) { + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + return getGeneratedNameForNode(importNode); + } + } + function getExternalModuleNameText(importNode) { + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8) { + return getLiteralText(moduleName); + } + return undefined; + } + function emitVariableDeclarationsForImports() { + if (externalImports.length === 0) { + return; + } + writeLine(); + var started = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; + var skipNode = importNode.kind === 216 || + (importNode.kind === 210 && !importNode.importClause); + if (skipNode) { + continue; + } + if (!started) { + write("var "); + started = true; + } + else { + write(", "); + } + write(getLocalNameForExternalImport(importNode)); + } + if (started) { + write(";"); + } + } + function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { + if (!hasExportStars) { + return undefined; + } + if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { + var hasExportDeclarationWithExportClause = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var externalImport = externalImports[_a]; + if (externalImport.kind === 216 && externalImport.exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + if (!hasExportDeclarationWithExportClause) { + return emitExportStarFunction(undefined); + } + } + var exportedNamesStorageRef = makeUniqueName("exportedNames"); + writeLine(); + write("var " + exportedNamesStorageRef + " = {"); + increaseIndent(); + var started = false; + if (exportedDeclarations) { + for (var i = 0; i < exportedDeclarations.length; ++i) { + writeExportedName(exportedDeclarations[i]); + } + } + if (exportSpecifiers) { + for (var n in exportSpecifiers) { + for (var _b = 0, _c = exportSpecifiers[n]; _b < _c.length; _b++) { + var specifier = _c[_b]; + writeExportedName(specifier.name); + } + } + } + for (var _d = 0; _d < externalImports.length; _d++) { + var externalImport = externalImports[_d]; + if (externalImport.kind !== 216) { + continue; + } + var exportDecl = externalImport; + if (!exportDecl.exportClause) { + continue; + } + for (var _e = 0, _f = exportDecl.exportClause.elements; _e < _f.length; _e++) { + var element = _f[_e]; + writeExportedName(element.name || element.propertyName); + } + } + decreaseIndent(); + writeLine(); + write("};"); + return emitExportStarFunction(exportedNamesStorageRef); + function emitExportStarFunction(localNames) { + var exportStarFunction = makeUniqueName("exportStar"); + writeLine(); + write("function " + exportStarFunction + "(m) {"); + increaseIndent(); + writeLine(); + write("for(var n in m) {"); + increaseIndent(); + writeLine(); + write("if (n !== \"default\""); + if (localNames) { + write("&& !" + localNames + ".hasOwnProperty(n)"); + } + write(") " + exportFunctionForFile + "(n, m[n]);"); + decreaseIndent(); + writeLine(); + write("}"); + decreaseIndent(); + writeLine(); + write("}"); + return exportStarFunction; + } + function writeExportedName(node) { + if (node.kind !== 65 && node.flags & 256) { + return; + } + if (started) { + write(","); + } + else { + started = true; + } + writeLine(); + write("'"); + if (node.kind === 65) { + emitNodeWithoutSourceMap(node); + } + else { + emitDeclarationName(node); + } + write("': true"); + } + } + function processTopLevelVariableAndFunctionDeclarations(node) { + var hoistedVars; + var hoistedFunctionDeclarations; + var exportedDeclarations; + visit(node); + if (hoistedVars) { + writeLine(); + write("var "); + for (var i = 0; i < hoistedVars.length; ++i) { + var local = hoistedVars[i]; + if (i !== 0) { + write(", "); + } + if (local.kind === 202 || local.kind === 206) { + emitDeclarationName(local); + } + else { + emit(local); + } + var flags = ts.getCombinedNodeFlags(local.kind === 65 ? local.parent : local); + if (flags & 1) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(local); + } + } + write(";"); + } + if (hoistedFunctionDeclarations) { + for (var _a = 0; _a < hoistedFunctionDeclarations.length; _a++) { + var f = hoistedFunctionDeclarations[_a]; + writeLine(); + emit(f); + if (f.flags & 1) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(f); + } + } + } + return exportedDeclarations; + function visit(node) { + if (node.kind === 201) { + if (!hoistedFunctionDeclarations) { + hoistedFunctionDeclarations = []; + } + hoistedFunctionDeclarations.push(node); + return; + } + if (node.kind === 202) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 206 && shouldEmitModuleDeclaration(node)) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 199 || node.kind === 153) { + if (shouldHoistVariable(node, false)) { + var name_21 = node.name; + if (name_21.kind === 65) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(name_21); + } + else { + ts.forEachChild(name_21, visit); + } + } + return; + } + if (ts.isBindingPattern(node)) { + ts.forEach(node.elements, visit); + return; + } + if (!ts.isDeclaration(node)) { + ts.forEachChild(node, visit); + } + } + } + function shouldHoistVariable(node, checkIfSourceFileLevelDecl) { + if (checkIfSourceFileLevelDecl && !shouldHoistDeclarationInSystemJsModule(node)) { + return false; + } + return (ts.getCombinedNodeFlags(node) & 12288) === 0 || + ts.getEnclosingBlockScopeContainer(node).kind === 228; + } + function isCurrentFileSystemExternalModule() { + return compilerOptions.module === 4 && ts.isExternalModule(currentSourceFile); + } + function emitSystemModuleBody(node, startIndex) { + emitVariableDeclarationsForImports(); + writeLine(); + var exportedDeclarations = processTopLevelVariableAndFunctionDeclarations(node); + var exportStarFunction = emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations); + writeLine(); + write("return {"); + increaseIndent(); + writeLine(); + emitSetters(exportStarFunction); + writeLine(); + emitExecute(node, startIndex); + emitTempDeclarations(true); + decreaseIndent(); + writeLine(); + write("}"); + } + function emitSetters(exportStarFunction) { + write("setters:["); + for (var i = 0; i < externalImports.length; ++i) { + if (i !== 0) { + write(","); + } + writeLine(); + increaseIndent(); + var importNode = externalImports[i]; + var importVariableName = getLocalNameForExternalImport(importNode) || ""; + var parameterName = "_" + importVariableName; + write("function (" + parameterName + ") {"); + switch (importNode.kind) { + case 210: + if (!importNode.importClause) { + break; + } + case 209: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + writeLine(); + write(importVariableName + " = " + parameterName + ";"); + writeLine(); + var defaultName = importNode.kind === 210 + ? importNode.importClause.name + : importNode.name; + if (defaultName) { + emitExportMemberAssignments(defaultName); + writeLine(); + } + if (importNode.kind === 210 && + importNode.importClause.namedBindings) { + var namedBindings = importNode.importClause.namedBindings; + if (namedBindings.kind === 212) { + emitExportMemberAssignments(namedBindings.name); + writeLine(); + } + else { + for (var _a = 0, _b = namedBindings.elements; _a < _b.length; _a++) { + var element = _b[_a]; + emitExportMemberAssignments(element.name || element.propertyName); + writeLine(); + } + } + } + decreaseIndent(); + break; + case 216: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + if (importNode.exportClause) { + for (var _c = 0, _d = importNode.exportClause.elements; _c < _d.length; _c++) { + var e = _d[_c]; + writeLine(); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(e.name); + write("\", " + parameterName + "[\""); + emitNodeWithoutSourceMap(e.propertyName || e.name); + write("\"]);"); + } + } + else { + writeLine(); + write(exportStarFunction + "(" + parameterName + ");"); + } + writeLine(); + decreaseIndent(); + break; + } + write("}"); + decreaseIndent(); + } + write("],"); + } + function emitExecute(node, startIndex) { + write("execute: function() {"); + increaseIndent(); + writeLine(); + for (var i = startIndex; i < node.statements.length; ++i) { + var statement = node.statements[i]; + switch (statement.kind) { + case 216: + case 210: + case 209: + case 201: + continue; + } + writeLine(); + emit(statement); + } + decreaseIndent(); + writeLine(); + write("}"); + } + function emitSystemModule(node, startIndex) { collectExternalModuleInfo(node); + ts.Debug.assert(!exportFunctionForFile); + exportFunctionForFile = makeUniqueName("exports"); + write("System.register(["); + for (var i = 0; i < externalImports.length; ++i) { + var text = getExternalModuleNameText(externalImports[i]); + if (i !== 0) { + write(", "); + } + write(text); + } + write("], function(" + exportFunctionForFile + ") {"); + writeLine(); + increaseIndent(); + emitCaptureThisForNodeIfNecessary(node); + emitSystemModuleBody(node, startIndex); + decreaseIndent(); + writeLine(); + write("});"); + } + function emitAMDDependencies(node, includeNonAmdDependencies) { + // An AMD define function has the following shape: + // define(id?, dependencies?, factory); + // + // This has the shape of + // define(name, ["module1", "module2"], function (module1Alias) { + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` + // we need to add modules without alias names to the end of the dependencies list var aliasedModuleNames = []; var unaliasedModuleNames = []; var importAliasNames = []; @@ -24167,20 +24889,9 @@ var ts; } for (var _c = 0; _c < externalImports.length; _c++) { var importNode = externalImports[_c]; - var externalModuleName = ""; - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8) { - externalModuleName = getLiteralText(moduleName); - } - var importAliasName = void 0; - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); - } - else { - importAliasName = getGeneratedNameForNode(importNode); - } - if (importAliasName) { + var externalModuleName = getExternalModuleNameText(importNode); + var importAliasName = getLocalNameForExternalImport(importNode); + if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); importAliasNames.push(importAliasName); } @@ -24188,11 +24899,6 @@ var ts; unaliasedModuleNames.push(externalModuleName); } } - writeLine(); - write("define("); - if (node.amdModuleName) { - write("\"" + node.amdModuleName + "\", "); - } write("[\"require\", \"exports\""); if (aliasedModuleNames.length) { write(", "); @@ -24207,6 +24913,15 @@ var ts; write(", "); write(importAliasNames.join(", ")); } + } + function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); + writeLine(); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + emitAMDDependencies(node, true); write(") {"); increaseIndent(); emitExportStarHelper(); @@ -24226,6 +24941,21 @@ var ts; emitTempDeclarations(true); emitExportEquals(false); } + function emitUMDModule(node, startIndex) { + collectExternalModuleInfo(node); + writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})("); + emitAMDDependencies(node, false); + write(") {"); + increaseIndent(); + emitExportStarHelper(); + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + emitExportEquals(true); + decreaseIndent(); + writeLine(); + write("});"); + } function emitES6Module(node, startIndex) { externalImports = undefined; exportSpecifiers = undefined; @@ -24273,28 +25003,36 @@ var ts; writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); - if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { - writeLines(extendsHelper); - extendsEmitted = true; - } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { - writeLines(decorateHelper); - if (compilerOptions.emitDecoratorMetadata) { - writeLines(metadataHelper); + if (!compilerOptions.noEmitHelpers) { + if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { + writeLines(extendsHelper); + extendsEmitted = true; + } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } + decorateEmitted = true; + } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024) { + writeLines(paramHelper); + paramEmitted = true; } - decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024) { - writeLines(paramHelper); - paramEmitted = true; - } - if (ts.isExternalModule(node)) { + if (ts.isExternalModule(node) || compilerOptions.separateCompilation) { if (languageVersion >= 2) { emitES6Module(node, startIndex); } else if (compilerOptions.module === 2) { emitAMDModule(node, startIndex); } + else if (compilerOptions.module === 4) { + emitSystemModule(node, startIndex); + } + else if (compilerOptions.module === 3) { + emitUMDModule(node, startIndex); + } else { emitCommonJSModule(node, startIndex); } @@ -24310,81 +25048,57 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - function emit(node) { - emitNodeWorker(node, true, true); - } - function emitWithoutSourceMap(node) { - emitNodeWorker(node, false, true); - } - function emitVerbatimDeclarationName(node) { - emitNodeWorker(node, true, false); - } - function emitNodeWorker(node, shouldEmitSourceMap, allowGeneratedIdentifiers) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2) { - emitOnlyPinnedOrTripleSlashComments(node); - return; - } - if (node.kind === 227) { - if (shouldEmitSourceMap) { - emitSourceFileStart(node); - } - emitBareNode(node, allowGeneratedIdentifiers); - return; + return emitOnlyPinnedOrTripleSlashComments(node); } var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } - if (shouldEmitSourceMap && !ts.nodeIsSynthesized(node)) { - emitStart(node); - emitBareNode(node, allowGeneratedIdentifiers); - emitEnd(node); - } - else { - emitBareNode(node, allowGeneratedIdentifiers); - } + emitJavaScriptWorker(node, allowGeneratedIdentifiers); if (emitComments) { emitTrailingComments(node); } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 202: - case 209: - case 208: case 203: - case 214: - return false; - case 200: - return !!node.body; - case 205: - return shouldEmitModuleDeclaration(node); + case 201: + case 210: + case 209: case 204: + case 215: + return false; + case 206: + return shouldEmitModuleDeclaration(node); + case 205: return shouldEmitEnumDeclaration(node); } - if (node.kind !== 179 && + if (node.kind !== 180 && node.parent && - node.parent.kind === 163 && + node.parent.kind === 164 && node.parent.body === node && compilerOptions.target <= 1) { return false; } return true; } - function emitBareNode(node, allowGeneratedIdentifiers) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } switch (node.kind) { case 65: return emitIdentifier(node, allowGeneratedIdentifiers); - case 129: + case 130: return emitParameter(node); + case 135: case 134: - case 133: return emitMethod(node); - case 136: case 137: + case 138: return emitAccessor(node); case 93: return emitThis(node); @@ -24404,139 +25118,139 @@ var ts; case 12: case 13: return emitLiteral(node); - case 171: - return emitTemplateExpression(node); - case 176: - return emitTemplateSpan(node); - case 126: - return emitQualifiedName(node); - case 150: - return emitObjectBindingPattern(node); - case 151: - return emitArrayBindingPattern(node); - case 152: - return emitBindingElement(node); - case 153: - return emitArrayLiteral(node); - case 154: - return emitObjectLiteral(node); - case 224: - return emitPropertyAssignment(node); - case 225: - return emitShorthandPropertyAssignment(node); - case 127: - return emitComputedPropertyName(node); - case 155: - return emitPropertyAccess(node); - case 156: - return emitIndexedAccess(node); - case 157: - return emitCallExpression(node); - case 158: - return emitNewExpression(node); - case 159: - return emitTaggedTemplateExpression(node); - case 160: - return emit(node.expression); - case 161: - return emitParenExpression(node); - case 200: - case 162: - case 163: - return emitFunctionDeclaration(node); - case 164: - return emitDeleteExpression(node); - case 165: - return emitTypeOfExpression(node); - case 166: - return emitVoidExpression(node); - case 167: - return emitPrefixUnaryExpression(node); - case 168: - return emitPostfixUnaryExpression(node); - case 169: - return emitBinaryExpression(node); - case 170: - return emitConditionalExpression(node); - case 173: - return emitSpreadElementExpression(node); case 172: - return emitYieldExpression(node); - case 175: - return; - case 179: - case 206: - return emitBlock(node); - case 180: - return emitVariableStatement(node); - case 181: - return write(";"); - case 182: - return emitExpressionStatement(node); - case 183: - return emitIfStatement(node); - case 184: - return emitDoStatement(node); - case 185: - return emitWhileStatement(node); - case 186: - return emitForStatement(node); - case 188: - case 187: - return emitForInOrForOfStatement(node); - case 189: - case 190: - return emitBreakOrContinueStatement(node); - case 191: - return emitReturnStatement(node); - case 192: - return emitWithStatement(node); - case 193: - return emitSwitchStatement(node); - case 220: - case 221: - return emitCaseOrDefaultClause(node); - case 194: - return emitLabelledStatement(node); - case 195: - return emitThrowStatement(node); - case 196: - return emitTryStatement(node); - case 223: - return emitCatchClause(node); - case 197: - return emitDebuggerStatement(node); - case 198: - return emitVariableDeclaration(node); - case 174: - return emitClassExpression(node); - case 201: - return emitClassDeclaration(node); - case 202: - return emitInterfaceDeclaration(node); - case 204: - return emitEnumDeclaration(node); + return emitTemplateExpression(node); + case 178: + return emitTemplateSpan(node); + case 127: + return emitQualifiedName(node); + case 151: + return emitObjectBindingPattern(node); + case 152: + return emitArrayBindingPattern(node); + case 153: + return emitBindingElement(node); + case 154: + return emitArrayLiteral(node); + case 155: + return emitObjectLiteral(node); + case 225: + return emitPropertyAssignment(node); case 226: - return emitEnumMember(node); + return emitShorthandPropertyAssignment(node); + case 128: + return emitComputedPropertyName(node); + case 156: + return emitPropertyAccess(node); + case 157: + return emitIndexedAccess(node); + case 158: + return emitCallExpression(node); + case 159: + return emitNewExpression(node); + case 160: + return emitTaggedTemplateExpression(node); + case 161: + return emit(node.expression); + case 162: + return emitParenExpression(node); + case 201: + case 163: + case 164: + return emitFunctionDeclaration(node); + case 165: + return emitDeleteExpression(node); + case 166: + return emitTypeOfExpression(node); + case 167: + return emitVoidExpression(node); + case 168: + return emitPrefixUnaryExpression(node); + case 169: + return emitPostfixUnaryExpression(node); + case 170: + return emitBinaryExpression(node); + case 171: + return emitConditionalExpression(node); + case 174: + return emitSpreadElementExpression(node); + case 173: + return emitYieldExpression(node); + case 176: + return; + case 180: + case 207: + return emitBlock(node); + case 181: + return emitVariableStatement(node); + case 182: + return write(";"); + case 183: + return emitExpressionStatement(node); + case 184: + return emitIfStatement(node); + case 185: + return emitDoStatement(node); + case 186: + return emitWhileStatement(node); + case 187: + return emitForStatement(node); + case 189: + case 188: + return emitForInOrForOfStatement(node); + case 190: + case 191: + return emitBreakOrContinueStatement(node); + case 192: + return emitReturnStatement(node); + case 193: + return emitWithStatement(node); + case 194: + return emitSwitchStatement(node); + case 221: + case 222: + return emitCaseOrDefaultClause(node); + case 195: + return emitLabelledStatement(node); + case 196: + return emitThrowStatement(node); + case 197: + return emitTryStatement(node); + case 224: + return emitCatchClause(node); + case 198: + return emitDebuggerStatement(node); + case 199: + return emitVariableDeclaration(node); + case 175: + return emitClassExpression(node); + case 202: + return emitClassDeclaration(node); + case 203: + return emitInterfaceDeclaration(node); case 205: - return emitModuleDeclaration(node); - case 209: - return emitImportDeclaration(node); - case 208: - return emitImportEqualsDeclaration(node); - case 215: - return emitExportDeclaration(node); - case 214: - return emitExportAssignment(node); + return emitEnumDeclaration(node); case 227: + return emitEnumMember(node); + case 206: + return emitModuleDeclaration(node); + case 210: + return emitImportDeclaration(node); + case 209: + return emitImportEqualsDeclaration(node); + case 216: + return emitExportDeclaration(node); + case 215: + return emitExportAssignment(node); + case 228: return emitSourceFileNode(node); } } function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; + return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -24556,7 +25270,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 227 || node.pos !== node.parent.pos) { + if (node.parent.kind === 228 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { return getLeadingCommentsWithoutDetachedComments(); } @@ -24568,7 +25282,7 @@ var ts; } function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 227 || node.end !== node.parent.end) { + if (node.parent.kind === 228 || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } @@ -24617,12 +25331,12 @@ var ts; lastComment = comment; }); if (detachedComments.length) { - var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } @@ -24662,7 +25376,9 @@ var ts; ts.emitTime = 0; ts.ioReadTime = 0; ts.ioWriteTime = 0; - ts.version = "1.5.0-beta"; + ts.version = "1.5.0"; + var carriageReturnLineFeed = "\r\n"; + var lineFeed = "\n"; function findConfigFile(searchPath) { var fileName = "tsconfig.json"; while (true) { @@ -24733,6 +25449,9 @@ var ts; } } } + var newLine = options.newLine === 0 ? carriageReturnLineFeed : + options.newLine === 1 ? lineFeed : + ts.sys.newLine; return { getSourceFile: getSourceFile, getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, @@ -24740,14 +25459,14 @@ var ts; getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { return newLine; } }; } ts.createCompilerHost = createCompilerHost; - function getPreEmitDiagnostics(program) { - var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + function getPreEmitDiagnostics(program, sourceFile) { + var diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics()); + diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -24985,7 +25704,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 209 || node.kind === 208 || node.kind === 215) { + if (node.kind === 210 || node.kind === 209 || node.kind === 216) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -25005,7 +25724,7 @@ var ts; } } } - else if (node.kind === 205 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 206 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { if (ts.isExternalModuleImportEqualsDeclaration(node) && ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { @@ -25088,6 +25807,22 @@ var ts; diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); } } + if (options.inlineSourceMap) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.mapRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.sourceRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + } + if (options.inlineSources) { + if (!options.sourceMap && !options.inlineSourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); + } + } if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { if (options.mapRoot) { diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); @@ -25106,15 +25841,15 @@ var ts; var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided)); } } else if (firstExternalModuleSourceFile && languageVersion < 2 && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); } if (options.module && languageVersion >= 2) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher)); } if (options.outDir || options.sourceRoot || @@ -25183,98 +25918,98 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 184) { + if (node.parent.kind === 185) { return spanInPreviousNode(node); } - if (node.parent.kind === 186) { + if (node.parent.kind === 187) { return textSpan(node); } - if (node.parent.kind === 169 && node.parent.operatorToken.kind === 23) { + if (node.parent.kind === 170 && node.parent.operatorToken.kind === 23) { return textSpan(node); } - if (node.parent.kind == 163 && node.parent.body == node) { + if (node.parent.kind == 164 && node.parent.body == node) { return textSpan(node); } } switch (node.kind) { - case 180: + case 181: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 198: - case 132: - case 131: - return spanInVariableDeclaration(node); - case 129: - return spanInParameterDeclaration(node); - case 200: - case 134: + case 199: case 133: - case 136: - case 137: + case 132: + return spanInVariableDeclaration(node); + case 130: + return spanInParameterDeclaration(node); + case 201: case 135: - case 162: + case 134: + case 137: + case 138: + case 136: case 163: + case 164: return spanInFunctionDeclaration(node); - case 179: + case 180: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 206: + case 207: return spanInBlock(node); - case 223: + case 224: return spanInBlock(node.block); - case 182: - return textSpan(node.expression); - case 191: - return textSpan(node.getChildAt(0), node.expression); - case 185: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 184: - return spanInNode(node.statement); - case 197: - return textSpan(node.getChildAt(0)); case 183: + return textSpan(node.expression); + case 192: + return textSpan(node.getChildAt(0), node.expression); + case 186: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 185: + return spanInNode(node.statement); + case 198: + return textSpan(node.getChildAt(0)); + case 184: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 195: + return spanInNode(node.statement); + case 191: + case 190: + return textSpan(node.getChildAt(0), node.label); + case 187: + return spanInForStatement(node); + case 188: + case 189: return textSpan(node, ts.findNextToken(node.expression, node)); case 194: - return spanInNode(node.statement); - case 190: - case 189: - return textSpan(node.getChildAt(0), node.label); - case 186: - return spanInForStatement(node); - case 187: - case 188: return textSpan(node, ts.findNextToken(node.expression, node)); - case 193: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 220: case 221: + case 222: return spanInNode(node.statements[0]); - case 196: + case 197: return spanInBlock(node.tryBlock); - case 195: + case 196: return textSpan(node, node.expression); - case 214: - return textSpan(node, node.expression); - case 208: - return textSpan(node, node.moduleReference); - case 209: - return textSpan(node, node.moduleSpecifier); case 215: + return textSpan(node, node.expression); + case 209: + return textSpan(node, node.moduleReference); + case 210: return textSpan(node, node.moduleSpecifier); - case 205: + case 216: + return textSpan(node, node.moduleSpecifier); + case 206: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 201: - case 204: - case 226: - case 157: - case 158: - return textSpan(node); - case 192: - return spanInNode(node.statement); case 202: + case 205: + case 227: + case 158: + case 159: + return textSpan(node); + case 193: + return spanInNode(node.statement); case 203: + case 204: return undefined; case 22: case 1: @@ -25301,10 +26036,10 @@ var ts; case 81: return spanInNextNode(node); default: - if (node.parent.kind === 224 && node.parent.name === node) { + if (node.parent.kind === 225 && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 160 && node.parent.type === node) { + if (node.parent.kind === 161 && node.parent.type === node) { return spanInNode(node.parent.expression); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { @@ -25314,12 +26049,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 187 || - variableDeclaration.parent.parent.kind === 188) { + if (variableDeclaration.parent.parent.kind === 188 || + variableDeclaration.parent.parent.kind === 189) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 181; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 187 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -25365,7 +26100,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 201 && functionDeclaration.kind !== 135); + (functionDeclaration.parent.kind === 202 && functionDeclaration.kind !== 136); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -25385,23 +26120,23 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 205: + case 206: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 185: - case 183: - case 187: - case 188: - return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); case 186: + case 184: + case 188: + case 189: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 187: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 199) { + if (forStatement.initializer.kind === 200) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -25414,44 +26149,44 @@ var ts; if (forStatement.condition) { return textSpan(forStatement.condition); } - if (forStatement.iterator) { - return textSpan(forStatement.iterator); + if (forStatement.incrementor) { + return textSpan(forStatement.incrementor); } } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 204: + case 205: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 201: + case 202: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 207: + case 208: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 206: + case 207: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 204: - case 201: + case 205: + case 202: return textSpan(node); - case 179: + case 180: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 223: - return spanInNode(node.parent.statements[node.parent.statements.length - 1]); + case 224: + return spanInNode(ts.lastOrUndefined(node.parent.statements)); ; - case 207: + case 208: var caseBlock = node.parent; - var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; + var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { - return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; default: @@ -25459,24 +26194,24 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 184) { + if (node.parent.kind === 185) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 162: - case 200: case 163: - case 134: - case 133: - case 136: - case 137: + case 201: + case 164: case 135: - case 185: - case 184: + case 134: + case 137: + case 138: + case 136: case 186: + case 185: + case 187: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -25484,19 +26219,19 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 224) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 225) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 160) { + if (node.parent.kind === 161) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 184) { + if (node.parent.kind === 185) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -25574,7 +26309,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 163; + return ts.isFunctionBlock(node) && node.parent.kind !== 164; } var depth = 0; var maxDepth = 20; @@ -25586,23 +26321,23 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 179: + case 180: if (!ts.isFunctionBlock(n)) { var parent_6 = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (parent_6.kind === 184 || - parent_6.kind === 187 || + if (parent_6.kind === 185 || parent_6.kind === 188 || + parent_6.kind === 189 || + parent_6.kind === 187 || + parent_6.kind === 184 || parent_6.kind === 186 || - parent_6.kind === 183 || - parent_6.kind === 185 || - parent_6.kind === 192 || - parent_6.kind === 223) { + parent_6.kind === 193 || + parent_6.kind === 224) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_6.kind === 196) { + if (parent_6.kind === 197) { var tryStatement = parent_6; if (tryStatement.tryBlock === n) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); @@ -25625,23 +26360,23 @@ var ts; }); break; } - case 206: { + case 207: { var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 201: case 202: - case 204: - case 154: - case 207: { + case 203: + case 205: + case 155: + case 208: { var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 153: + case 154: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -25667,10 +26402,10 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_21 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_21); + for (var name_22 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_22); if (declarations) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_22); if (!matches) { continue; } @@ -25681,14 +26416,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_21); + matches = patternMatcher.getMatches(containers, name_22); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_22, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -25725,7 +26460,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 127) { + else if (declaration.name.kind === 128) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -25742,7 +26477,7 @@ var ts; } return true; } - if (expression.kind === 155) { + if (expression.kind === 156) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -25753,7 +26488,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 127) { + if (declaration.name.kind === 128) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -25817,14 +26552,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 205: + case 206: do { current = current.parent; - } while (current.kind === 205); - case 201: - case 204: + } while (current.kind === 206); case 202: - case 200: + case 205: + case 203: + case 201: indent++; } current = current.parent; @@ -25835,26 +26570,26 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 180: + case 181: ts.forEach(node.declarationList.declarations, visit); break; - case 150: case 151: + case 152: ts.forEach(node.elements, visit); break; - case 215: + case 216: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 209: + case 210: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { + if (importClause.namedBindings.kind === 212) { childNodes.push(importClause.namedBindings); } else { @@ -25863,20 +26598,20 @@ var ts; } } break; - case 152: - case 198: + case 153: + case 199: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 201: - case 204: case 202: case 205: - case 200: - case 208: - case 213: - case 217: + case 203: + case 206: + case 201: + case 209: + case 214: + case 218: childNodes.push(node); break; } @@ -25911,17 +26646,17 @@ var ts; for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 201: - case 204: case 202: + case 205: + case 203: topLevelNodes.push(node); break; - case 205: + case 206: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 200: + case 201: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -25932,9 +26667,9 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 200) { - if (functionDeclaration.body && functionDeclaration.body.kind === 179) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 201) { + if (functionDeclaration.body && functionDeclaration.body.kind === 180) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 201 && !isEmpty(s.name.text); })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -25987,7 +26722,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 129: + case 130: if (ts.isBindingPattern(node.name)) { break; } @@ -25995,34 +26730,34 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 135: case 134: - case 133: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 136: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); case 137: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 140: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 226: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); case 138: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 139: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 132: - case 131: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); + case 141: + return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); + case 227: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 200: + case 139: + return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); + case 140: + return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); + case 133: + case 132: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 201: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 198: - case 152: + case 199: + case 153: var variableDeclarationNode; - var name_22; - if (node.kind === 152) { - name_22 = node.name; + var name_23; + if (node.kind === 153) { + name_23 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 199) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -26030,24 +26765,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_22 = node.name; + name_23 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.variableElement); } - case 135: + case 136: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 217: - case 213: - case 208: - case 210: + case 218: + case 214: + case 209: case 211: + case 212: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -26077,17 +26812,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 227: + case 228: return createSourceFileItem(node); - case 201: - return createClassItem(node); - case 204: - return createEnumItem(node); case 202: - return createIterfaceItem(node); + return createClassItem(node); case 205: + return createEnumItem(node); + case 203: + return createIterfaceItem(node); + case 206: return createModuleItem(node); - case 200: + case 201: return createFunctionItem(node); } return undefined; @@ -26097,7 +26832,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 205) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 206) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -26109,7 +26844,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 === 179) { + if (node.body && node.body.kind === 180) { 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)); } @@ -26130,7 +26865,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 135 && member; + return member.kind === 136 && member; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { @@ -26151,19 +26886,19 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 128; }); } function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 205) { + while (node.body.kind === 206) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 227 + return node.kind === 228 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -26654,14 +27389,14 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 157) { + if (argumentInfo.invocation.kind !== 158) { return undefined; } var callExpression = argumentInfo.invocation; var expression = callExpression.expression; var name = expression.kind === 65 ? expression - : expression.kind === 155 + : expression.kind === 156 ? expression.name : undefined; if (!name || !name.text) { @@ -26690,7 +27425,7 @@ var ts; } } function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 157 || node.parent.kind === 158) { + if (node.parent.kind === 158 || node.parent.kind === 159) { var callExpression = node.parent; if (node.kind === 24 || node.kind === 16) { @@ -26721,23 +27456,23 @@ var ts; }; } } - else if (node.kind === 10 && node.parent.kind === 159) { + else if (node.kind === 10 && node.parent.kind === 160) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 11 && node.parent.parent.kind === 159) { + else if (node.kind === 11 && node.parent.parent.kind === 160) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171); + ts.Debug.assert(templateExpression.kind === 172); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 176 && node.parent.parent.parent.kind === 159) { + else if (node.parent.kind === 178 && node.parent.parent.parent.kind === 160) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171); + ts.Debug.assert(templateExpression.kind === 172); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } @@ -26801,7 +27536,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 171) { + if (template.kind === 172) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -26810,7 +27545,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 227; n = n.parent) { + for (var n = node; n.kind !== 228; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -26991,39 +27726,39 @@ var ts; return false; } switch (n.kind) { - case 201: case 202: - case 204: - case 154: - case 150: - case 145: - case 179: - case 206: + case 203: + case 205: + case 155: + case 151: + case 146: + case 180: case 207: + case 208: return nodeEndsWith(n, 15, sourceFile); - case 223: + case 224: return isCompletedNode(n.block, sourceFile); - case 158: + case 159: if (!n.arguments) { return true; } - case 157: - case 161: - case 149: + case 158: + case 162: + case 150: return nodeEndsWith(n, 17, sourceFile); - case 142: case 143: + case 144: return isCompletedNode(n.type, sourceFile); - case 135: case 136: case 137: - case 200: - case 162: - case 134: - case 133: - case 139: case 138: + case 201: case 163: + case 135: + case 134: + case 140: + case 139: + case 164: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -27031,61 +27766,61 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 17, sourceFile); - case 205: + case 206: return n.body && isCompletedNode(n.body, sourceFile); - case 183: + case 184: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 182: + case 183: return isCompletedNode(n.expression, sourceFile); - case 153: - case 151: - case 156: - case 127: - case 147: + case 154: + case 152: + case 157: + case 128: + case 148: return nodeEndsWith(n, 19, sourceFile); - case 140: + case 141: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 19, sourceFile); - case 220: case 221: + case 222: return false; - case 186: case 187: case 188: - case 185: + case 189: + case 186: return isCompletedNode(n.statement, sourceFile); - case 184: + case 185: var hasWhileKeyword = findChildOfKind(n, 100, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 17, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 144: + case 145: return isCompletedNode(n.exprName, sourceFile); - case 165: - case 164: case 166: - case 172: + case 165: + case 167: case 173: + case 174: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 159: + case 160: return isCompletedNode(n.template, sourceFile); - case 171: + case 172: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 176: + case 178: return ts.nodeIsPresent(n.literal); - case 167: + case 168: return isCompletedNode(n.operand, sourceFile); - case 169: - return isCompletedNode(n.right, sourceFile); case 170: + return isCompletedNode(n.right, sourceFile); + case 171: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -27095,7 +27830,7 @@ var ts; function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { - var last = children[children.length - 1]; + var last = ts.lastOrUndefined(children); if (last.kind === expectedLastToken) { return true; } @@ -27128,7 +27863,7 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 228 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 229 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -27234,7 +27969,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 227); + ts.Debug.assert(startNode !== undefined || n.kind === 228); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -27271,17 +28006,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 141 || node.kind === 157) { + if (node.kind === 142 || node.kind === 158) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 201 || node.kind === 202) { + if (ts.isFunctionLike(node) || node.kind === 202 || node.kind === 203) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 125; + return n.kind >= 0 && n.kind <= 126; } ts.isToken = isToken; function isWord(kind) { @@ -27334,7 +28069,7 @@ var ts; var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 130; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -27535,7 +28270,7 @@ var ts; if (isStarted) { if (trailingTrivia) { ts.Debug.assert(trailingTrivia.length !== 0); - wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4; + wasNewLine = ts.lastOrUndefined(trailingTrivia).kind === 4; } else { wasNewLine = false; @@ -27938,12 +28673,12 @@ var ts; this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(90, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 75, 76, 67]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([96, 81]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 120]), 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 121]), 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117, 118]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69, 115, 77, 78, 79, 116, 102, 85, 103, 117, 106, 108, 120, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117, 119]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69, 115, 77, 78, 79, 116, 102, 85, 103, 117, 118, 106, 108, 121, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); @@ -27957,7 +28692,7 @@ var ts; this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65, 78, 73, 69, 109, 108, 106, 107, 116, 120, 18, 35])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65, 78, 73, 69, 109, 108, 106, 107, 116, 121, 18, 35])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -28031,37 +28766,37 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_23 in o) { - if (o[name_23] === rule) { - return name_23; + for (var name_24 in o) { + if (o[name_24] === rule) { + return name_24; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 186; + return context.contextNode.kind === 187; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 169: case 170: + case 171: return true; - case 208: - case 198: - case 129: - case 226: + case 153: + case 204: + case 209: + case 199: + case 130: + case 227: + case 133: case 132: - case 131: return context.currentTokenSpan.kind === 53 || context.nextTokenSpan.kind === 53; - case 187: - return context.currentTokenSpan.kind === 86 || context.nextTokenSpan.kind === 86; case 188: - return context.currentTokenSpan.kind === 125 || context.nextTokenSpan.kind === 125; - case 152: - return context.currentTokenSpan.kind === 53 || context.nextTokenSpan.kind === 53; + return context.currentTokenSpan.kind === 86 || context.nextTokenSpan.kind === 86; + case 189: + return context.currentTokenSpan.kind === 126 || context.nextTokenSpan.kind === 126; } return false; }; @@ -28069,7 +28804,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 170; + return context.contextNode.kind === 171; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -28110,26 +28845,26 @@ var ts; return true; } switch (node.kind) { - case 179: + case 180: + case 208: + case 155: case 207: - case 154: - case 206: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 200: + case 201: + case 135: case 134: - case 133: - case 136: case 137: case 138: - case 162: - case 135: + case 139: case 163: - case 202: + case 136: + case 164: + case 203: return true; } return false; @@ -28139,53 +28874,53 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 201: case 202: - case 204: - case 145: + case 203: case 205: + case 146: + case 206: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 201: - case 205: - case 204: - case 179: - case 223: + case 202: case 206: - case 193: + case 205: + case 180: + case 224: + case 207: + case 194: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 183: - case 193: - case 186: + case 184: + case 194: case 187: case 188: + case 189: + case 186: + case 197: case 185: - case 196: - case 184: - case 192: - case 223: + case 193: + case 224: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 154; + return context.contextNode.kind === 155; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 157; + return context.contextNode.kind === 158; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 158; + return context.contextNode.kind === 159; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -28206,38 +28941,38 @@ var ts; while (ts.isExpression(node)) { node = node.parent; } - return node.kind === 130; + return node.kind === 131; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 199 && + return context.currentTokenParent.kind === 200 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 205; + return context.contextNode.kind === 206; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 145; + return context.contextNode.kind === 146; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { if (token.kind !== 24 && token.kind !== 25) { return false; } switch (parent.kind) { - case 141: - case 201: + case 142: case 202: - case 200: - case 162: + case 203: + case 201: case 163: + case 164: + case 135: case 134: - case 133: - case 138: case 139: - case 157: + case 140: case 158: + case 159: return true; default: return false; @@ -28248,7 +28983,7 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 166; + return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 167; }; return Rules; })(); @@ -28271,7 +29006,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 125 + 1; + this.mapRowLength = 126 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -28448,7 +29183,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 125; token++) { + for (var token = 0; token <= 126; token++) { result.push(token); } return result; @@ -28490,9 +29225,9 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(66, 125); + TokenRange.Keywords = TokenRange.FromRange(66, 126); TokenRange.BinaryOperators = TokenRange.FromRange(24, 64); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86, 87, 125]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86, 87, 126]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 65, 16, 18, 14, 93, 88]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65, 16, 93, 88]); @@ -28500,7 +29235,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([65, 16, 93, 88]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([65, 17, 19, 88]); TokenRange.Comments = TokenRange.FromTokens([2, 3]); - TokenRange.TypeNames = TokenRange.FromTokens([65, 119, 121, 113, 122, 99, 112]); + TokenRange.TypeNames = TokenRange.FromTokens([65, 120, 122, 113, 123, 99, 112]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -28678,17 +29413,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 201: case 202: + case 203: return ts.rangeContainsRange(parent.members, node); - case 205: - var body = parent.body; - return body && body.kind === 179 && ts.rangeContainsRange(body.statements, node); - case 227: - case 179: case 206: + var body = parent.body; + return body && body.kind === 180 && ts.rangeContainsRange(body.statements, node); + case 228: + case 180: + case 207: return ts.rangeContainsRange(parent.statements, node); - case 223: + case 224: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -28777,6 +29512,8 @@ var ts; var previousRange; var previousParent; var previousRangeStartLine; + var lastIndentedLine; + var indentationOnLastIndentedLine; var edits = []; formattingScanner.advance(); if (formattingScanner.isOnToken()) { @@ -28811,9 +29548,9 @@ var ts; if (indentation === -1) { if (isSomeBlock(node.kind)) { if (isSomeBlock(parent.kind) || - parent.kind === 227 || - parent.kind === 220 || - parent.kind === 221) { + parent.kind === 228 || + parent.kind === 221 || + parent.kind === 222) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -28831,7 +29568,9 @@ var ts; } var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0) ? options.IndentSize : 0; if (effectiveParentStartLine === startLine) { - indentation = parentDynamicIndentation.getIndentation(); + indentation = startLine === lastIndentedLine + ? indentationOnLastIndentedLine + : parentDynamicIndentation.getIndentation(); delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { @@ -28844,18 +29583,18 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 201: return 69; - case 202: return 103; - case 200: return 83; - case 204: return 204; - case 136: return 116; - case 137: return 120; - case 134: + case 202: return 69; + case 203: return 103; + case 201: return 83; + case 205: return 205; + case 137: return 116; + case 138: return 121; + case 135: if (node.asteriskToken) { return 35; } - case 132: - case 129: + case 133: + case 130: return node.name.kind; } } @@ -28962,7 +29701,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 130 ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 131 ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -29041,7 +29780,6 @@ var ts; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; } - var triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { case 3: var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); @@ -29064,6 +29802,8 @@ var ts; if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + lastIndentedLine = tokenStart.line; + indentationOnLastIndentedLine = tokenIndentation; } } formattingScanner.advance(); @@ -29251,20 +29991,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 179: - case 206: + case 180: + case 207: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 135: - case 200: - case 162: - case 134: - case 133: + case 136: + case 201: case 163: + case 135: + case 134: + case 164: if (node.typeParameters === list) { return 24; } @@ -29272,8 +30012,8 @@ var ts; return 16; } break; - case 157: case 158: + case 159: if (node.typeArguments === list) { return 24; } @@ -29281,7 +30021,7 @@ var ts; return 16; } break; - case 141: + case 142: if (node.typeArguments === list) { return 24; } @@ -29373,7 +30113,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 && precedingToken.parent.kind !== 169) { + if (precedingToken.kind === 23 && precedingToken.parent.kind !== 170) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -29463,7 +30203,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 227 || !parentAndChildShareLine); + (parent.kind === 228 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -29487,7 +30227,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 183 && parent.elseStatement === child) { + if (parent.kind === 184 && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 76, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -29499,23 +30239,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 141: + case 142: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 154: + case 155: return node.parent.properties; - case 153: + case 154: return node.parent.elements; - case 200: - case 162: + case 201: case 163: + case 164: + case 135: case 134: - case 133: - case 138: - case 139: { + case 139: + case 140: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -29526,8 +30266,8 @@ var ts; } break; } - case 158: - case 157: { + case 159: + case 158: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -29596,28 +30336,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 201: case 202: - case 204: - case 153: - case 179: - case 206: + case 203: + case 205: case 154: - case 145: - case 147: - case 207: - case 221: - case 220: - case 161: - case 157: - case 158: case 180: - case 198: - case 214: - case 191: - case 170: + case 207: + case 155: + case 146: + case 148: + case 208: + case 222: + case 221: + case 162: + case 158: + case 159: + case 181: + case 199: + case 215: + case 192: + case 171: + case 152: case 151: - case 150: return true; } return false; @@ -29627,22 +30367,22 @@ var ts; return true; } switch (parent) { - case 184: case 185: - case 187: - case 188: case 186: - case 183: - case 200: - case 162: - case 134: - case 133: - case 138: + case 188: + case 189: + case 187: + case 184: + case 201: case 163: case 135: + case 134: + case 139: + case 164: case 136: case 137: - return child !== 179; + case 138: + return child !== 180; default: return false; } @@ -29652,7 +30392,7 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); /// -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -29744,7 +30484,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(228, nodes.pos, nodes.end, 1024, this); + var list = createNode(229, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; for (var _i = 0; _i < nodes.length; _i++) { @@ -29763,7 +30503,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 126) { + if (this.kind >= 127) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -29808,7 +30548,7 @@ var ts; var children = this.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 126) { + if (child.kind < 127) { return child; } return child.getFirstToken(sourceFile); @@ -29818,7 +30558,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 126) { + if (child.kind < 127) { return child; } return child.getLastToken(sourceFile); @@ -29864,7 +30604,7 @@ var ts; ts.forEach(declarations, function (declaration, indexOfDeclaration) { if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 129) { + if (canUseParsedParamTagComments && declaration.kind === 130) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -29872,13 +30612,13 @@ var ts; } }); } - if (declaration.kind === 205 && declaration.body.kind === 205) { + if (declaration.kind === 206 && declaration.body.kind === 206) { return; } - while (declaration.kind === 205 && declaration.parent.kind === 205) { + while (declaration.kind === 206 && declaration.parent.kind === 206) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 199 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -30183,9 +30923,9 @@ var ts; if (result_2 !== undefined) { return result_2; } - if (declaration.name.kind === 127) { + if (declaration.name.kind === 128) { var expr = declaration.name.expression; - if (expr.kind === 155) { + if (expr.kind === 156) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -30205,9 +30945,9 @@ var ts; } function visit(node) { switch (node.kind) { - case 200: + case 201: + case 135: case 134: - case 133: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -30224,62 +30964,62 @@ var ts; ts.forEachChild(node, visit); } break; - case 201: case 202: case 203: case 204: case 205: - case 208: - case 217: - case 213: - case 208: - case 210: - case 211: - case 136: - case 137: - case 145: - addDeclaration(node); - case 135: - case 180: - case 199: - case 150: - case 151: case 206: + case 209: + case 218: + case 214: + case 209: + case 211: + case 212: + case 137: + case 138: + case 146: + addDeclaration(node); + case 136: + case 181: + case 200: + case 151: + case 152: + case 207: ts.forEachChild(node, visit); break; - case 179: + case 180: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 129: + case 130: if (!(node.flags & 112)) { break; } - case 198: - case 152: + case 199: + case 153: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 226: + case 227: + case 133: case 132: - case 131: addDeclaration(node); break; - case 215: + case 216: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 209: + case 210: var importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { + if (importClause.namedBindings.kind === 212) { addDeclaration(importClause.namedBindings); } else { @@ -30401,7 +31141,8 @@ var ts; ClassificationTypeNames.interfaceName = "interface name"; ClassificationTypeNames.moduleName = "module name"; ClassificationTypeNames.typeParameterName = "type parameter name"; - ClassificationTypeNames.typeAlias = "type alias name"; + ClassificationTypeNames.typeAliasName = "type alias name"; + ClassificationTypeNames.parameterName = "parameter name"; return ClassificationTypeNames; })(); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -30417,14 +31158,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 162) { + if (declaration.kind === 163) { return true; } - if (declaration.kind !== 198 && declaration.kind !== 200) { + if (declaration.kind !== 199 && declaration.kind !== 201) { return false; } for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { - if (parent_7.kind === 227 || parent_7.kind === 206) { + if (parent_7.kind === 228 || parent_7.kind === 207) { return false; } } @@ -30722,7 +31463,7 @@ var ts; else { if (token === 65) { token = scanner.scan(); - if (token === 124) { + if (token === 125) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -30731,7 +31472,7 @@ var ts; } else if (token === 53) { token = scanner.scan(); - if (token === 118) { + if (token === 119) { token = scanner.scan(); if (token === 16) { token = scanner.scan(); @@ -30756,7 +31497,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 124) { + if (token === 125) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -30770,7 +31511,7 @@ var ts; token = scanner.scan(); if (token === 65) { token = scanner.scan(); - if (token === 124) { + if (token === 125) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -30790,7 +31531,7 @@ var ts; } if (token === 15) { token = scanner.scan(); - if (token === 124) { + if (token === 125) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -30800,7 +31541,7 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 124) { + if (token === 125) { token = scanner.scan(); if (token === 8) { recordModuleName(); @@ -30821,7 +31562,7 @@ var ts; ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 194 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 195 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -30830,16 +31571,16 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 65 && - (node.parent.kind === 190 || node.parent.kind === 189) && + (node.parent.kind === 191 || node.parent.kind === 190) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 65 && - node.parent.kind === 194 && + node.parent.kind === 195 && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 194; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 195; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -30850,25 +31591,25 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 126 && node.parent.right === node; + return node.parent.kind === 127 && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 155 && node.parent.name === node; + return node && node.parent && node.parent.kind === 156 && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 157 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 159 && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 205 && node.parent.name === node; + return node.parent.kind === 206 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 65 && @@ -30876,22 +31617,22 @@ var ts; } function isNameOfPropertyAssignment(node) { return (node.kind === 65 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 224 || node.parent.kind === 225) && node.parent.name === node; + (node.parent.kind === 225 || node.parent.kind === 226) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { - case 132: - case 131: - case 224: - case 226: - case 134: case 133: - case 136: + case 132: + case 225: + case 227: + case 135: + case 134: case 137: - case 205: + case 138: + case 206: return node.parent.name === node; - case 156: + case 157: return node.parent.argumentExpression === node; } } @@ -30929,7 +31670,7 @@ var ts; } } var keywordCompletions = []; - for (var i = 66; i <= 125; i++) { + for (var i = 66; i <= 126; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -30944,17 +31685,17 @@ var ts; return undefined; } switch (node.kind) { - case 227: + case 228: + case 135: case 134: - case 133: - case 200: - case 162: - case 136: - case 137: case 201: + case 163: + case 137: + case 138: case 202: - case 204: + case 203: case 205: + case 206: return node; } } @@ -30962,38 +31703,38 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 205: return ScriptElementKind.moduleElement; - case 201: return ScriptElementKind.classElement; - case 202: return ScriptElementKind.interfaceElement; - case 203: return ScriptElementKind.typeElement; - case 204: return ScriptElementKind.enumElement; - case 198: + case 206: return ScriptElementKind.moduleElement; + case 202: return ScriptElementKind.classElement; + case 203: return ScriptElementKind.interfaceElement; + case 204: return ScriptElementKind.typeElement; + case 205: return ScriptElementKind.enumElement; + case 199: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 200: return ScriptElementKind.functionElement; - case 136: return ScriptElementKind.memberGetAccessorElement; - case 137: return ScriptElementKind.memberSetAccessorElement; + case 201: return ScriptElementKind.functionElement; + case 137: return ScriptElementKind.memberGetAccessorElement; + case 138: return ScriptElementKind.memberSetAccessorElement; + case 135: case 134: - case 133: return ScriptElementKind.memberFunctionElement; + case 133: case 132: - case 131: return ScriptElementKind.memberVariableElement; - case 140: return ScriptElementKind.indexSignatureElement; - case 139: return ScriptElementKind.constructSignatureElement; - case 138: return ScriptElementKind.callSignatureElement; - case 135: return ScriptElementKind.constructorImplementationElement; - case 128: return ScriptElementKind.typeParameterElement; - case 226: return ScriptElementKind.variableElement; - case 129: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 208: - case 213: - case 210: - case 217: + case 141: return ScriptElementKind.indexSignatureElement; + case 140: return ScriptElementKind.constructSignatureElement; + case 139: return ScriptElementKind.callSignatureElement; + case 136: return ScriptElementKind.constructorImplementationElement; + case 129: return ScriptElementKind.typeParameterElement; + case 227: return ScriptElementKind.variableElement; + case 130: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 209: + case 214: case 211: + case 218: + case 212: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -31135,44 +31876,44 @@ var ts; return false; } switch (node.kind) { - case 208: + case 209: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 214: + case 215: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 201: + case 202: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 222: + case 223: var heritageClause = node; if (heritageClause.token === 102) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 202: + case 203: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 205: + case 206: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 203: + case 204: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 134: - case 133: case 135: + case 134: case 136: case 137: - case 162: - case 200: + case 138: case 163: - case 200: + case 201: + case 164: + case 201: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -31180,20 +31921,20 @@ var ts; return true; } break; - case 180: + case 181: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 198: + case 199: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 157: case 158: + case 159: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start = expression.typeArguments.pos; @@ -31201,7 +31942,7 @@ var ts; return true; } break; - case 129: + case 130: var parameter = node; if (parameter.modifiers) { var start = parameter.modifiers.pos; @@ -31217,17 +31958,17 @@ var ts; return true; } break; - case 132: + case 133: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 204: + case 205: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 160: + case 161: 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 130: + case 131: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -31343,11 +32084,11 @@ var ts; } var node = currentToken; var isRightOfDot = false; - if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 155) { + if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 156) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 126) { + else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 127) { node = contextToken.parent.left; isRightOfDot = true; } @@ -31370,7 +32111,7 @@ var ts; function getTypeScriptMemberSymbols() { isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 65 || node.kind === 126 || node.kind === 155) { + if (node.kind === 65 || node.kind === 127 || node.kind === 156) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { symbol = typeChecker.getAliasedSymbol(symbol); @@ -31407,11 +32148,11 @@ var ts; symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(contextToken, 210)) { + else if (ts.getAncestor(contextToken, 211)) { isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(contextToken)) { - var importDeclaration = ts.getAncestor(contextToken, 209); + var importDeclaration = ts.getAncestor(contextToken, 210); ts.Debug.assert(importDeclaration !== undefined); var exports_2; if (importDeclaration.moduleSpecifier) { @@ -31456,7 +32197,7 @@ var ts; function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 212; + return node.parent.kind === 213; } } return false; @@ -31466,35 +32207,36 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 157 - || containingNodeKind === 135 - || containingNodeKind === 158 - || containingNodeKind === 153 - || containingNodeKind === 169; + return containingNodeKind === 158 + || containingNodeKind === 136 + || containingNodeKind === 159 + || containingNodeKind === 154 + || containingNodeKind === 170; case 16: - return containingNodeKind === 157 - || containingNodeKind === 135 - || containingNodeKind === 158 - || containingNodeKind === 161; + return containingNodeKind === 158 + || containingNodeKind === 136 + || containingNodeKind === 159 + || containingNodeKind === 162; case 18: - return containingNodeKind === 153; + return containingNodeKind === 154; case 117: + case 118: return true; case 20: - return containingNodeKind === 205; + return containingNodeKind === 206; case 14: - return containingNodeKind === 201; + return containingNodeKind === 202; case 53: - return containingNodeKind === 198 - || containingNodeKind === 169; + return containingNodeKind === 199 + || containingNodeKind === 170; case 11: - return containingNodeKind === 171; + return containingNodeKind === 172; case 12: - return containingNodeKind === 176; + return containingNodeKind === 178; case 108: case 106: case 107: - return containingNodeKind === 132; + return containingNodeKind === 133; } switch (previousToken.getText()) { case "public": @@ -31527,7 +32269,7 @@ var ts; switch (previousToken.kind) { case 14: case 23: - if (parent_8 && parent_8.kind === 154) { + if (parent_8 && parent_8.kind === 155) { return parent_8; } break; @@ -31537,16 +32279,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 162: case 163: - case 200: + case 164: + case 201: + case 135: case 134: - case 133: - case 136: case 137: case 138: case 139: case 140: + case 141: return true; } return false; @@ -31556,56 +32298,56 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 198 || - containingNodeKind === 199 || - containingNodeKind === 180 || - containingNodeKind === 204 || - isFunction(containingNodeKind) || - containingNodeKind === 201 || + return containingNodeKind === 199 || containingNodeKind === 200 || + containingNodeKind === 181 || + containingNodeKind === 205 || + isFunction(containingNodeKind) || containingNodeKind === 202 || - containingNodeKind === 151 || - containingNodeKind === 150; + containingNodeKind === 201 || + containingNodeKind === 203 || + containingNodeKind === 152 || + containingNodeKind === 151; case 20: - return containingNodeKind === 151; + return containingNodeKind === 152; case 18: - return containingNodeKind === 151; + return containingNodeKind === 152; case 16: - return containingNodeKind === 223 || + return containingNodeKind === 224 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 204 || - containingNodeKind === 202 || - containingNodeKind === 145 || - containingNodeKind === 150; + return containingNodeKind === 205 || + containingNodeKind === 203 || + containingNodeKind === 146 || + containingNodeKind === 151; case 22: - return containingNodeKind === 131 && + return containingNodeKind === 132 && previousToken.parent && previousToken.parent.parent && - (previousToken.parent.parent.kind === 202 || - previousToken.parent.parent.kind === 145); + (previousToken.parent.parent.kind === 203 || + previousToken.parent.parent.kind === 146); case 24: - return containingNodeKind === 201 || - containingNodeKind === 200 || - containingNodeKind === 202 || + return containingNodeKind === 202 || + containingNodeKind === 201 || + containingNodeKind === 203 || isFunction(containingNodeKind); case 109: - return containingNodeKind === 132; + return containingNodeKind === 133; case 21: - return containingNodeKind === 129 || - containingNodeKind === 135 || + return containingNodeKind === 130 || + containingNodeKind === 136 || (previousToken.parent && previousToken.parent.parent && - previousToken.parent.parent.kind === 151); + previousToken.parent.parent.kind === 152); case 108: case 106: case 107: - return containingNodeKind === 129; + return containingNodeKind === 130; case 69: case 77: case 103: case 83: case 98: case 116: - case 120: + case 121: case 85: case 104: case 70: @@ -31640,7 +32382,7 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 212) { + importDeclaration.importClause.namedBindings.kind === 213) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -31657,7 +32399,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 224 && m.kind !== 225) { + if (m.kind !== 225 && m.kind !== 226) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -31703,10 +32445,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameTable = getNameTable(sourceFile); - for (var name_24 in nameTable) { - if (!allNames[name_24]) { - allNames[name_24] = name_24; - var displayName = getCompletionEntryDisplayName(name_24, target, true); + for (var name_25 in nameTable) { + if (!allNames[name_25]) { + allNames[name_25] = name_25; + var displayName = getCompletionEntryDisplayName(name_25, target, true); if (displayName) { var entry = { name: displayName, @@ -31861,22 +32603,6 @@ var ts; } return ScriptElementKind.unknown; } - function getTypeKind(type) { - var flags = type.getFlags(); - if (flags & 128) - return ScriptElementKind.enumElement; - if (flags & 1024) - return ScriptElementKind.classElement; - if (flags & 2048) - return ScriptElementKind.interfaceElement; - if (flags & 512) - return ScriptElementKind.typeParameterElement; - if (flags & 1048703) - return ScriptElementKind.primitiveType; - if (flags & 256) - return ScriptElementKind.primitiveType; - return ScriptElementKind.unknown; - } function getSymbolModifiers(symbol) { return symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) @@ -31898,14 +32624,14 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 155) { + if (location.parent && location.parent.kind === 156) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } var callExpression; - if (location.kind === 157 || location.kind === 158) { + if (location.kind === 158 || location.kind === 159) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -31917,7 +32643,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 158 || callExpression.expression.kind === 91; + var useConstructSignatures = callExpression.kind === 159 || callExpression.expression.kind === 91; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -31965,21 +32691,21 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 114 && location.parent.kind === 135)) { + (location.kind === 114 && location.parent.kind === 136)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 136 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 135) { + if (functionDeclaration.kind === 136) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 139 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -32002,7 +32728,7 @@ var ts; } if (symbolFlags & 524288) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(123)); + displayParts.push(ts.keywordPart(124)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); @@ -32022,7 +32748,9 @@ var ts; } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(117)); + var declaration = ts.getDeclarationOfKind(symbol, 206); + var isNamespace = declaration && declaration.name && declaration.name.kind === 65; + displayParts.push(ts.keywordPart(isNamespace ? 118 : 117)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -32041,13 +32769,13 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 129).parent; var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 139) { + if (signatureDeclaration.kind === 140) { displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 139 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); @@ -32056,7 +32784,7 @@ var ts; if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 226) { + if (declaration.kind === 227) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -32072,13 +32800,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 208) { + if (declaration.kind === 209) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(118)); + displayParts.push(ts.keywordPart(119)); displayParts.push(ts.punctuationPart(16)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(17)); @@ -32202,8 +32930,8 @@ var ts; if (!symbol) { switch (node.kind) { case 65: - case 155: - case 126: + case 156: + case 127: case 93: case 91: var type = typeChecker.getTypeAtLocation(node); @@ -32238,6 +32966,59 @@ var ts; containerName: containerName }; } + function getDefinitionFromSymbol(symbol, node) { + var typeChecker = program.getTypeChecker(); + var result = []; + var declarations = symbol.getDeclarations(); + var symbolName = typeChecker.symbolToString(symbol); + var symbolKind = getSymbolKind(symbol, node); + var containerSymbol = symbol.parent; + var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && + !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + ts.forEach(declarations, function (declaration) { + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + }); + } + return result; + function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { + if (isNewExpressionTarget(location) || location.kind === 114) { + if (symbol.flags & 32) { + var classDeclaration = symbol.getDeclarations()[0]; + ts.Debug.assert(classDeclaration && classDeclaration.kind === 202); + return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); + } + } + return false; + } + function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { + if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { + return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); + } + return false; + } + function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + var declarations = []; + var definition; + ts.forEach(signatureDeclarations, function (d) { + if ((selectConstructors && d.kind === 136) || + (!selectConstructors && (d.kind === 201 || d.kind === 135 || d.kind === 134))) { + declarations.push(d); + if (d.body) + definition = d; + } + }); + if (definition) { + result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); + return true; + } + else if (declarations.length) { + result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + return true; + } + return false; + } + } function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -32276,7 +33057,7 @@ var ts; symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 225) { + if (node.parent.kind === 226) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -32287,56 +33068,37 @@ var ts; var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } - var result = []; - var declarations = symbol.getDeclarations(); - var symbolName = typeChecker.symbolToString(symbol); - var symbolKind = getSymbolKind(symbol, node); - var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); + return getDefinitionFromSymbol(symbol, node); + } + function getTypeDefinitionAtPosition(fileName, position) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var node = ts.getTouchingPropertyName(sourceFile, position); + if (!node) { + return undefined; } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 114) { - if (symbol.flags & 32) { - var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 201); - return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); - } - } - return false; + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + return undefined; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); - } - return false; + var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + if (!type) { + return undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 135) || - (!selectConstructors && (d.kind === 200 || d.kind === 134 || d.kind === 133))) { - declarations.push(d); - if (d.body) - definition = d; + if (type.flags & 16384) { + var result = []; + ts.forEach(type.types, function (t) { + if (t.symbol) { + result.push.apply(result, getDefinitionFromSymbol(t.symbol, node)); } }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(createDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; + return result; } + if (!type.symbol) { + return undefined; + } + return getDefinitionFromSymbol(type.symbol, node); } function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); @@ -32419,74 +33181,74 @@ var ts; switch (node.kind) { case 84: case 76: - if (hasKind(node.parent, 183)) { + if (hasKind(node.parent, 184)) { return getIfElseOccurrences(node.parent); } break; case 90: - if (hasKind(node.parent, 191)) { + if (hasKind(node.parent, 192)) { return getReturnOccurrences(node.parent); } break; case 94: - if (hasKind(node.parent, 195)) { + if (hasKind(node.parent, 196)) { return getThrowOccurrences(node.parent); } break; case 68: - if (hasKind(parent(parent(node)), 196)) { + if (hasKind(parent(parent(node)), 197)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 96: case 81: - if (hasKind(parent(node), 196)) { + if (hasKind(parent(node), 197)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 92: - if (hasKind(node.parent, 193)) { + if (hasKind(node.parent, 194)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 67: case 73: - if (hasKind(parent(parent(parent(node))), 193)) { + if (hasKind(parent(parent(parent(node))), 194)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 66: case 71: - if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { + if (hasKind(node.parent, 191) || hasKind(node.parent, 190)) { return getBreakOrContinueStatementOccurences(node.parent); } break; case 82: - if (hasKind(node.parent, 186) || - hasKind(node.parent, 187) || - hasKind(node.parent, 188)) { + if (hasKind(node.parent, 187) || + hasKind(node.parent, 188) || + hasKind(node.parent, 189)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 100: case 75: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { + if (hasKind(node.parent, 186) || hasKind(node.parent, 185)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 114: - if (hasKind(node.parent, 135)) { + if (hasKind(node.parent, 136)) { return getConstructorOccurrences(node.parent); } break; case 116: - case 120: - if (hasKind(node.parent, 136) || hasKind(node.parent, 137)) { + case 121: + if (hasKind(node.parent, 137) || hasKind(node.parent, 138)) { return getGetAndSetOccurrences(node.parent); } default: if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 180)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 181)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -32498,10 +33260,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 195) { + if (node.kind === 196) { statementAccumulator.push(node); } - else if (node.kind === 196) { + else if (node.kind === 197) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -32523,10 +33285,10 @@ var ts; var child = throwStatement; while (child.parent) { var parent_9 = child.parent; - if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 228) { return parent_9; } - if (parent_9.kind === 196) { + if (parent_9.kind === 197) { var tryStatement = parent_9; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; @@ -32541,7 +33303,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 190 || node.kind === 189) { + if (node.kind === 191 || node.kind === 190) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -32557,15 +33319,15 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { switch (node_1.kind) { - case 193: - if (statement.kind === 189) { + case 194: + if (statement.kind === 190) { continue; } - case 186: case 187: case 188: + case 189: + case 186: case 185: - case 184: if (!statement.label || isLabeledBy(node_1, statement.label.text)) { return node_1; } @@ -32582,18 +33344,18 @@ var ts; function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 201 || - (declaration.kind === 129 && hasKind(container, 135)))) { + if (!(container.kind === 202 || + (declaration.kind === 130 && hasKind(container, 136)))) { return undefined; } } else if (modifier === 109) { - if (container.kind !== 201) { + if (container.kind !== 202) { return undefined; } } else if (modifier === 78 || modifier === 115) { - if (!(container.kind === 206 || container.kind === 227)) { + if (!(container.kind === 207 || container.kind === 228)) { return undefined; } } @@ -32604,18 +33366,18 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 206: - case 227: + case 207: + case 228: nodes = container.statements; break; - case 135: + case 136: nodes = container.parameters.concat(container.parent.members); break; - case 201: + case 202: nodes = container.members; if (modifierFlag & 112) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 135 && member; + return member.kind === 136 && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -32663,13 +33425,13 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 136); tryPushAccessorKeyword(accessorDeclaration.symbol, 137); + tryPushAccessorKeyword(accessorDeclaration.symbol, 138); return ts.map(keywords, getHighlightSpanForNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116, 120); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116, 121); }); } } } @@ -32686,7 +33448,7 @@ var ts; function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82, 100, 75)) { - if (loopNode.kind === 184) { + if (loopNode.kind === 185) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 100)) { @@ -32707,13 +33469,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 186: case 187: case 188: - case 184: + case 189: case 185: + case 186: return getLoopBreakContinueOccurrences(owner); - case 193: + case 194: return getSwitchCaseDefaultOccurrences(owner); } } @@ -32763,7 +33525,7 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 179))) { + if (!(func && hasKind(func.body, 180))) { return undefined; } var keywords = []; @@ -32777,7 +33539,7 @@ var ts; } function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 184) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { @@ -32788,7 +33550,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 183)) { + if (!hasKind(ifStatement.elseStatement, 184)) { break; } ifStatement = ifStatement.elseStatement; @@ -32946,16 +33708,16 @@ var ts; } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 213 || location.parent.kind === 217) && + (location.parent.kind === 214 || location.parent.kind === 218) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 213 || declaration.kind === 217; + return declaration.kind === 214 || declaration.kind === 218; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 163 ? d : undefined; }); var name; if (functionExpression && functionExpression.name) { name = functionExpression.name.text; @@ -32970,7 +33732,7 @@ var ts; if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 163 ? d : undefined; }); var name = functionExpression && functionExpression.name ? functionExpression.name.text : symbol.name; @@ -32988,7 +33750,7 @@ var ts; if (symbol.flags & (4 | 8192)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 201); + return ts.getAncestor(privateDeclaration, 202); } } if (symbol.flags & 8388608) { @@ -33009,7 +33771,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 227 && !ts.isExternalModule(container)) { + if (container.kind === 228 && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -33168,13 +33930,13 @@ var ts; } var staticFlag = 128; switch (searchSpaceNode.kind) { - case 132: - case 131: - case 134: case 133: + case 132: case 135: + case 134: case 136: case 137: + case 138: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; @@ -33202,32 +33964,32 @@ var ts; var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128; switch (searchSpaceNode.kind) { + case 135: case 134: - case 133: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } + case 133: case 132: - case 131: - case 135: case 136: case 137: + case 138: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 227: + case 228: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 200: - case 162: + case 201: + case 163: break; default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 227) { + if (searchSpaceNode.kind === 228) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -33258,25 +34020,25 @@ var ts; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 162: - case 200: + case 163: + case 201: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; + case 135: case 134: - case 133: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 201: + case 202: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 227: - if (container.kind === 227 && !ts.isExternalModule(container)) { + case 228: + if (container.kind === 228 && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -33311,11 +34073,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 201) { + if (declaration.kind === 202) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 202) { + else if (declaration.kind === 203) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -33365,17 +34127,17 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_25 = node.text; + var name_26 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_25); + var unionProperty = contextualType.getProperty(name_26); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_25); + var symbol = t.getProperty(name_26); if (symbol) { result_4.push(symbol); } @@ -33384,7 +34146,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_25); + var symbol_1 = contextualType.getProperty(name_26); if (symbol_1) { return [symbol_1]; } @@ -33429,10 +34191,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 168 || parent.kind === 167) { + if (parent.kind === 169 || parent.kind === 168) { return true; } - else if (parent.kind === 169 && parent.left === node) { + else if (parent.kind === 170 && parent.left === node) { var operator = parent.operatorToken.kind; return 53 <= operator && operator <= 64; } @@ -33465,33 +34227,33 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 129: - case 198: - case 152: + case 130: + case 199: + case 153: + case 133: case 132: - case 131: - case 224: case 225: case 226: - case 134: - case 133: + case 227: case 135: + case 134: case 136: case 137: - case 200: - case 162: - case 163: - case 223: - return 1; - case 128: - case 202: - case 203: - case 145: - return 2; + case 138: case 201: + case 163: + case 164: + case 224: + return 1; + case 129: + case 203: case 204: - return 1 | 2; + case 146: + return 2; + case 202: case 205: + return 1 | 2; + case 206: if (node.name.kind === 8) { return 4 | 1; } @@ -33501,14 +34263,14 @@ var ts; else { return 4; } - case 212: case 213: - case 208: - case 209: case 214: + case 209: + case 210: case 215: + case 216: return 1 | 2 | 4; - case 227: + case 228: return 4 | 1; } return 1 | 2 | 4; @@ -33518,7 +34280,7 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 141 || node.parent.kind === 177; + return node.parent.kind === 142 || node.parent.kind === 177; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -33526,47 +34288,47 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 155) { - while (root.parent && root.parent.kind === 155) { + if (root.parent.kind === 156) { + while (root.parent && root.parent.kind === 156) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) { + if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 223) { var decl = root.parent.parent.parent; - return (decl.kind === 201 && root.parent.parent.token === 102) || - (decl.kind === 202 && root.parent.parent.token === 79); + return (decl.kind === 202 && root.parent.parent.token === 102) || + (decl.kind === 203 && root.parent.parent.token === 79); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 126) { - while (root.parent && root.parent.kind === 126) { + if (root.parent.kind === 127) { + while (root.parent && root.parent.kind === 127) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 141 && !isLastClause; + return root.parent.kind === 142 && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 126) { + while (node.parent.kind === 127) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 65); - if (node.parent.kind === 126 && + if (node.parent.kind === 127 && node.parent.right === node && - node.parent.parent.kind === 208) { + node.parent.parent.kind === 209) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 214) { + if (node.parent.kind === 215) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -33600,8 +34362,8 @@ var ts; return; } switch (node.kind) { - case 155: - case 126: + case 156: + case 127: case 8: case 80: case 95: @@ -33619,7 +34381,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 205 && + if (nodeForStartPos.parent.parent.kind === 206 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -33642,41 +34404,49 @@ var ts; return ts.NavigationBar.getNavigationBarItems(sourceFile); } function getSemanticClassifications(fileName, span) { + return convertClassifications(getEncodedSemanticClassifications(fileName, span)); + } + function getEncodedSemanticClassifications(fileName, span) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var typeChecker = program.getTypeChecker(); var result = []; processNode(sourceFile); - return result; + return { spans: result, endOfLineState: 0 }; + function pushClassification(start, length, type) { + result.push(start); + result.push(length); + result.push(type); + } function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); if (flags & 32) { - return ClassificationTypeNames.className; + return 11; } else if (flags & 384) { - return ClassificationTypeNames.enumName; + return 12; } else if (flags & 524288) { - return ClassificationTypeNames.typeAlias; + return 16; } else if (meaningAtPosition & 2) { if (flags & 64) { - return ClassificationTypeNames.interfaceName; + return 13; } else if (flags & 262144) { - return ClassificationTypeNames.typeParameterName; + return 15; } } else if (flags & 1536) { if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { - return ClassificationTypeNames.moduleName; + return 14; } } return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 205 && ts.getModuleInstanceState(declaration) == 1; + return declaration.kind === 206 && ts.getModuleInstanceState(declaration) == 1; }); } } @@ -33687,10 +34457,7 @@ var ts; if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { - result.push({ - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - classificationType: type - }); + pushClassification(node.getStart(), node.getWidth(), type); } } } @@ -33698,13 +34465,53 @@ var ts; } } } + function getClassificationTypeName(type) { + switch (type) { + case 1: return ClassificationTypeNames.comment; + case 2: return ClassificationTypeNames.identifier; + case 3: return ClassificationTypeNames.keyword; + case 4: return ClassificationTypeNames.numericLiteral; + case 5: return ClassificationTypeNames.operator; + case 6: return ClassificationTypeNames.stringLiteral; + case 8: return ClassificationTypeNames.whiteSpace; + case 9: return ClassificationTypeNames.text; + case 10: return ClassificationTypeNames.punctuation; + case 11: return ClassificationTypeNames.className; + case 12: return ClassificationTypeNames.enumName; + case 13: return ClassificationTypeNames.interfaceName; + case 14: return ClassificationTypeNames.moduleName; + case 15: return ClassificationTypeNames.typeParameterName; + case 16: return ClassificationTypeNames.typeAliasName; + case 17: return ClassificationTypeNames.parameterName; + } + } + function convertClassifications(classifications) { + ts.Debug.assert(classifications.spans.length % 3 === 0); + var dense = classifications.spans; + var result = []; + for (var i = 0, n = dense.length; i < n; i += 3) { + result.push({ + textSpan: ts.createTextSpan(dense[i], dense[i + 1]), + classificationType: getClassificationTypeName(dense[i + 2]) + }); + } + return result; + } function getSyntacticClassifications(fileName, span) { + return convertClassifications(getEncodedSyntacticClassifications(fileName, span)); + } + function getEncodedSyntacticClassifications(fileName, span) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); var triviaScanner = ts.createScanner(2, false, sourceFile.text); var mergeConflictScanner = ts.createScanner(2, false, sourceFile.text); var result = []; processElement(sourceFile); - return result; + return { spans: result, endOfLineState: 0 }; + function pushClassification(start, length, type) { + result.push(start); + result.push(length); + result.push(type); + } function classifyLeadingTrivia(token) { var tokenStart = ts.skipTrivia(sourceFile.text, token.pos, false); if (tokenStart === token.pos) { @@ -33721,20 +34528,14 @@ var ts; return; } if (ts.isComment(kind)) { - result.push({ - textSpan: ts.createTextSpan(start, width), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, width, 1); continue; } if (kind === 6) { var text = sourceFile.text; var ch = text.charCodeAt(start); if (ch === 60 || ch === 62) { - result.push({ - textSpan: ts.createTextSpan(start, width), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, width, 1); continue; } ts.Debug.assert(ch === 61); @@ -33749,10 +34550,7 @@ var ts; break; } } - result.push({ - textSpan: ts.createTextSpanFromBounds(start, i), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, i - start, 1); mergeConflictScanner.setTextPos(i); while (mergeConflictScanner.getTextPos() < end) { classifyDisabledCodeToken(); @@ -33764,10 +34562,7 @@ var ts; var end = mergeConflictScanner.getTextPos(); var type = classifyTokenType(tokenKind); if (type) { - result.push({ - textSpan: ts.createTextSpanFromBounds(start, end), - classificationType: type - }); + pushClassification(start, end - start, type); } } function classifyToken(token) { @@ -33775,83 +34570,85 @@ var ts; if (token.getWidth() > 0) { var type = classifyTokenType(token.kind, token); if (type) { - result.push({ - textSpan: ts.createTextSpan(token.getStart(), token.getWidth()), - classificationType: type - }); + pushClassification(token.getStart(), token.getWidth(), type); } } } function classifyTokenType(tokenKind, token) { if (ts.isKeyword(tokenKind)) { - return ClassificationTypeNames.keyword; + return 3; } if (tokenKind === 24 || tokenKind === 25) { if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { - return ClassificationTypeNames.punctuation; + return 10; } } if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 53) { - if (token.parent.kind === 198 || - token.parent.kind === 132 || - token.parent.kind === 129) { - return ClassificationTypeNames.operator; + if (token.parent.kind === 199 || + token.parent.kind === 133 || + token.parent.kind === 130) { + return 5; } } - if (token.parent.kind === 169 || - token.parent.kind === 167 || + if (token.parent.kind === 170 || token.parent.kind === 168 || - token.parent.kind === 170) { - return ClassificationTypeNames.operator; + token.parent.kind === 169 || + token.parent.kind === 171) { + return 5; } } - return ClassificationTypeNames.punctuation; + return 10; } else if (tokenKind === 7) { - return ClassificationTypeNames.numericLiteral; + return 4; } else if (tokenKind === 8) { - return ClassificationTypeNames.stringLiteral; + return 6; } else if (tokenKind === 9) { - return ClassificationTypeNames.stringLiteral; + return 6; } else if (ts.isTemplateLiteralKind(tokenKind)) { - return ClassificationTypeNames.stringLiteral; + return 6; } else if (tokenKind === 65) { if (token) { switch (token.parent.kind) { - case 201: - if (token.parent.name === token) { - return ClassificationTypeNames.className; - } - return; - case 128: - if (token.parent.name === token) { - return ClassificationTypeNames.typeParameterName; - } - return; case 202: if (token.parent.name === token) { - return ClassificationTypeNames.interfaceName; + return 11; } return; - case 204: + case 129: if (token.parent.name === token) { - return ClassificationTypeNames.enumName; + return 15; + } + return; + case 203: + if (token.parent.name === token) { + return 13; } return; case 205: if (token.parent.name === token) { - return ClassificationTypeNames.moduleName; + return 12; + } + return; + case 206: + if (token.parent.name === token) { + return 14; + } + return; + case 130: + if (token.parent.name === token) { + return 17; } return; } } - return ClassificationTypeNames.text; + return 9; } } function processElement(element) { @@ -34060,11 +34857,14 @@ var ts; getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, getSyntacticClassifications: getSyntacticClassifications, getSemanticClassifications: getSemanticClassifications, + getEncodedSyntacticClassifications: getEncodedSyntacticClassifications, + getEncodedSemanticClassifications: getEncodedSemanticClassifications, getCompletionsAtPosition: getCompletionsAtPosition, getCompletionEntryDetails: getCompletionEntryDetails, getSignatureHelpItems: getSignatureHelpItems, getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, + getTypeDefinitionAtPosition: getTypeDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, @@ -34107,7 +34907,7 @@ var ts; case 8: case 7: if (ts.isDeclarationName(node) || - node.parent.kind === 219 || + node.parent.kind === 220 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -34120,7 +34920,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 156 && + node.parent.kind === 157 && node.parent.argumentExpression === node; } function createClassifier() { @@ -34142,7 +34942,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 116 || - keyword2 === 120 || + keyword2 === 121 || keyword2 === 114 || keyword2 === 109) { return true; @@ -34151,7 +34951,55 @@ var ts; } return true; } + function convertClassifications(classifications, text) { + var entries = []; + var dense = classifications.spans; + var lastEnd = 0; + for (var i = 0, n = dense.length; i < n; i += 3) { + var start = dense[i]; + var length_1 = dense[i + 1]; + var type = dense[i + 2]; + if (lastEnd >= 0) { + var whitespaceLength_1 = start - lastEnd; + if (whitespaceLength_1 > 0) { + entries.push({ length: whitespaceLength_1, classification: TokenClass.Whitespace }); + } + } + entries.push({ length: length_1, classification: convertClassification(type) }); + lastEnd = start + length_1; + } + var whitespaceLength = text.length - lastEnd; + if (whitespaceLength > 0) { + entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); + } + return { entries: entries, finalLexState: classifications.endOfLineState }; + } + function convertClassification(type) { + switch (type) { + case 1: return TokenClass.Comment; + case 3: return TokenClass.Keyword; + case 4: return TokenClass.NumberLiteral; + case 5: return TokenClass.Operator; + case 6: return TokenClass.StringLiteral; + case 8: return TokenClass.Whitespace; + case 10: return TokenClass.Punctuation; + case 2: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 9: + case 17: + default: + return TokenClass.Identifier; + } + } function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); + } + function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { var offset = 0; var token = 0; var lastNonTriviaToken = 0; @@ -34184,8 +35032,8 @@ var ts; } scanner.setText(text); var result = { - finalLexState: 0, - entries: [] + endOfLineState: 0, + spans: [] }; var angleBracketStack = 0; do { @@ -34210,10 +35058,10 @@ var ts; angleBracketStack--; } else if (token === 112 || - token === 121 || - token === 119 || + token === 122 || + token === 120 || token === 113 || - token === 122) { + token === 123) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 65; } @@ -34252,7 +35100,7 @@ var ts; function processToken() { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); - addResult(end - start, classFromKind(token)); + addResult(start, end, classFromKind(token)); if (end >= text.length) { if (token === 8) { var tokenText = scanner.getTokenText(); @@ -34264,7 +35112,7 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 + result.endOfLineState = quoteChar === 34 ? 3 : 2; } @@ -34272,16 +35120,16 @@ var ts; } else if (token === 3) { if (scanner.isUnterminated()) { - result.finalLexState = 1; + result.endOfLineState = 1; } } else if (ts.isTemplateLiteralKind(token)) { if (scanner.isUnterminated()) { if (token === 13) { - result.finalLexState = 5; + result.endOfLineState = 5; } else if (token === 10) { - result.finalLexState = 4; + result.endOfLineState = 4; } else { ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); @@ -34289,16 +35137,24 @@ var ts; } } else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11) { - result.finalLexState = 6; + result.endOfLineState = 6; } } } - function addResult(length, classification) { + function addResult(start, end, classification) { + if (classification === 8) { + return; + } + if (start === 0 && offset > 0) { + start += offset; + } + start -= offset; + end -= offset; + var length = end - start; if (length > 0) { - if (result.entries.length === 0) { - length -= offset; - } - result.entries.push({ length: length, classification: classification }); + result.spans.push(start); + result.spans.push(length); + result.spans.push(classification); } } } @@ -34359,41 +35215,44 @@ var ts; } } function isKeyword(token) { - return token >= 66 && token <= 125; + return token >= 66 && token <= 126; } function classFromKind(token) { if (isKeyword(token)) { - return TokenClass.Keyword; + return 3; } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return TokenClass.Operator; + return 5; } else if (token >= 14 && token <= 64) { - return TokenClass.Punctuation; + return 10; } switch (token) { case 7: - return TokenClass.NumberLiteral; + return 4; case 8: - return TokenClass.StringLiteral; + return 6; case 9: - return TokenClass.RegExpLiteral; + return 7; case 6: case 3: case 2: - return TokenClass.Comment; + return 1; case 5: case 4: - return TokenClass.Whitespace; + return 8; case 65: default: if (ts.isTemplateLiteralKind(token)) { - return TokenClass.StringLiteral; + return 6; } - return TokenClass.Identifier; + return 2; } } - return { getClassificationsForLine: getClassificationsForLine }; + return { + getClassificationsForLine: getClassificationsForLine, + getEncodedLexicalClassifications: getEncodedLexicalClassifications + }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -34408,7 +35267,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 227 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 228 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -34509,6 +35368,7 @@ var ts; CommandNames.Rename = "rename"; CommandNames.Saveto = "saveto"; CommandNames.SignatureHelp = "signatureHelp"; + CommandNames.TypeDefinition = "typeDefinition"; CommandNames.Unknown = "unknown"; })(CommandNames = server.CommandNames || (server.CommandNames = {})); var Errors; @@ -34680,6 +35540,24 @@ var ts; end: compilerService.host.positionToLineOffset(def.fileName, ts.textSpanEnd(def.textSpan)) }); }); }; + Session.prototype.getTypeDefinition = function (line, offset, fileName) { + var file = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(file); + if (!project) { + throw Errors.NoProject; + } + var compilerService = project.compilerService; + var position = compilerService.host.lineOffsetToPosition(file, line, offset); + var definitions = compilerService.languageService.getTypeDefinitionAtPosition(file, position); + if (!definitions) { + return undefined; + } + return definitions.map(function (def) { return ({ + file: def.fileName, + start: compilerService.host.positionToLineOffset(def.fileName, def.textSpan.start), + end: compilerService.host.positionToLineOffset(def.fileName, ts.textSpanEnd(def.textSpan)) + }); }); + }; Session.prototype.getOccurrences = function (line, offset, fileName) { fileName = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(fileName); @@ -34874,7 +35752,7 @@ var ts; IndentSize: formatOptions.IndentSize, TabSize: formatOptions.TabSize, NewLineCharacter: "\n", - ConvertTabsToSpaces: true + ConvertTabsToSpaces: formatOptions.ConvertTabsToSpaces }; var indentPosition = compilerService.languageService.getIndentationAtPosition(file, position, editorOptions); for (var i = 0, len = lineText.length; i < len; i++) { @@ -35136,6 +36014,11 @@ var ts; response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); break; } + case CommandNames.TypeDefinition: { + var defArgs = request.arguments; + response = this.getTypeDefinition(defArgs.line, defArgs.offset, defArgs.file); + break; + } case CommandNames.References: { var refArgs = request.arguments; response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file); @@ -35863,6 +36746,7 @@ var ts; if (content !== undefined) { var indentSize; info = new ScriptInfo(this.host, fileName, content, openedByClient); + info.setFormatOptions(this.getFormatCodeOptions()); this.filenameToScriptInfo[fileName] = info; if (!info.isOpen) { info.fileWatcher = this.host.watchFile(fileName, function (_) { _this.watchedFileChanged(fileName); }); @@ -35879,7 +36763,7 @@ var ts; ProjectService.prototype.findConfigFile = function (searchPath) { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); - if (ts.sys.fileExists(fileName)) { + if (this.host.fileExists(fileName)) { return fileName; } var parentPath = ts.getDirectoryPath(searchPath); @@ -35996,11 +36880,11 @@ var ts; configFilename = ts.normalizePath(configFilename); var dirPath = ts.getDirectoryPath(configFilename); var rawConfig = ts.readConfigFile(configFilename); - if (!rawConfig) { - return { errorMsg: "tsconfig syntax error" }; + if (rawConfig.error) { + return rawConfig.error; } else { - var parsedCommandLine = ts.parseConfigFile(rawConfig, dirPath); + var parsedCommandLine = ts.parseConfigFile(rawConfig.config, ts.sys, dirPath); if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) { return { errorMsg: "tsconfig option errors" }; } @@ -36012,7 +36896,7 @@ var ts; var proj = this.createProject(configFilename, projectOptions); for (var i = 0, len = parsedCommandLine.fileNames.length; i < len; i++) { var rootFilename = parsedCommandLine.fileNames[i]; - if (ts.sys.fileExists(rootFilename)) { + if (this.host.fileExists(rootFilename)) { var info = this.openFile(rootFilename, clientFileName == rootFilename); proj.addRoot(info); } diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts index f86da199763..3e765a33f01 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -140,132 +140,133 @@ declare module "typescript" { DeclareKeyword = 115, GetKeyword = 116, ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, + NamespaceKeyword = 118, + RequireKeyword = 119, + NumberKeyword = 120, + SetKeyword = 121, + StringKeyword = 122, + SymbolKeyword = 123, + TypeKeyword = 124, + FromKeyword = 125, + OfKeyword = 126, + QualifiedName = 127, + ComputedPropertyName = 128, + TypeParameter = 129, + Parameter = 130, + Decorator = 131, + PropertySignature = 132, + PropertyDeclaration = 133, + MethodSignature = 134, + MethodDeclaration = 135, + Constructor = 136, + GetAccessor = 137, + SetAccessor = 138, + CallSignature = 139, + ConstructSignature = 140, + IndexSignature = 141, + TypeReference = 142, + FunctionType = 143, + ConstructorType = 144, + TypeQuery = 145, + TypeLiteral = 146, + ArrayType = 147, + TupleType = 148, + UnionType = 149, + ParenthesizedType = 150, + ObjectBindingPattern = 151, + ArrayBindingPattern = 152, + BindingElement = 153, + ArrayLiteralExpression = 154, + ObjectLiteralExpression = 155, + PropertyAccessExpression = 156, + ElementAccessExpression = 157, + CallExpression = 158, + NewExpression = 159, + TaggedTemplateExpression = 160, + TypeAssertionExpression = 161, + ParenthesizedExpression = 162, + FunctionExpression = 163, + ArrowFunction = 164, + DeleteExpression = 165, + TypeOfExpression = 166, + VoidExpression = 167, + PrefixUnaryExpression = 168, + PostfixUnaryExpression = 169, + BinaryExpression = 170, + ConditionalExpression = 171, + TemplateExpression = 172, + YieldExpression = 173, + SpreadElementExpression = 174, + ClassExpression = 175, + OmittedExpression = 176, + ExpressionWithTypeArguments = 177, + TemplateSpan = 178, + SemicolonClassElement = 179, + Block = 180, + VariableStatement = 181, + EmptyStatement = 182, + ExpressionStatement = 183, + IfStatement = 184, + DoStatement = 185, + WhileStatement = 186, + ForStatement = 187, + ForInStatement = 188, + ForOfStatement = 189, + ContinueStatement = 190, + BreakStatement = 191, + ReturnStatement = 192, + WithStatement = 193, + SwitchStatement = 194, + LabeledStatement = 195, + ThrowStatement = 196, + TryStatement = 197, + DebuggerStatement = 198, + VariableDeclaration = 199, + VariableDeclarationList = 200, + FunctionDeclaration = 201, + ClassDeclaration = 202, + InterfaceDeclaration = 203, + TypeAliasDeclaration = 204, + EnumDeclaration = 205, + ModuleDeclaration = 206, + ModuleBlock = 207, + CaseBlock = 208, + ImportEqualsDeclaration = 209, + ImportDeclaration = 210, + ImportClause = 211, + NamespaceImport = 212, + NamedImports = 213, + ImportSpecifier = 214, + ExportAssignment = 215, + ExportDeclaration = 216, + NamedExports = 217, + ExportSpecifier = 218, + MissingDeclaration = 219, + ExternalModuleReference = 220, + CaseClause = 221, + DefaultClause = 222, + HeritageClause = 223, + CatchClause = 224, + PropertyAssignment = 225, + ShorthandPropertyAssignment = 226, + EnumMember = 227, + SourceFile = 228, + SyntaxList = 229, + Count = 230, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, LastReservedWord = 101, FirstKeyword = 66, - LastKeyword = 125, + LastKeyword = 126, FirstFutureReservedWord = 102, LastFutureReservedWord = 110, - FirstTypeNode = 141, - LastTypeNode = 149, + FirstTypeNode = 142, + LastTypeNode = 150, FirstPunctuation = 14, LastPunctuation = 64, FirstToken = 0, - LastToken = 125, + LastToken = 126, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -274,7 +275,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 64, - FirstNode = 126, + FirstNode = 127, } const enum NodeFlags { Export = 1, @@ -290,7 +291,8 @@ declare module "typescript" { Let = 4096, Const = 8192, OctalLiteral = 16384, - ExportContext = 32768, + Namespace = 32768, + ExportContext = 65536, Modifier = 499, AccessibilityModifier = 112, BlockScoped = 12288, @@ -553,7 +555,7 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } - interface HeritageClauseElement extends TypeNode { + interface ExpressionWithTypeArguments extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -597,7 +599,7 @@ declare module "typescript" { interface ForStatement extends IterationStatement { initializer?: VariableDeclarationList | Expression; condition?: Expression; - iterator?: Expression; + incrementor?: Expression; } interface ForInStatement extends IterationStatement { initializer: VariableDeclarationList | Expression; @@ -672,7 +674,7 @@ declare module "typescript" { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -756,6 +758,9 @@ declare module "typescript" { getSourceFile(fileName: string): SourceFile; getCurrentDirectory(): string; } + interface ParseConfigHost { + readDirectory(rootDir: string, extension: string): string[]; + } interface WriteFileCallback { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; } @@ -804,6 +809,7 @@ declare module "typescript" { sourceMapFile: string; sourceMapSourceRoot: string; sourceMapSources: string[]; + sourceMapSourcesContent?: string[]; inputSourceFileNames: string[]; sourceMapNames?: string[]; sourceMapMappings: string; @@ -1005,15 +1011,17 @@ declare module "typescript" { } interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; + } + interface InterfaceTypeWithBaseTypes extends InterfaceType { + baseTypes: ObjectType[]; + } + interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; declaredConstructSignatures: Signature[]; declaredStringIndexType: Type; declaredNumberIndexType: Type; } - interface InterfaceTypeWithBaseTypes extends InterfaceType { - baseTypes: ObjectType[]; - } interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; @@ -1080,11 +1088,15 @@ declare module "typescript" { diagnostics?: boolean; emitBOM?: boolean; help?: boolean; + inlineSourceMap?: boolean; + inlineSources?: boolean; listFiles?: boolean; locale?: string; mapRoot?: string; module?: ModuleKind; + newLine?: NewLineKind; noEmit?: boolean; + noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; noImplicitAny?: boolean; @@ -1110,6 +1122,12 @@ declare module "typescript" { None = 0, CommonJS = 1, AMD = 2, + UMD = 3, + System = 4, + } + const enum NewLineKind { + CarriageReturnLineFeed = 0, + LineFeed = 1, } interface LineAndCharacter { line: number; @@ -1173,6 +1191,32 @@ declare module "typescript" { var sys: System; } declare module "typescript" { + interface ErrorCallback { + (message: DiagnosticMessage, length: number): void; + } + interface Scanner { + getStartPos(): number; + getToken(): SyntaxKind; + getTextPos(): number; + getTokenPos(): number; + getTokenText(): string; + getTokenValue(): string; + hasExtendedUnicodeEscape(): boolean; + hasPrecedingLineBreak(): boolean; + isIdentifier(): boolean; + isReservedWord(): boolean; + isUnterminated(): boolean; + reScanGreaterToken(): SyntaxKind; + reScanSlashToken(): SyntaxKind; + reScanTemplateToken(): SyntaxKind; + scan(): SyntaxKind; + setText(text: string, start?: number, length?: number): void; + setOnError(onError: ErrorCallback): void; + setScriptTarget(scriptTarget: ScriptTarget): void; + setTextPos(textPos: number): void; + lookAhead(callback: () => T): T; + tryScan(callback: () => T): T; + } function tokenToString(t: SyntaxKind): string; function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; @@ -1182,6 +1226,8 @@ declare module "typescript" { function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; + /** Creates a scanner over a (possibly unspecified) range of a piece of text. */ + function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } declare module "typescript" { function getDefaultLibFileName(options: CompilerOptions): string; @@ -1223,7 +1269,7 @@ declare module "typescript" { const version: string; function findConfigFile(searchPath: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; + function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } @@ -1233,14 +1279,26 @@ declare module "typescript" { * Read tsconfig.json file * @param fileName The path to the config file */ - function readConfigFile(fileName: string): any; + function readConfigFile(fileName: string): { + config?: any; + error?: Diagnostic; + }; + /** + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ + function parseConfigFileText(fileName: string, jsonText: string): { + config?: any; + error?: Diagnostic; + }; /** * Parse the contents of a config file (tsconfig.json). * @param json The contents of the config file to parse * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; + function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine; } declare module "typescript" { /** The version of the language service API */ @@ -1337,8 +1395,16 @@ declare module "typescript" { getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; + /** + * @deprecated Use getEncodedSyntacticClassifications instead. + */ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + /** + * @deprecated Use getEncodedSemanticClassifications instead. + */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; + getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; @@ -1348,6 +1414,7 @@ declare module "typescript" { getRenameInfo(fileName: string, position: number): RenameInfo; findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; findReferences(fileName: string, position: number): ReferencedSymbol[]; getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; @@ -1367,6 +1434,10 @@ declare module "typescript" { getSourceFile(fileName: string): SourceFile; dispose(): void; } + interface Classifications { + spans: number[]; + endOfLineState: EndOfLineState; + } interface ClassifiedSpan { textSpan: TextSpan; classificationType: string; @@ -1578,7 +1649,7 @@ declare module "typescript" { text: string; } const enum EndOfLineState { - Start = 0, + None = 0, InMultiLineCommentTrivia = 1, InSingleQuoteStringLiteral = 2, InDoubleQuoteStringLiteral = 3, @@ -1624,8 +1695,10 @@ declare module "typescript" { * classifications which may be incorrectly categorized will be given * back as Identifiers in order to allow the syntactic classifier to * subsume the classification. + * @deprecated Use getLexicalClassifications instead. */ getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; + getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; } /** * The document registry represents a store of SourceFile objects that can be shared between @@ -1736,7 +1809,27 @@ declare module "typescript" { static interfaceName: string; static moduleName: string; static typeParameterName: string; - static typeAlias: string; + static typeAliasName: string; + static parameterName: string; + } + const enum ClassificationType { + comment = 1, + identifier = 2, + keyword = 3, + numericLiteral = 4, + operator = 5, + stringLiteral = 6, + regularExpressionLiteral = 7, + whiteSpace = 8, + text = 9, + punctuation = 10, + className = 11, + enumName = 12, + interfaceName = 13, + moduleName = 14, + typeParameterName = 15, + typeAliasName = 16, + parameterName = 17, } interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; diff --git a/bin/typescript.js b/bin/typescript.js index 4d2f3d10827..ba375bc4096 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -145,149 +145,150 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 115] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 116] = "GetKeyword"; SyntaxKind[SyntaxKind["ModuleKeyword"] = 117] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 118] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 119] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 120] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 121] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 122] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 123] = "TypeKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 124] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 125] = "OfKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 118] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 119] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 120] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 121] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 122] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 123] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 124] = "TypeKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 125] = "FromKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 126] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 126] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 127] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 127] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 128] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 128] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 129] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 130] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 129] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 130] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 131] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 131] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 132] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 133] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 134] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 135] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 136] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 137] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 138] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 139] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 140] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 132] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 133] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 134] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 135] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 136] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 137] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 138] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 139] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 140] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 141] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypeReference"] = 141] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 142] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 143] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 144] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 145] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 146] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 147] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 148] = "UnionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 149] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["TypeReference"] = 142] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 143] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 144] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 145] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 146] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 147] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 148] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 149] = "UnionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 150] = "ParenthesizedType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 150] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 151] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 152] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 151] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 152] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 153] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 153] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 154] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 155] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 156] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 157] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 158] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 159] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 160] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 161] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 162] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 163] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 164] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 165] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 166] = "VoidExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 167] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 168] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 169] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 170] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 171] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 172] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 173] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 174] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 175] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 154] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 155] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 156] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 157] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 158] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 159] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 160] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 161] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 162] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 163] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 164] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 165] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 166] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 167] = "VoidExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 168] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 169] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 170] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 171] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 172] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 173] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElementExpression"] = 174] = "SpreadElementExpression"; + SyntaxKind[SyntaxKind["ClassExpression"] = 175] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 176] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 177] = "ExpressionWithTypeArguments"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 176] = "TemplateSpan"; - SyntaxKind[SyntaxKind["HeritageClauseElement"] = 177] = "HeritageClauseElement"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 178] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 178] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 179] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 179] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 180] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 181] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 182] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 183] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 184] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 185] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 186] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 187] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 188] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 189] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 190] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 191] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 192] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 193] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 194] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 195] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 196] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 197] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 198] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 199] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 200] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 201] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 202] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 203] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 204] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 205] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 206] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 207] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 208] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 209] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 210] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 211] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 212] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 213] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 214] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 215] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 216] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 217] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 218] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 180] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 181] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 182] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 183] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 184] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 185] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 186] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 187] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 188] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 189] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 190] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 191] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 192] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 193] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 194] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 195] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 196] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 197] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 198] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 199] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 200] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 201] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 202] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 203] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 204] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 205] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 206] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 207] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 208] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 209] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 210] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 211] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 212] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 213] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 214] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 215] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 216] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 217] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 218] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 219] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 219] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 220] = "ExternalModuleReference"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 220] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 221] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 222] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 223] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 221] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 222] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 223] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 224] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 224] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 225] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 225] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 226] = "ShorthandPropertyAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 226] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 227] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 227] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 228] = "SourceFile"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 228] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 229] = "SyntaxList"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 229] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 230] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 53] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 64] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 66] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 125] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 126] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 142] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 150] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 64] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 125] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 126] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 6] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 7] = "FirstLiteralToken"; @@ -296,7 +297,7 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 13] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 24] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 64] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 126] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 127] = "FirstNode"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -313,7 +314,8 @@ var ts; NodeFlags[NodeFlags["Let"] = 4096] = "Let"; NodeFlags[NodeFlags["Const"] = 8192] = "Const"; NodeFlags[NodeFlags["OctalLiteral"] = 16384] = "OctalLiteral"; - NodeFlags[NodeFlags["ExportContext"] = 32768] = "ExportContext"; + NodeFlags[NodeFlags["Namespace"] = 32768] = "Namespace"; + NodeFlags[NodeFlags["ExportContext"] = 65536] = "ExportContext"; NodeFlags[NodeFlags["Modifier"] = 499] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = 112] = "AccessibilityModifier"; NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; @@ -541,8 +543,15 @@ var ts; ModuleKind[ModuleKind["None"] = 0] = "None"; ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; + ModuleKind[ModuleKind["UMD"] = 3] = "UMD"; + ModuleKind[ModuleKind["System"] = 4] = "System"; })(ts.ModuleKind || (ts.ModuleKind = {})); var ModuleKind = ts.ModuleKind; + (function (NewLineKind) { + NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; + })(ts.NewLineKind || (ts.NewLineKind = {})); + var NewLineKind = ts.NewLineKind; (function (ScriptTarget) { ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; @@ -1133,7 +1142,7 @@ var ts; for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + if (part === ".." && normalized.length > 0 && lastOrUndefined(normalized) !== "..") { normalized.pop(); } else { @@ -1240,7 +1249,7 @@ var ts; function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.length--; @@ -1694,7 +1703,7 @@ var ts; A_get_accessor_cannot_have_parameters: { code: 1054, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, + An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: ts.DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: ts.DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, @@ -1755,8 +1764,8 @@ var ts; or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "'{' or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in a namespace cannot reference a module." }, + Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules unless the '--module' flag is provided." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, var_let_or_const_expected: { code: 1152, category: ts.DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, @@ -1798,9 +1807,9 @@ var ts; The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, An_import_declaration_cannot_have_modifiers: { code: 1191, category: ts.DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "External module '{0}' has no default export." }, + Module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no default export." }, An_export_declaration_cannot_have_modifiers: { code: 1193, category: ts.DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." }, + Export_declarations_are_not_permitted_in_a_namespace: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in a namespace." }, Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: ts.DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." }, Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." }, Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, @@ -1809,28 +1818,27 @@ var ts; Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, - Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, + Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." }, Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." }, Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, - Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." }, + Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, + Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, Circular_definition_of_import_alias_0: { code: 2303, category: ts.DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, Cannot_find_name_0: { code: 2304, category: ts.DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not a module." }, + Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find module '{0}'." }, A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: ts.DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, @@ -1853,7 +1861,7 @@ var ts; Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: ts.DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: ts.DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible: { code: 2330, category: ts.DiagnosticCategory.Error, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_module_or_namespace_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module or namespace body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, @@ -1945,15 +1953,15 @@ var ts; Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient modules cannot be nested in other modules." }, + Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient module declaration cannot specify relative module name." }, Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, @@ -2007,11 +2015,13 @@ var ts; Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, - External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, - External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, + Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "Module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "Module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." }, + Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "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}'." }, 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}'." }, @@ -2087,6 +2097,7 @@ var ts; Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported file encoding." }, + Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." }, Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, @@ -2100,6 +2111,10 @@ var ts; Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." }, Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." }, Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, + Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." }, + Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -2111,7 +2126,7 @@ var ts; Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." }, Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." }, @@ -2132,8 +2147,8 @@ var ts; Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." }, + Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, @@ -2146,6 +2161,9 @@ var ts; Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, + Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." }, + NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" }, + Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -2158,7 +2176,6 @@ var ts; 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." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: ts.DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: ts.DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, _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: { code: 7023, category: ts.DiagnosticCategory.Error, key: "'{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." }, Function_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: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function 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." }, @@ -2214,7 +2231,7 @@ var ts; "false": 80 /* FalseKeyword */, "finally": 81 /* FinallyKeyword */, "for": 82 /* ForKeyword */, - "from": 124 /* FromKeyword */, + "from": 125 /* FromKeyword */, "function": 83 /* FunctionKeyword */, "get": 116 /* GetKeyword */, "if": 84 /* IfKeyword */, @@ -2225,33 +2242,34 @@ var ts; "interface": 103 /* InterfaceKeyword */, "let": 104 /* LetKeyword */, "module": 117 /* ModuleKeyword */, + "namespace": 118 /* NamespaceKeyword */, "new": 88 /* NewKeyword */, "null": 89 /* NullKeyword */, - "number": 119 /* NumberKeyword */, + "number": 120 /* NumberKeyword */, "package": 105 /* PackageKeyword */, "private": 106 /* PrivateKeyword */, "protected": 107 /* ProtectedKeyword */, "public": 108 /* PublicKeyword */, - "require": 118 /* RequireKeyword */, + "require": 119 /* RequireKeyword */, "return": 90 /* ReturnKeyword */, - "set": 120 /* SetKeyword */, + "set": 121 /* SetKeyword */, "static": 109 /* StaticKeyword */, - "string": 121 /* StringKeyword */, + "string": 122 /* StringKeyword */, "super": 91 /* SuperKeyword */, "switch": 92 /* SwitchKeyword */, - "symbol": 122 /* SymbolKeyword */, + "symbol": 123 /* SymbolKeyword */, "this": 93 /* ThisKeyword */, "throw": 94 /* ThrowKeyword */, "true": 95 /* TrueKeyword */, "try": 96 /* TryKeyword */, - "type": 123 /* TypeKeyword */, + "type": 124 /* TypeKeyword */, "typeof": 97 /* TypeOfKeyword */, "var": 98 /* VarKeyword */, "void": 99 /* VoidKeyword */, "while": 100 /* WhileKeyword */, "with": 101 /* WithKeyword */, "yield": 110 /* YieldKeyword */, - "of": 125 /* OfKeyword */, + "of": 126 /* OfKeyword */, "{": 14 /* OpenBraceToken */, "}": 15 /* CloseBraceToken */, "(": 16 /* OpenParenToken */, @@ -2489,7 +2507,7 @@ var ts; function isLineBreak(ch) { // ES5 7.3: // The ECMAScript line terminator characters are listed in Table 3. - // Table 3 � Line Terminator Characters + // Table 3: Line Terminator Characters // Code Unit Value Name Formal Name // \u000A Line Feed // \u000D Carriage Return @@ -2643,7 +2661,7 @@ var ts; } collecting = true; if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } continue; case 9 /* tab */: @@ -2689,7 +2707,7 @@ var ts; default: if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } pos++; continue; @@ -2719,8 +2737,7 @@ var ts; ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; - // Creates a scanner over a (possibly unspecified) range of a piece of text. - /* @internal */ + /** Creates a scanner over a (possibly unspecified) range of a piece of text. */ function createScanner(languageVersion, skipTrivia, text, onError, start, length) { var pos; // Current position (end position of text of current token) var end; // end of text @@ -3569,16 +3586,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 203 /* TypeAliasDeclaration */) { + if (node.kind === 203 /* InterfaceDeclaration */ || node.kind === 204 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { + else if ((node.kind === 210 /* ImportDeclaration */ || node.kind === 209 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 206 /* ModuleBlock */) { + else if (node.kind === 207 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -3597,7 +3614,7 @@ var ts; }); return state; } - else if (node.kind === 205 /* ModuleDeclaration */) { + else if (node.kind === 206 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -3652,10 +3669,10 @@ var ts; // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { + if (node.kind === 206 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { return '"' + node.name.text + '"'; } - if (node.name.kind === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -3663,22 +3680,22 @@ var ts; return node.name.text; } switch (node.kind) { - case 143 /* ConstructorType */: - case 135 /* Constructor */: + case 144 /* ConstructorType */: + case 136 /* Constructor */: return "__constructor"; - case 142 /* FunctionType */: - case 138 /* CallSignature */: + case 143 /* FunctionType */: + case 139 /* CallSignature */: return "__call"; - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: return "__new"; - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: return "__index"; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return "__export"; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 200 /* FunctionDeclaration */: - case 201 /* ClassDeclaration */: + case 201 /* FunctionDeclaration */: + case 202 /* ClassDeclaration */: return node.flags & 256 /* Default */ ? "default" : undefined; } } @@ -3713,7 +3730,7 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if ((node.kind === 201 /* ClassDeclaration */ || node.kind === 174 /* ClassExpression */) && symbol.exports) { + if ((node.kind === 202 /* ClassDeclaration */ || node.kind === 175 /* ClassExpression */) && symbol.exports) { // 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. @@ -3733,7 +3750,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1 /* Export */; if (symbolKind & 8388608 /* Alias */) { - if (node.kind === 217 /* ExportSpecifier */ || (node.kind === 208 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 218 /* ExportSpecifier */ || (node.kind === 209 /* ImportEqualsDeclaration */ && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -3752,7 +3769,7 @@ 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 & 32768 /* ExportContext */) { + if (hasExportModifier || container.flags & 65536 /* ExportContext */) { var exportKind = (symbolKind & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | (symbolKind & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolKind & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); @@ -3777,10 +3794,7 @@ var ts; parent = node; if (symbolKind & 262128 /* IsContainer */) { container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; + addToContainerChain(container); } if (isBlockScopeContainer) { // in incremental scenarios we might reuse nodes that already have locals being allocated @@ -3789,50 +3803,56 @@ var ts; // these cases are: // - node has locals (symbolKind & HasLocals) !== 0 // - node is a source file - setBlockScopeContainer(node, (symbolKind & 255504 /* HasLocals */) === 0 && node.kind !== 227 /* SourceFile */); + setBlockScopeContainer(node, (symbolKind & 255504 /* HasLocals */) === 0 && node.kind !== 228 /* SourceFile */); } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } + function addToContainerChain(node) { + if (lastContainer) { + lastContainer.nextContainer = node; + } + lastContainer = node; + } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 174 /* ClassExpression */: - case 201 /* ClassDeclaration */: + case 175 /* ClassExpression */: + case 202 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 145 /* TypeLiteral */: - case 154 /* ObjectLiteralExpression */: - case 202 /* InterfaceDeclaration */: + case 146 /* TypeLiteral */: + case 155 /* ObjectLiteralExpression */: + case 203 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -3847,11 +3867,11 @@ var ts; return false; } function hasExportDeclarations(node) { - var body = node.kind === 227 /* SourceFile */ ? node : node.body; - if (body.kind === 227 /* SourceFile */ || body.kind === 206 /* ModuleBlock */) { + var body = node.kind === 228 /* SourceFile */ ? node : node.body; + if (body.kind === 228 /* SourceFile */ || body.kind === 207 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 215 /* ExportDeclaration */ || stat.kind === 214 /* ExportAssignment */) { + if (stat.kind === 216 /* ExportDeclaration */ || stat.kind === 215 /* ExportAssignment */) { return true; } } @@ -3862,10 +3882,10 @@ var ts; // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular // declarations with export modifiers) is an export context in which declarations are implicitly exported. if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 32768 /* ExportContext */; + node.flags |= 65536 /* ExportContext */; } else { - node.flags &= ~32768 /* ExportContext */; + node.flags &= ~65536 /* ExportContext */; } } function bindModuleDeclaration(node) { @@ -3905,7 +3925,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 142 /* FunctionType */ ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 143 /* FunctionType */ ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -3917,10 +3937,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -3929,6 +3949,7 @@ var ts; default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); } declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } @@ -3943,14 +3964,14 @@ var ts; function bind(node) { node.parent = parent; switch (node.kind) { - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: bindDeclaration(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */, false); break; - case 129 /* Parameter */: + case 130 /* Parameter */: bindParameter(node); break; - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -3961,72 +3982,72 @@ var ts; bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); } break; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0), 107455 /* PropertyExcludes */, false); break; - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 226 /* EnumMember */: + case 227 /* EnumMember */: bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: bindDeclaration(node, 131072 /* Signature */, 0, false); break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* 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. bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */, true); break; - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 135 /* Constructor */: + case 136 /* Constructor */: bindDeclaration(node, 16384 /* Constructor */, 0, true); break; - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 137 /* SetAccessor */: + case 138 /* SetAccessor */: bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: bindFunctionOrConstructorType(node); break; - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: bindAnonymousDeclaration(node, 32 /* Class */, "__class", false); break; - case 223 /* CatchClause */: + case 224 /* CatchClause */: bindCatchVariableDeclaration(node); break; - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: bindBlockScopedDeclaration(node, 32 /* Class */, 899583 /* ClassExcludes */); break; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: bindDeclaration(node, 64 /* Interface */, 792992 /* InterfaceExcludes */, false); break; - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: bindDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */, false); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: if (ts.isConst(node)) { bindDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */, false); } @@ -4034,16 +4055,16 @@ var ts; bindDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */, false); } break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 208 /* ImportEqualsDeclaration */: - case 211 /* NamespaceImport */: - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 212 /* NamespaceImport */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); break; - case 210 /* ImportClause */: + case 211 /* ImportClause */: if (node.name) { bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); } @@ -4051,14 +4072,14 @@ var ts; bindChildren(node, 0, false); } break; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: if (!node.exportClause) { // All export * declarations are collected in an __export symbol declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0); } bindChildren(node, 0, false); break; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: if (node.expression.kind === 65 /* Identifier */) { // An export default clause with an identifier exports all meanings of that identifier declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); @@ -4069,13 +4090,13 @@ var ts; } bindChildren(node, 0, false); break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: setExportContextFlag(node); if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 179 /* Block */: + case 180 /* Block */: // do not treat function block a block-scope container // all block-scope locals that reside in this block should go to the function locals. // Otherwise this won't be considered as redeclaration of a block scoped local: @@ -4086,11 +4107,11 @@ var ts; // 'let x' will be placed into the function locals and 'let x' - into the locals of the block bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 223 /* CatchClause */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 207 /* CaseBlock */: + case 224 /* CatchClause */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 208 /* CaseBlock */: bindChildren(node, 0, true); break; default: @@ -4110,8 +4131,8 @@ var ts; // If this is a property-parameter, then also declare the property symbol into the // containing class. if (node.flags & 112 /* AccessibilityModifier */ && - node.parent.kind === 135 /* Constructor */ && - (node.parent.parent.kind === 201 /* ClassDeclaration */ || node.parent.parent.kind === 174 /* ClassExpression */)) { + node.parent.kind === 136 /* Constructor */ && + (node.parent.parent.kind === 202 /* ClassDeclaration */ || node.parent.parent.kind === 175 /* ClassExpression */)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } @@ -4201,7 +4222,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 227 /* SourceFile */) { + while (node && node.kind !== 228 /* SourceFile */) { node = node.parent; } return node; @@ -4311,15 +4332,15 @@ var ts; return current; } switch (current.kind) { - case 227 /* SourceFile */: - case 207 /* CaseBlock */: - case 223 /* CatchClause */: - case 205 /* ModuleDeclaration */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 228 /* SourceFile */: + case 208 /* CaseBlock */: + case 224 /* CatchClause */: + case 206 /* ModuleDeclaration */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: return current; - case 179 /* Block */: + case 180 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { @@ -4332,9 +4353,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 198 /* VariableDeclaration */ && + declaration.kind === 199 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 223 /* CatchClause */; + declaration.parent.kind === 224 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; // Return display name of an identifier @@ -4373,7 +4394,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -4382,16 +4403,16 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: - case 201 /* ClassDeclaration */: - case 174 /* ClassExpression */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 202 /* ClassDeclaration */: + case 175 /* ClassExpression */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: errorNode = node.name; break; } @@ -4415,11 +4436,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 204 /* EnumDeclaration */ && isConst(node); + return node.kind === 205 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 152 /* BindingElement */ || isBindingPattern(node))) { + while (node && (node.kind === 153 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; @@ -4434,14 +4455,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 198 /* VariableDeclaration */) { + if (node.kind === 199 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 199 /* VariableDeclarationList */) { + if (node && node.kind === 200 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 180 /* VariableStatement */) { + if (node && node.kind === 181 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -4456,12 +4477,12 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 182 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; + return node.kind === 183 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { // If parameter/type parameter, the prev token trailing comments are part of this node too - if (node.kind === 129 /* Parameter */ || node.kind === 128 /* TypeParameter */) { + if (node.kind === 130 /* Parameter */ || node.kind === 129 /* TypeParameter */) { // e.g. (/** blah */ a, /** blah */ b); // e.g.: ( // /** blah */ a, @@ -4490,23 +4511,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return visitor(node); - case 207 /* CaseBlock */: - case 179 /* Block */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 192 /* WithStatement */: - case 193 /* SwitchStatement */: - case 220 /* CaseClause */: - case 221 /* DefaultClause */: - case 194 /* LabeledStatement */: - case 196 /* TryStatement */: - case 223 /* CatchClause */: + case 208 /* CaseBlock */: + case 180 /* Block */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 193 /* WithStatement */: + case 194 /* SwitchStatement */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: + case 195 /* LabeledStatement */: + case 197 /* TryStatement */: + case 224 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4515,14 +4536,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 152 /* BindingElement */: - case 226 /* EnumMember */: - case 129 /* Parameter */: - case 224 /* PropertyAssignment */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 225 /* ShorthandPropertyAssignment */: - case 198 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 227 /* EnumMember */: + case 130 /* Parameter */: + case 225 /* PropertyAssignment */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 226 /* ShorthandPropertyAssignment */: + case 199 /* VariableDeclaration */: return true; } } @@ -4532,8 +4553,8 @@ var ts; function isAccessor(node) { if (node) { switch (node.kind) { - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return true; } } @@ -4543,22 +4564,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 135 /* Constructor */: - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 200 /* FunctionDeclaration */: + case 136 /* Constructor */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: return true; } } @@ -4566,11 +4587,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 179 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 180 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 134 /* MethodDeclaration */ && node.parent.kind === 154 /* ObjectLiteralExpression */; + return node && node.kind === 135 /* MethodDeclaration */ && node.parent.kind === 155 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -4589,12 +4610,12 @@ var ts; return undefined; } switch (node.kind) { - case 127 /* ComputedPropertyName */: + case 128 /* 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 // so that we can error on it. - if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.parent.kind === 202 /* ClassDeclaration */) { return node; } // If this is a computed property, then the parent should not @@ -4604,9 +4625,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 130 /* Decorator */: + case 131 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 130 /* 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; @@ -4617,23 +4638,23 @@ var ts; node = node.parent; } break; - case 163 /* ArrowFunction */: + case 164 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // Fall through - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 205 /* ModuleDeclaration */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 204 /* EnumDeclaration */: - case 227 /* SourceFile */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 206 /* ModuleDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 205 /* EnumDeclaration */: + case 228 /* SourceFile */: return node; } } @@ -4645,12 +4666,12 @@ var ts; if (!node) return node; switch (node.kind) { - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'super' container. // A computed property name in a class needs to be a super container // so that we can error on it. - if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.parent.kind === 202 /* ClassDeclaration */) { return node; } // If this is a computed property, then the parent should not @@ -4660,9 +4681,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 130 /* Decorator */: + case 131 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 130 /* 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; @@ -4673,26 +4694,26 @@ var ts; node = node.parent; } break; - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: if (!includeFunctions) { continue; } - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* TaggedTemplateExpression */) { return node.tag; } // Will either be a CallExpression or NewExpression. @@ -4701,44 +4722,44 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: // classes are valid targets return true; - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 201 /* ClassDeclaration */; - case 129 /* Parameter */: + return node.parent.kind === 202 /* ClassDeclaration */; + case 130 /* 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 === 201 /* ClassDeclaration */; - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 134 /* MethodDeclaration */: + return node.parent.body && node.parent.parent.kind === 202 /* ClassDeclaration */; + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 135 /* 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 === 201 /* ClassDeclaration */; + return node.body && node.parent.kind === 202 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: if (node.decorators) { return true; } return false; - case 132 /* PropertyDeclaration */: - case 129 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 130 /* Parameter */: if (node.decorators) { return true; } return false; - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: if (node.body && node.decorators) { return true; } return false; - case 134 /* MethodDeclaration */: - case 137 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 138 /* SetAccessor */: if (node.body && node.decorators) { return true; } @@ -4749,10 +4770,10 @@ var ts; ts.nodeIsDecorated = nodeIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 134 /* MethodDeclaration */: - case 137 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 138 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } return false; @@ -4770,37 +4791,37 @@ var ts; case 95 /* TrueKeyword */: case 80 /* FalseKeyword */: case 9 /* RegularExpressionLiteral */: - case 153 /* ArrayLiteralExpression */: - case 154 /* ObjectLiteralExpression */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 159 /* TaggedTemplateExpression */: - case 160 /* TypeAssertionExpression */: - case 161 /* ParenthesizedExpression */: - case 162 /* FunctionExpression */: - case 174 /* ClassExpression */: - case 163 /* ArrowFunction */: - case 166 /* VoidExpression */: - case 164 /* DeleteExpression */: - case 165 /* TypeOfExpression */: - case 167 /* PrefixUnaryExpression */: - case 168 /* PostfixUnaryExpression */: - case 169 /* BinaryExpression */: - case 170 /* ConditionalExpression */: - case 173 /* SpreadElementExpression */: - case 171 /* TemplateExpression */: + case 154 /* ArrayLiteralExpression */: + case 155 /* ObjectLiteralExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 160 /* TaggedTemplateExpression */: + case 161 /* TypeAssertionExpression */: + case 162 /* ParenthesizedExpression */: + case 163 /* FunctionExpression */: + case 175 /* ClassExpression */: + case 164 /* ArrowFunction */: + case 167 /* VoidExpression */: + case 165 /* DeleteExpression */: + case 166 /* TypeOfExpression */: + case 168 /* PrefixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: + case 170 /* BinaryExpression */: + case 171 /* ConditionalExpression */: + case 174 /* SpreadElementExpression */: + case 172 /* TemplateExpression */: case 10 /* NoSubstitutionTemplateLiteral */: - case 175 /* OmittedExpression */: + case 176 /* OmittedExpression */: return true; - case 126 /* QualifiedName */: - while (node.parent.kind === 126 /* QualifiedName */) { + case 127 /* QualifiedName */: + while (node.parent.kind === 127 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 144 /* TypeQuery */; + return node.parent.kind === 145 /* TypeQuery */; case 65 /* Identifier */: - if (node.parent.kind === 144 /* TypeQuery */) { + if (node.parent.kind === 145 /* TypeQuery */) { return true; } // fall through @@ -4808,42 +4829,42 @@ var ts; case 8 /* StringLiteral */: var parent_1 = node.parent; switch (parent_1.kind) { - case 198 /* VariableDeclaration */: - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 226 /* EnumMember */: - case 224 /* PropertyAssignment */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 227 /* EnumMember */: + case 225 /* PropertyAssignment */: + case 153 /* BindingElement */: return parent_1.initializer === node; - case 182 /* ExpressionStatement */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 191 /* ReturnStatement */: - case 192 /* WithStatement */: - case 193 /* SwitchStatement */: - case 220 /* CaseClause */: - case 195 /* ThrowStatement */: - case 193 /* SwitchStatement */: + case 183 /* ExpressionStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 192 /* ReturnStatement */: + case 193 /* WithStatement */: + case 194 /* SwitchStatement */: + case 221 /* CaseClause */: + case 196 /* ThrowStatement */: + case 194 /* SwitchStatement */: return parent_1.expression === node; - case 186 /* ForStatement */: + case 187 /* ForStatement */: var forStatement = parent_1; - return (forStatement.initializer === node && forStatement.initializer.kind !== 199 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 200 /* VariableDeclarationList */) || forStatement.condition === node || - forStatement.iterator === node; - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + forStatement.incrementor === node; + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: var forInStatement = parent_1; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 200 /* VariableDeclarationList */) || forInStatement.expression === node; - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return node === parent_1.expression; - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return node === parent_1.expression; - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: return node === parent_1.expression; - case 130 /* Decorator */: + case 131 /* Decorator */: return true; default: if (isExpression(parent_1)) { @@ -4861,7 +4882,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */; + return node.kind === 209 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 220 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4870,40 +4891,40 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 219 /* ExternalModuleReference */; + return node.kind === 209 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 220 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 209 /* ImportDeclaration */) { + if (node.kind === 210 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 208 /* ImportEqualsDeclaration */) { + if (node.kind === 209 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 219 /* ExternalModuleReference */) { + if (reference.kind === 220 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 215 /* ExportDeclaration */) { + if (node.kind === 216 /* ExportDeclaration */) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 129 /* Parameter */ && node.dotDotDotToken !== undefined; + return node && node.kind === 130 /* Parameter */ && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 129 /* Parameter */: + case 130 /* Parameter */: return node.questionToken !== undefined; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return node.questionToken !== undefined; - case 225 /* ShorthandPropertyAssignment */: - case 224 /* PropertyAssignment */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 226 /* ShorthandPropertyAssignment */: + case 225 /* PropertyAssignment */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -4911,7 +4932,7 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function hasRestParameters(s) { - return s.parameters.length > 0 && s.parameters[s.parameters.length - 1].dotDotDotToken !== undefined; + return s.parameters.length > 0 && ts.lastOrUndefined(s.parameters).dotDotDotToken !== undefined; } ts.hasRestParameters = hasRestParameters; function isLiteralKind(kind) { @@ -4927,7 +4948,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 151 /* ArrayBindingPattern */ || node.kind === 150 /* ObjectBindingPattern */); + return !!node && (node.kind === 152 /* ArrayBindingPattern */ || node.kind === 151 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -4942,33 +4963,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 163 /* ArrowFunction */: - case 152 /* BindingElement */: - case 201 /* ClassDeclaration */: - case 135 /* Constructor */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 217 /* ExportSpecifier */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 136 /* GetAccessor */: - case 210 /* ImportClause */: - case 208 /* ImportEqualsDeclaration */: - case 213 /* ImportSpecifier */: - case 202 /* InterfaceDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 205 /* ModuleDeclaration */: - case 211 /* NamespaceImport */: - case 129 /* Parameter */: - case 224 /* PropertyAssignment */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 137 /* SetAccessor */: - case 225 /* ShorthandPropertyAssignment */: - case 203 /* TypeAliasDeclaration */: - case 128 /* TypeParameter */: - case 198 /* VariableDeclaration */: + case 164 /* ArrowFunction */: + case 153 /* BindingElement */: + case 202 /* ClassDeclaration */: + case 136 /* Constructor */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 218 /* ExportSpecifier */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 137 /* GetAccessor */: + case 211 /* ImportClause */: + case 209 /* ImportEqualsDeclaration */: + case 214 /* ImportSpecifier */: + case 203 /* InterfaceDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 206 /* ModuleDeclaration */: + case 212 /* NamespaceImport */: + case 130 /* Parameter */: + case 225 /* PropertyAssignment */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 138 /* SetAccessor */: + case 226 /* ShorthandPropertyAssignment */: + case 204 /* TypeAliasDeclaration */: + case 129 /* TypeParameter */: + case 199 /* VariableDeclaration */: return true; } return false; @@ -4976,25 +4997,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: - case 197 /* DebuggerStatement */: - case 184 /* DoStatement */: - case 182 /* ExpressionStatement */: - case 181 /* EmptyStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 186 /* ForStatement */: - case 183 /* IfStatement */: - case 194 /* LabeledStatement */: - case 191 /* ReturnStatement */: - case 193 /* SwitchStatement */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 198 /* DebuggerStatement */: + case 185 /* DoStatement */: + case 183 /* ExpressionStatement */: + case 182 /* EmptyStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 187 /* ForStatement */: + case 184 /* IfStatement */: + case 195 /* LabeledStatement */: + case 192 /* ReturnStatement */: + case 194 /* SwitchStatement */: case 94 /* ThrowKeyword */: - case 196 /* TryStatement */: - case 180 /* VariableStatement */: - case 185 /* WhileStatement */: - case 192 /* WithStatement */: - case 214 /* ExportAssignment */: + case 197 /* TryStatement */: + case 181 /* VariableStatement */: + case 186 /* WhileStatement */: + case 193 /* WithStatement */: + case 215 /* ExportAssignment */: return true; default: return false; @@ -5003,13 +5024,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 135 /* Constructor */: - case 132 /* PropertyDeclaration */: - case 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 133 /* MethodSignature */: - case 140 /* IndexSignature */: + case 136 /* Constructor */: + case 133 /* PropertyDeclaration */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 134 /* MethodSignature */: + case 141 /* IndexSignature */: return true; default: return false; @@ -5022,7 +5043,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 213 /* ImportSpecifier */ || parent.kind === 217 /* ExportSpecifier */) { + if (parent.kind === 214 /* ImportSpecifier */ || parent.kind === 218 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -5042,12 +5063,12 @@ var ts; // export = ... // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 208 /* ImportEqualsDeclaration */ || - node.kind === 210 /* ImportClause */ && !!node.name || - node.kind === 211 /* NamespaceImport */ || - node.kind === 213 /* ImportSpecifier */ || - node.kind === 217 /* ExportSpecifier */ || - node.kind === 214 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; + return node.kind === 209 /* ImportEqualsDeclaration */ || + node.kind === 211 /* ImportClause */ && !!node.name || + node.kind === 212 /* NamespaceImport */ || + node.kind === 214 /* ImportSpecifier */ || + node.kind === 218 /* ExportSpecifier */ || + node.kind === 215 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -5130,7 +5151,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 66 /* FirstKeyword */ <= token && token <= 125 /* LastKeyword */; + return 66 /* FirstKeyword */ <= token && token <= 126 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -5146,7 +5167,7 @@ var ts; */ function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 127 /* ComputedPropertyName */ && + declaration.name.kind === 128 /* ComputedPropertyName */ && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; @@ -5156,14 +5177,14 @@ var ts; * where Symbol is literally the word "Symbol", and name is any identifierName */ function isWellKnownSymbolSyntactically(node) { - return node.kind === 155 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); + return node.kind === 156 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { if (name.kind === 65 /* Identifier */ || name.kind === 8 /* StringLiteral */ || name.kind === 7 /* NumericLiteral */) { return name.text; } - if (name.kind === 127 /* ComputedPropertyName */) { + if (name.kind === 128 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -5200,7 +5221,7 @@ var ts; } ts.isModifier = isModifier; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 205 /* ModuleDeclaration */ || n.kind === 227 /* SourceFile */; + return isFunctionLike(n) || n.kind === 206 /* ModuleDeclaration */ || n.kind === 228 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -5375,7 +5396,7 @@ var ts; var lineStartsOfS = ts.computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); } } } @@ -5436,7 +5457,7 @@ var ts; ts.getLineOfLocalPosition = getLineOfLocalPosition; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 135 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 136 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -5444,8 +5465,10 @@ var ts; ts.getFirstConstructorWithBody = getFirstConstructorWithBody; function shouldEmitToOwnFile(sourceFile, compilerOptions) { if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; + if ((isExternalModule(sourceFile) || !compilerOptions.out)) { + // 1. in-browser single file compilation scenario + // 2. non .js file + return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js"); } return false; } @@ -5459,10 +5482,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 136 /* GetAccessor */) { + if (accessor.kind === 137 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 137 /* SetAccessor */) { + else if (accessor.kind === 138 /* SetAccessor */) { setAccessor = accessor; } else { @@ -5471,7 +5494,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) + if ((member.kind === 137 /* GetAccessor */ || member.kind === 138 /* SetAccessor */) && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -5482,10 +5505,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 136 /* GetAccessor */ && !getAccessor) { + if (member.kind === 137 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 137 /* SetAccessor */ && !setAccessor) { + if (member.kind === 138 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -5633,22 +5656,22 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 158 /* NewExpression */: - case 157 /* CallExpression */: - case 159 /* TaggedTemplateExpression */: - case 153 /* ArrayLiteralExpression */: - case 161 /* ParenthesizedExpression */: - case 154 /* ObjectLiteralExpression */: - case 174 /* ClassExpression */: - case 162 /* FunctionExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 159 /* NewExpression */: + case 158 /* CallExpression */: + case 160 /* TaggedTemplateExpression */: + case 154 /* ArrayLiteralExpression */: + case 162 /* ParenthesizedExpression */: + case 155 /* ObjectLiteralExpression */: + case 175 /* ClassExpression */: + case 163 /* FunctionExpression */: case 65 /* Identifier */: case 9 /* RegularExpressionLiteral */: case 7 /* NumericLiteral */: case 8 /* StringLiteral */: case 10 /* NoSubstitutionTemplateLiteral */: - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: case 80 /* FalseKeyword */: case 89 /* NullKeyword */: case 93 /* ThisKeyword */: @@ -5666,30 +5689,97 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; // Returns false if this heritage clause element's expression contains something unsupported // (i.e. not a name or dotted name). - function isSupportedHeritageClauseElement(node) { - return isSupportedHeritageClauseElementExpression(node.expression); + function isSupportedExpressionWithTypeArguments(node) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } - ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; - function isSupportedHeritageClauseElementExpression(node) { + ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; + function isSupportedExpressionWithTypeArgumentsRest(node) { if (node.kind === 65 /* Identifier */) { return true; } - else if (node.kind === 155 /* PropertyAccessExpression */) { - return isSupportedHeritageClauseElementExpression(node.expression); + else if (node.kind === 156 /* PropertyAccessExpression */) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } else { return false; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function getLocalSymbolForExportDefault(symbol) { return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + /** + * Replace each instance of non-ascii characters by one, two, three, or four escape sequences + * representing the UTF-8 encoding of the character, and return the expanded char code list. + */ + function getExpandedCharCodes(input) { + var output = []; + var length = input.length; + var leadSurrogate = undefined; + for (var i = 0; i < length; i++) { + var charCode = input.charCodeAt(i); + // handel utf8 + if (charCode < 0x80) { + output.push(charCode); + } + else if (charCode < 0x800) { + output.push((charCode >> 6) | 192); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x10000) { + output.push((charCode >> 12) | 224); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x20000) { + output.push((charCode >> 18) | 240); + output.push(((charCode >> 12) & 63) | 128); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else { + ts.Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + /** + * Converts a string to a base-64 encoded ASCII string. + */ + function convertToBase64(input) { + var result = ""; + var charCodes = getExpandedCharCodes(input); + var i = 0; + var length = charCodes.length; + var byte1, byte2, byte3, byte4; + while (i < length) { + // Convert every 6-bits in the input 3 character points + // into a base64 digit + byte1 = charCodes[i] >> 2; + byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; + byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; + byte4 = charCodes[i + 2] & 63; + // We are out of characters in the input, set the extra + // digits to 64 (padding character). + if (i + 1 >= length) { + byte3 = byte4 = 64; + } + else if (i + 2 >= length) { + byte4 = 64; + } + // Write to the ouput + result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i += 3; + } + return result; + } + ts.convertToBase64 = convertToBase64; })(ts || (ts = {})); var ts; (function (ts) { @@ -5901,7 +5991,7 @@ var ts; /// var ts; (function (ts) { - var nodeConstructors = new Array(229 /* Count */); + var nodeConstructors = new Array(230 /* Count */); /* @internal */ ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -5946,20 +6036,20 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5968,24 +6058,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5996,220 +6086,220 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 141 /* TypeReference */: + case 142 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 147 /* TupleType */: + case 148 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 148 /* UnionType */: + case 149 /* UnionType */: return visitNodes(cbNodes, node.types); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 155 /* PropertyAccessExpression */: + case 156 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 164 /* DeleteExpression */: + case 165 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 165 /* TypeOfExpression */: + case 166 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 166 /* VoidExpression */: + case 167 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 172 /* YieldExpression */: + case 173 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 168 /* PostfixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 173 /* SpreadElementExpression */: + case 174 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 227 /* SourceFile */: + case 228 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 199 /* VariableDeclarationList */: + case 200 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 183 /* IfStatement */: + case 184 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 184 /* DoStatement */: + case 185 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || + visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 187 /* ForInStatement */: + case 188 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 188 /* ForOfStatement */: + case 189 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: return visitNode(cbNode, node.label); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 192 /* WithStatement */: + case 193 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 207 /* CaseBlock */: + case 208 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 220 /* CaseClause */: + case 221 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 221 /* DefaultClause */: + case 222 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 196 /* TryStatement */: + case 197 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 130 /* Decorator */: + case 131 /* Decorator */: return visitNode(cbNode, node.expression); - case 201 /* ClassDeclaration */: - case 174 /* ClassExpression */: + case 202 /* ClassDeclaration */: + case 175 /* 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 202 /* InterfaceDeclaration */: + case 203 /* 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 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 210 /* ImportClause */: + case 211 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 211 /* NamespaceImport */: + case 212 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 212 /* NamedImports */: - case 216 /* NamedExports */: + case 213 /* NamedImports */: + case 217 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 222 /* HeritageClause */: + case 223 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 177 /* HeritageClauseElement */: + case 177 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 219 /* ExternalModuleReference */: + case 220 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 218 /* MissingDeclaration */: + case 219 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); } } @@ -6388,7 +6478,7 @@ var ts; } } function createSourceFile(fileName, languageVersion) { - sourceFile = createNode(227 /* SourceFile */, 0); + sourceFile = createNode(228 /* SourceFile */, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -6730,7 +6820,7 @@ var ts; // ComputedPropertyName[Yield] : // [ AssignmentExpression[In, ?Yield] ] // - var node = createNode(127 /* ComputedPropertyName */); + var node = createNode(128 /* ComputedPropertyName */); parseExpected(18 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -7122,14 +7212,14 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 209 /* ImportDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 215 /* ExportDeclaration */: - case 214 /* ExportAssignment */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 216 /* ExportDeclaration */: + case 215 /* ExportAssignment */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: return true; } return isReusableStatement(node); @@ -7139,13 +7229,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 135 /* Constructor */: - case 140 /* IndexSignature */: - case 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 132 /* PropertyDeclaration */: - case 178 /* SemicolonClassElement */: + case 136 /* Constructor */: + case 141 /* IndexSignature */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 179 /* SemicolonClassElement */: return true; } } @@ -7154,8 +7244,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: return true; } } @@ -7164,49 +7254,49 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 180 /* VariableStatement */: - case 179 /* Block */: - case 183 /* IfStatement */: - case 182 /* ExpressionStatement */: - case 195 /* ThrowStatement */: - case 191 /* ReturnStatement */: - case 193 /* SwitchStatement */: - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 186 /* ForStatement */: - case 185 /* WhileStatement */: - case 192 /* WithStatement */: - case 181 /* EmptyStatement */: - case 196 /* TryStatement */: - case 194 /* LabeledStatement */: - case 184 /* DoStatement */: - case 197 /* DebuggerStatement */: + case 201 /* FunctionDeclaration */: + case 181 /* VariableStatement */: + case 180 /* Block */: + case 184 /* IfStatement */: + case 183 /* ExpressionStatement */: + case 196 /* ThrowStatement */: + case 192 /* ReturnStatement */: + case 194 /* SwitchStatement */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 187 /* ForStatement */: + case 186 /* WhileStatement */: + case 193 /* WithStatement */: + case 182 /* EmptyStatement */: + case 197 /* TryStatement */: + case 195 /* LabeledStatement */: + case 185 /* DoStatement */: + case 198 /* DebuggerStatement */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 226 /* EnumMember */; + return node.kind === 227 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 139 /* ConstructSignature */: - case 133 /* MethodSignature */: - case 140 /* IndexSignature */: - case 131 /* PropertySignature */: - case 138 /* CallSignature */: + case 140 /* ConstructSignature */: + case 134 /* MethodSignature */: + case 141 /* IndexSignature */: + case 132 /* PropertySignature */: + case 139 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 198 /* VariableDeclaration */) { + if (node.kind !== 199 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -7227,7 +7317,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 129 /* Parameter */) { + if (node.kind !== 130 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -7339,7 +7429,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20 /* DotToken */)) { - var node = createNode(126 /* QualifiedName */, entity.pos); + var node = createNode(127 /* QualifiedName */, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -7378,20 +7468,20 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(171 /* TemplateExpression */); + var template = createNode(172 /* TemplateExpression */); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); do { templateSpans.push(parseTemplateSpan()); - } while (templateSpans[templateSpans.length - 1].literal.kind === 12 /* TemplateMiddle */); + } while (ts.lastOrUndefined(templateSpans).literal.kind === 12 /* TemplateMiddle */); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(176 /* TemplateSpan */); + var span = createNode(178 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token === 15 /* CloseBraceToken */) { @@ -7432,7 +7522,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(141 /* TypeReference */); + var node = createNode(142 /* TypeReference */); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24 /* LessThanToken */) { node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); @@ -7440,13 +7530,13 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(144 /* TypeQuery */); + var node = createNode(145 /* TypeQuery */); parseExpected(97 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(128 /* TypeParameter */); + var node = createNode(129 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(79 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -7492,7 +7582,7 @@ var ts; } } function parseParameter() { - var node = createNode(129 /* Parameter */); + var node = createNode(130 /* Parameter */); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); @@ -7589,7 +7679,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 139 /* ConstructSignature */) { + if (kind === 140 /* ConstructSignature */) { parseExpected(88 /* NewKeyword */); } fillSignature(51 /* ColonToken */, false, false, node); @@ -7653,7 +7743,7 @@ var ts; return token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || token === 19 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(140 /* IndexSignature */, fullStart); + var node = createNode(141 /* IndexSignature */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15 /* Parameters */, parseParameter, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); @@ -7666,7 +7756,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(50 /* QuestionToken */); if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { - var method = createNode(133 /* MethodSignature */, fullStart); + var method = createNode(134 /* MethodSignature */, fullStart); method.name = name; method.questionToken = questionToken; // Method signatues don't exist in expression contexts. So they have neither @@ -7676,7 +7766,7 @@ var ts; return finishNode(method); } else { - var property = createNode(131 /* PropertySignature */, fullStart); + var property = createNode(132 /* PropertySignature */, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -7718,7 +7808,7 @@ var ts; switch (token) { case 16 /* OpenParenToken */: case 24 /* LessThanToken */: - return parseSignatureMember(138 /* CallSignature */); + return parseSignatureMember(139 /* CallSignature */); case 18 /* OpenBracketToken */: // Indexer or computed property return isIndexSignature() @@ -7726,7 +7816,7 @@ var ts; : parsePropertyOrMethodSignature(); case 88 /* NewKeyword */: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(139 /* ConstructSignature */); + return parseSignatureMember(140 /* ConstructSignature */); } // fall through. case 8 /* StringLiteral */: @@ -7763,7 +7853,7 @@ var ts; return token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(145 /* TypeLiteral */); + var node = createNode(146 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -7779,12 +7869,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(147 /* TupleType */); + var node = createNode(148 /* TupleType */); node.elementTypes = parseBracketedList(18 /* TupleElementTypes */, parseType, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(149 /* ParenthesizedType */); + var node = createNode(150 /* ParenthesizedType */); parseExpected(16 /* OpenParenToken */); node.type = parseType(); parseExpected(17 /* CloseParenToken */); @@ -7792,7 +7882,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 143 /* ConstructorType */) { + if (kind === 144 /* ConstructorType */) { parseExpected(88 /* NewKeyword */); } fillSignature(32 /* EqualsGreaterThanToken */, false, false, node); @@ -7805,10 +7895,10 @@ var ts; function parseNonArrayType() { switch (token) { case 112 /* AnyKeyword */: - case 121 /* StringKeyword */: - case 119 /* NumberKeyword */: + case 122 /* StringKeyword */: + case 120 /* NumberKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); @@ -7829,10 +7919,10 @@ var ts; function isStartOfType() { switch (token) { case 112 /* AnyKeyword */: - case 121 /* StringKeyword */: - case 119 /* NumberKeyword */: + case 122 /* StringKeyword */: + case 120 /* NumberKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: case 99 /* VoidKeyword */: case 97 /* TypeOfKeyword */: case 14 /* OpenBraceToken */: @@ -7856,7 +7946,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18 /* OpenBracketToken */)) { parseExpected(19 /* CloseBracketToken */); - var node = createNode(146 /* ArrayType */, type.pos); + var node = createNode(147 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -7871,7 +7961,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(148 /* UnionType */, type.pos); + var node = createNode(149 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } @@ -7926,10 +8016,10 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(142 /* FunctionType */); + return parseFunctionOrConstructorType(143 /* FunctionType */); } if (token === 88 /* NewKeyword */) { - return parseFunctionOrConstructorType(143 /* ConstructorType */); + return parseFunctionOrConstructorType(144 /* ConstructorType */); } return parseUnionTypeOrHigher(); } @@ -8131,7 +8221,7 @@ var ts; (isIdentifier() || token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */); } function parseYieldExpression() { - var node = createNode(172 /* YieldExpression */); + var node = createNode(173 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -8151,8 +8241,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(163 /* ArrowFunction */, identifier.pos); - var parameter = createNode(129 /* Parameter */, identifier.pos); + var node = createNode(164 /* ArrowFunction */, identifier.pos); + var parameter = createNode(130 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -8270,7 +8360,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(163 /* ArrowFunction */); + var node = createNode(164 /* ArrowFunction */); // Arrow functions are never generators. // // If we're speculatively parsing a signature for a parenthesized arrow function, then @@ -8331,7 +8421,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(170 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(171 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -8344,7 +8434,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 86 /* InKeyword */ || t === 125 /* OfKeyword */; + return t === 86 /* InKeyword */ || t === 126 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -8410,33 +8500,33 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(169 /* BinaryExpression */, left.pos); + var node = createNode(170 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(167 /* PrefixUnaryExpression */); + var node = createNode(168 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(164 /* DeleteExpression */); + var node = createNode(165 /* DeleteExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(165 /* TypeOfExpression */); + var node = createNode(166 /* TypeOfExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(166 /* VoidExpression */); + var node = createNode(167 /* VoidExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); @@ -8466,7 +8556,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 38 /* PlusPlusToken */ || token === 39 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(168 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(169 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -8570,14 +8660,14 @@ 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(155 /* PropertyAccessExpression */, expression.pos); + var node = createNode(156 /* PropertyAccessExpression */, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(20 /* DotToken */, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } function parseTypeAssertion() { - var node = createNode(160 /* TypeAssertionExpression */); + var node = createNode(161 /* TypeAssertionExpression */); parseExpected(24 /* LessThanToken */); node.type = parseType(); parseExpected(25 /* GreaterThanToken */); @@ -8588,7 +8678,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(20 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(155 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(156 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -8597,7 +8687,7 @@ var ts; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(18 /* OpenBracketToken */)) { - var indexedAccess = createNode(156 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(157 /* 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. @@ -8613,7 +8703,7 @@ var ts; continue; } if (token === 10 /* NoSubstitutionTemplateLiteral */ || token === 11 /* TemplateHead */) { - var tagExpression = createNode(159 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(160 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -8636,7 +8726,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(157 /* CallExpression */, expression.pos); + var callExpr = createNode(158 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -8644,7 +8734,7 @@ var ts; continue; } else if (token === 16 /* OpenParenToken */) { - var callExpr = createNode(157 /* CallExpression */, expression.pos); + var callExpr = createNode(158 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -8746,28 +8836,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(161 /* ParenthesizedExpression */); + var node = createNode(162 /* ParenthesizedExpression */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(173 /* SpreadElementExpression */); + var node = createNode(174 /* SpreadElementExpression */); parseExpected(21 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 /* DotDotDotToken */ ? parseSpreadElement() : - token === 23 /* CommaToken */ ? createNode(175 /* OmittedExpression */) : + token === 23 /* CommaToken */ ? createNode(176 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(153 /* ArrayLiteralExpression */); + var node = createNode(154 /* ArrayLiteralExpression */); parseExpected(18 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 512 /* MultiLine */; @@ -8777,10 +8867,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(116 /* GetKeyword */)) { - return parseAccessorDeclaration(136 /* GetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(137 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(120 /* SetKeyword */)) { - return parseAccessorDeclaration(137 /* SetAccessor */, fullStart, decorators, modifiers); + else if (parseContextualModifier(121 /* SetKeyword */)) { + return parseAccessorDeclaration(138 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -8803,13 +8893,13 @@ var ts; } // Parse to check if it is short-hand property assignment or normal property assignment if ((token === 23 /* CommaToken */ || token === 15 /* CloseBraceToken */) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(225 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(226 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(224 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(225 /* PropertyAssignment */, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51 /* ColonToken */); @@ -8818,7 +8908,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(154 /* ObjectLiteralExpression */); + var node = createNode(155 /* ObjectLiteralExpression */); parseExpected(14 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512 /* MultiLine */; @@ -8836,7 +8926,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(162 /* FunctionExpression */); + var node = createNode(163 /* FunctionExpression */); parseExpected(83 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); @@ -8851,7 +8941,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(158 /* NewExpression */); + var node = createNode(159 /* NewExpression */); parseExpected(88 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -8862,7 +8952,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(179 /* Block */); + var node = createNode(180 /* Block */); if (parseExpected(14 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); parseExpected(15 /* CloseBraceToken */); @@ -8889,12 +8979,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(181 /* EmptyStatement */); + var node = createNode(182 /* EmptyStatement */); parseExpected(22 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(183 /* IfStatement */); + var node = createNode(184 /* IfStatement */); parseExpected(84 /* IfKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -8904,7 +8994,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(184 /* DoStatement */); + var node = createNode(185 /* DoStatement */); parseExpected(75 /* DoKeyword */); node.statement = parseStatement(); parseExpected(100 /* WhileKeyword */); @@ -8919,7 +9009,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(185 /* WhileStatement */); + var node = createNode(186 /* WhileStatement */); parseExpected(100 /* WhileKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -8942,21 +9032,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(86 /* InKeyword */)) { - var forInStatement = createNode(187 /* ForInStatement */, pos); + var forInStatement = createNode(188 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(125 /* OfKeyword */)) { - var forOfStatement = createNode(188 /* ForOfStatement */, pos); + else if (parseOptional(126 /* OfKeyword */)) { + var forOfStatement = createNode(189 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(186 /* ForStatement */, pos); + var forStatement = createNode(187 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(22 /* SemicolonToken */); if (token !== 22 /* SemicolonToken */ && token !== 17 /* CloseParenToken */) { @@ -8964,7 +9054,7 @@ var ts; } parseExpected(22 /* SemicolonToken */); if (token !== 17 /* CloseParenToken */) { - forStatement.iterator = allowInAnd(parseExpression); + forStatement.incrementor = allowInAnd(parseExpression); } parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forStatement; @@ -8974,7 +9064,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); + parseExpected(kind === 191 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -8982,7 +9072,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(191 /* ReturnStatement */); + var node = createNode(192 /* ReturnStatement */); parseExpected(90 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -8991,7 +9081,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(192 /* WithStatement */); + var node = createNode(193 /* WithStatement */); parseExpected(101 /* WithKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -9000,7 +9090,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(220 /* CaseClause */); + var node = createNode(221 /* CaseClause */); parseExpected(67 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(51 /* ColonToken */); @@ -9008,7 +9098,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(221 /* DefaultClause */); + var node = createNode(222 /* DefaultClause */); parseExpected(73 /* DefaultKeyword */); parseExpected(51 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); @@ -9018,12 +9108,12 @@ var ts; return token === 67 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(193 /* SwitchStatement */); + var node = createNode(194 /* SwitchStatement */); parseExpected(92 /* SwitchKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(17 /* CloseParenToken */); - var caseBlock = createNode(207 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(208 /* CaseBlock */, scanner.getStartPos()); parseExpected(14 /* OpenBraceToken */); caseBlock.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); parseExpected(15 /* CloseBraceToken */); @@ -9038,7 +9128,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(195 /* ThrowStatement */); + var node = createNode(196 /* ThrowStatement */); parseExpected(94 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -9046,7 +9136,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(196 /* TryStatement */); + var node = createNode(197 /* TryStatement */); parseExpected(96 /* TryKeyword */); node.tryBlock = parseBlock(false, false); node.catchClause = token === 68 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -9059,7 +9149,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(223 /* CatchClause */); + var result = createNode(224 /* CatchClause */); parseExpected(68 /* CatchKeyword */); if (parseExpected(16 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -9069,7 +9159,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(197 /* DebuggerStatement */); + var node = createNode(198 /* DebuggerStatement */); parseExpected(72 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -9081,13 +9171,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 65 /* Identifier */ && parseOptional(51 /* ColonToken */)) { - var labeledStatement = createNode(194 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(195 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(182 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(183 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -9145,8 +9235,9 @@ var ts; return !isConstEnum; case 103 /* InterfaceKeyword */: case 117 /* ModuleKeyword */: + case 118 /* NamespaceKeyword */: case 77 /* EnumKeyword */: - case 123 /* TypeKeyword */: + case 124 /* TypeKeyword */: // When followed by an identifier, these do not start a statement but might // instead be following declarations if (isDeclarationStart()) { @@ -9196,9 +9287,9 @@ var ts; case 82 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 71 /* ContinueKeyword */: - return parseBreakOrContinueStatement(189 /* ContinueStatement */); + return parseBreakOrContinueStatement(190 /* ContinueStatement */); case 66 /* BreakKeyword */: - return parseBreakOrContinueStatement(190 /* BreakStatement */); + return parseBreakOrContinueStatement(191 /* BreakStatement */); case 90 /* ReturnKeyword */: return parseReturnStatement(); case 101 /* WithKeyword */: @@ -9273,16 +9364,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token === 23 /* CommaToken */) { - return createNode(175 /* OmittedExpression */); + return createNode(176 /* OmittedExpression */); } - var node = createNode(152 /* BindingElement */); + var node = createNode(153 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(152 /* BindingElement */); + var node = createNode(153 /* BindingElement */); // TODO(andersh): Handle computed properties var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -9298,14 +9389,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(150 /* ObjectBindingPattern */); + var node = createNode(151 /* ObjectBindingPattern */); parseExpected(14 /* OpenBraceToken */); node.elements = parseDelimitedList(10 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(15 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(151 /* ArrayBindingPattern */); + var node = createNode(152 /* ArrayBindingPattern */); parseExpected(18 /* OpenBracketToken */); node.elements = parseDelimitedList(11 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(19 /* CloseBracketToken */); @@ -9324,7 +9415,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(198 /* VariableDeclaration */); + var node = createNode(199 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -9333,7 +9424,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(199 /* VariableDeclarationList */); + var node = createNode(200 /* VariableDeclarationList */); switch (token) { case 98 /* VarKeyword */: break; @@ -9356,7 +9447,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 === 125 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token === 126 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -9371,7 +9462,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 17 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(180 /* VariableStatement */, fullStart); + var node = createNode(181 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -9379,7 +9470,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(200 /* FunctionDeclaration */, fullStart); + var node = createNode(201 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(83 /* FunctionKeyword */); @@ -9390,7 +9481,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(135 /* Constructor */, pos); + var node = createNode(136 /* Constructor */, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(114 /* ConstructorKeyword */); @@ -9399,7 +9490,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(134 /* MethodDeclaration */, fullStart); + var method = createNode(135 /* MethodDeclaration */, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -9410,7 +9501,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(132 /* PropertyDeclaration */, fullStart); + var property = createNode(133 /* PropertyDeclaration */, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -9491,7 +9582,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 120 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 121 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -9525,7 +9616,7 @@ var ts; decorators = []; decorators.pos = scanner.getStartPos(); } - var decorator = createNode(130 /* Decorator */, decoratorStart); + var decorator = createNode(131 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -9558,7 +9649,7 @@ var ts; } function parseClassElement() { if (token === 22 /* SemicolonToken */) { - var result = createNode(178 /* SemicolonClassElement */); + var result = createNode(179 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -9596,10 +9687,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart:*/ scanner.getStartPos(), /*decorators:*/ undefined, - /*modifiers:*/ undefined, 174 /* ClassExpression */); + /*modifiers:*/ undefined, 175 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 202 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code @@ -9644,16 +9735,16 @@ var ts; } function parseHeritageClause() { if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) { - var node = createNode(222 /* HeritageClause */); + var node = createNode(223 /* HeritageClause */); node.token = token; nextToken(); - node.types = parseDelimitedList(8 /* HeritageClauseElement */, parseHeritageClauseElement); + node.types = parseDelimitedList(8 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } return undefined; } - function parseHeritageClauseElement() { - var node = createNode(177 /* HeritageClauseElement */); + function parseExpressionWithTypeArguments() { + var node = createNode(177 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 24 /* LessThanToken */) { node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); @@ -9667,7 +9758,7 @@ var ts; return parseList(6 /* ClassMembers */, false, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(202 /* InterfaceDeclaration */, fullStart); + var node = createNode(203 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(103 /* InterfaceKeyword */); @@ -9678,10 +9769,10 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203 /* TypeAliasDeclaration */, fullStart); + var node = createNode(204 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(123 /* TypeKeyword */); + parseExpected(124 /* TypeKeyword */); node.name = parseIdentifier(); parseExpected(53 /* EqualsToken */); node.type = parseType(); @@ -9693,13 +9784,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(226 /* EnumMember */, scanner.getStartPos()); + var node = createNode(227 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(204 /* EnumDeclaration */, fullStart); + var node = createNode(205 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(77 /* EnumKeyword */); @@ -9714,7 +9805,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(206 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(207 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(14 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); parseExpected(15 /* CloseBraceToken */); @@ -9724,19 +9815,19 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { - var node = createNode(205 /* ModuleDeclaration */, fullStart); + function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { + var node = createNode(206 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20 /* DotToken */) - ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1 /* Export */) + ? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 1 /* Export */) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205 /* ModuleDeclaration */, fullStart); + var node = createNode(206 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -9744,13 +9835,20 @@ var ts; return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { - parseExpected(117 /* ModuleKeyword */); - return token === 8 /* StringLiteral */ - ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) - : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); + var flags = modifiers ? modifiers.flags : 0; + if (parseOptional(118 /* NamespaceKeyword */)) { + flags |= 32768 /* Namespace */; + } + else { + parseExpected(117 /* ModuleKeyword */); + if (token === 8 /* StringLiteral */) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + } + return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); } function isExternalModuleReference() { - return token === 118 /* RequireKeyword */ && + return token === 119 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -9759,7 +9857,7 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 /* CommaToken */ || - token === 124 /* FromKeyword */; + token === 125 /* FromKeyword */; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(85 /* ImportKeyword */); @@ -9767,11 +9865,11 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 /* CommaToken */ && token !== 124 /* FromKeyword */) { + if (token !== 23 /* CommaToken */ && token !== 125 /* FromKeyword */) { // ImportEquals declaration of type: // import x = require("mod"); or // import x = M.x; - var importEqualsDeclaration = createNode(208 /* ImportEqualsDeclaration */, fullStart); + var importEqualsDeclaration = createNode(209 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -9782,7 +9880,7 @@ var ts; } } // Import statement - var importDeclaration = createNode(209 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(210 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); // ImportDeclaration: @@ -9792,7 +9890,7 @@ var ts; token === 35 /* AsteriskToken */ || token === 14 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(124 /* FromKeyword */); + parseExpected(125 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -9805,7 +9903,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(210 /* ImportClause */, fullStart); + var importClause = createNode(211 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -9815,7 +9913,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(23 /* CommaToken */)) { - importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(212 /* NamedImports */); + importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(213 /* NamedImports */); } return finishNode(importClause); } @@ -9825,8 +9923,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(219 /* ExternalModuleReference */); - parseExpected(118 /* RequireKeyword */); + var node = createNode(220 /* ExternalModuleReference */); + parseExpected(119 /* RequireKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(17 /* CloseParenToken */); @@ -9847,7 +9945,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(211 /* NamespaceImport */); + var namespaceImport = createNode(212 /* NamespaceImport */); parseExpected(35 /* AsteriskToken */); parseExpected(111 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -9862,14 +9960,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(20 /* ImportOrExportSpecifiers */, kind === 212 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); + node.elements = parseBracketedList(20 /* ImportOrExportSpecifiers */, kind === 213 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(217 /* ExportSpecifier */); + return parseImportOrExportSpecifier(218 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(213 /* ImportSpecifier */); + return parseImportOrExportSpecifier(214 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -9894,23 +9992,23 @@ var ts; else { node.name = identifierName; } - if (kind === 213 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 214 /* 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(215 /* ExportDeclaration */, fullStart); + var node = createNode(216 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35 /* AsteriskToken */)) { - parseExpected(124 /* FromKeyword */); + parseExpected(125 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(216 /* NamedExports */); - if (parseOptional(124 /* FromKeyword */)) { + node.exportClause = parseNamedImportsOrExports(217 /* NamedExports */); + if (parseOptional(125 /* FromKeyword */)) { node.moduleSpecifier = parseModuleSpecifier(); } } @@ -9918,7 +10016,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(214 /* ExportAssignment */, fullStart); + var node = createNode(215 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(53 /* EqualsToken */)) { @@ -9947,13 +10045,14 @@ var ts; case 69 /* ClassKeyword */: case 103 /* InterfaceKeyword */: case 77 /* EnumKeyword */: - case 123 /* TypeKeyword */: + case 124 /* TypeKeyword */: // Not true keywords so ensure an identifier follows return lookAhead(nextTokenIsIdentifierOrKeyword); case 85 /* ImportKeyword */: // Not true keywords so ensure an identifier follows or is string literal or asterisk or open brace return lookAhead(nextTokenCanFollowImportKeyword); case 117 /* ModuleKeyword */: + case 118 /* NamespaceKeyword */: // Not a true keyword so ensure an identifier or string literal follows return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); case 78 /* ExportKeyword */: @@ -10024,11 +10123,12 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 103 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 123 /* TypeKeyword */: + case 124 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 77 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); case 117 /* ModuleKeyword */: + case 118 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); case 85 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); @@ -10036,7 +10136,7 @@ var ts; if (decorators) { // We reached this point because we encountered an AtToken and assumed a declaration would // follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(218 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(219 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -10119,10 +10219,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 /* Export */ - || node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */ - || node.kind === 209 /* ImportDeclaration */ - || node.kind === 214 /* ExportAssignment */ - || node.kind === 215 /* ExportDeclaration */ + || node.kind === 209 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 220 /* ExternalModuleReference */ + || node.kind === 210 /* ImportDeclaration */ + || node.kind === 215 /* ExportAssignment */ + || node.kind === 216 /* ExportDeclaration */ ? node : undefined; }); @@ -10705,7 +10805,6 @@ var ts; var undefinedType = createIntrinsicType(32 /* Undefined */ | 262144 /* ContainsUndefinedOrNull */, "undefined"); var nullType = createIntrinsicType(64 /* Null */ | 262144 /* ContainsUndefinedOrNull */, "null"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -10735,6 +10834,8 @@ var ts; var emitExtends = false; var emitDecorate = false; var emitParam = false; + var resolutionTargets = []; + var resolutionResults = []; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -10900,10 +11001,10 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 227 /* SourceFile */); + return ts.getAncestor(node, 228 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 227 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 228 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -10952,40 +11053,40 @@ var ts; } } switch (location.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931 /* ModuleMember */)) { - if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 217 /* ExportSpecifier */)) { + if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 218 /* ExportSpecifier */)) { break loop; } result = undefined; } - else if (location.kind === 227 /* SourceFile */ || - (location.kind === 205 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931 /* ModuleMember */); + else if (location.kind === 228 /* SourceFile */ || + (location.kind === 206 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { + result = getSymbolOfNode(location).exports["default"]; var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { + if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* 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 // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. - if (location.parent.kind === 201 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + if (location.parent.kind === 202 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { @@ -10995,8 +11096,8 @@ var ts; } } break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 @@ -11016,9 +11117,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (grandparent.kind === 201 /* ClassDeclaration */ || grandparent.kind === 202 /* InterfaceDeclaration */) { + if (grandparent.kind === 202 /* ClassDeclaration */ || grandparent.kind === 203 /* 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); @@ -11026,19 +11127,19 @@ var ts; } } break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 162 /* FunctionExpression */: + case 163 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -11049,14 +11150,14 @@ var ts; break loop; } break; - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: var className = location.name; if (className && name === className.text) { result = location.symbol; break loop; } break; - case 130 /* Decorator */: + case 131 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -11065,7 +11166,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 === 129 /* Parameter */) { + if (location.parent && location.parent.kind === 130 /* Parameter */) { location = location.parent; } // @@ -11121,16 +11222,16 @@ var ts; // for (let x in x) // for (let x of x) // climb up to the variable declaration skipping binding patterns - var variableDeclaration = ts.getAncestor(declaration, 198 /* VariableDeclaration */); + var variableDeclaration = ts.getAncestor(declaration, 199 /* VariableDeclaration */); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 180 /* VariableStatement */ || - variableDeclaration.parent.parent.kind === 186 /* ForStatement */) { + if (variableDeclaration.parent.parent.kind === 181 /* VariableStatement */ || + variableDeclaration.parent.parent.kind === 187 /* ForStatement */) { // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */ || - variableDeclaration.parent.parent.kind === 187 /* ForInStatement */) { + else if (variableDeclaration.parent.parent.kind === 189 /* ForOfStatement */ || + variableDeclaration.parent.parent.kind === 188 /* ForInStatement */) { // ForIn/ForOf case - use site should not be used in expression part var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); @@ -11157,10 +11258,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 208 /* ImportEqualsDeclaration */) { + if (node.kind === 209 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 209 /* ImportDeclaration */) { + while (node && node.kind !== 210 /* ImportDeclaration */) { node = node.parent; } return node; @@ -11170,7 +11271,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 219 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 220 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -11180,7 +11281,7 @@ var ts; if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); if (!exportDefaultSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); + error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } return exportDefaultSymbol; } @@ -11277,17 +11378,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 210 /* ImportClause */: + case 211 /* ImportClause */: return getTargetOfImportClause(node); - case 211 /* NamespaceImport */: + case 212 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 213 /* ImportSpecifier */: + case 214 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 217 /* ExportSpecifier */: + case 218 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } @@ -11332,11 +11433,11 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214 /* ExportAssignment */) { + if (node.kind === 215 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 217 /* ExportSpecifier */) { + else if (node.kind === 218 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -11349,7 +11450,7 @@ var ts; // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 208 /* ImportEqualsDeclaration */); + importDeclaration = ts.getAncestor(entityName, 209 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -11362,13 +11463,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 126 /* QualifiedName */) { + if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 127 /* 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 === 208 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 209 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } @@ -11382,14 +11483,15 @@ var ts; } var symbol; if (name.kind === 65 /* Identifier */) { - symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + var message = meaning === 1536 /* Namespace */ ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; + symbol = resolveName(name, name.text, meaning, message, name); if (!symbol) { return undefined; } } - else if (name.kind === 126 /* QualifiedName */ || name.kind === 155 /* PropertyAccessExpression */) { - var left = name.kind === 126 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 126 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 127 /* QualifiedName */ || name.kind === 156 /* PropertyAccessExpression */) { + var left = name.kind === 127 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 127 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1536 /* Namespace */); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -11446,10 +11548,10 @@ var ts; if (sourceFile.symbol) { return sourceFile.symbol; } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.fileName); + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); return; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); + error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); } // 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. @@ -11462,7 +11564,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { var symbol = resolveExternalModuleSymbol(moduleSymbol); if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error(moduleReferenceExpression, ts.Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; @@ -11549,7 +11651,7 @@ var ts; var members = node.members; for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 135 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 136 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -11619,17 +11721,17 @@ var ts; } } switch (location_1.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location_1)) { break; } - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -11778,8 +11880,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 205 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || - (declaration.kind === 227 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 206 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || + (declaration.kind === 228 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -11815,12 +11917,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 144 /* TypeQuery */) { + if (entityName.parent.kind === 145 /* TypeQuery */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 126 /* QualifiedName */ || entityName.kind === 155 /* PropertyAccessExpression */ || - entityName.parent.kind === 208 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 127 /* QualifiedName */ || entityName.kind === 156 /* PropertyAccessExpression */ || + entityName.parent.kind === 209 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1536 /* Namespace */; @@ -11868,10 +11970,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 149 /* ParenthesizedType */) { + while (node.kind === 150 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 203 /* TypeAliasDeclaration */) { + if (node.kind === 204 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -12075,7 +12177,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 227 /* SourceFile */ || declaration.parent.kind === 206 /* ModuleBlock */; + return declaration.parent.kind === 228 /* SourceFile */ || declaration.parent.kind === 207 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -12154,7 +12256,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0 /* String */, "x")); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 121 /* StringKeyword */); + writeKeyword(writer, 122 /* StringKeyword */); writePunctuation(writer, 19 /* CloseBracketToken */); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); @@ -12168,7 +12270,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1 /* Number */, "x")); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 119 /* NumberKeyword */); + writeKeyword(writer, 120 /* NumberKeyword */); writePunctuation(writer, 19 /* CloseBracketToken */); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); @@ -12314,12 +12416,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 205 /* ModuleDeclaration */) { + if (node.kind === 206 /* ModuleDeclaration */) { if (node.name.kind === 8 /* StringLiteral */) { return node; } } - else if (node.kind === 227 /* SourceFile */) { + else if (node.kind === 228 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -12368,69 +12470,69 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 152 /* BindingElement */: + case 153 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 198 /* VariableDeclaration */: + case 199 /* 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 205 /* ModuleDeclaration */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 200 /* FunctionDeclaration */: - case 204 /* EnumDeclaration */: - case 208 /* ImportEqualsDeclaration */: + case 206 /* ModuleDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 201 /* FunctionDeclaration */: + case 205 /* EnumDeclaration */: + case 209 /* ImportEqualsDeclaration */: var parent_2 = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedNodeFlags(node) & 1 /* Export */) && - !(node.kind !== 208 /* ImportEqualsDeclaration */ && parent_2.kind !== 227 /* SourceFile */ && ts.isInAmbientContext(parent_2))) { + !(node.kind !== 209 /* ImportEqualsDeclaration */ && parent_2.kind !== 228 /* SourceFile */ && ts.isInAmbientContext(parent_2))) { return isGlobalSourceFile(parent_2); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent_2); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so let it fall into next case statement - case 135 /* Constructor */: - case 139 /* ConstructSignature */: - case 138 /* CallSignature */: - case 140 /* IndexSignature */: - case 129 /* Parameter */: - case 206 /* ModuleBlock */: - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 145 /* TypeLiteral */: - case 141 /* TypeReference */: - case 146 /* ArrayType */: - case 147 /* TupleType */: - case 148 /* UnionType */: - case 149 /* ParenthesizedType */: + case 136 /* Constructor */: + case 140 /* ConstructSignature */: + case 139 /* CallSignature */: + case 141 /* IndexSignature */: + case 130 /* Parameter */: + case 207 /* ModuleBlock */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 146 /* TypeLiteral */: + case 142 /* TypeReference */: + case 147 /* ArrayType */: + case 148 /* TupleType */: + case 149 /* UnionType */: + case 150 /* 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 210 /* ImportClause */: - case 211 /* NamespaceImport */: - case 213 /* ImportSpecifier */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: + case 214 /* ImportSpecifier */: return false; // Type parameters are always visible - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: // Source file is always visible - case 227 /* SourceFile */: + case 228 /* SourceFile */: return true; // Export assignements do not create name bindings outside the module - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -12446,10 +12548,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 214 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 215 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 217 /* ExportSpecifier */) { + else if (node.parent.kind === 218 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent); } var result = []; @@ -12474,8 +12576,37 @@ var ts; }); } } + // Push an entry on the type resolution stack. If an entry with the given target is not already on the stack, + // a new entry with that target and an associated result value of true is pushed on the stack, and the value + // true is returned. Otherwise, a circularity has occurred and the result values of the existing entry and + // all entries pushed after it are changed to false, and the value false is returned. The target object provides + // a unique identity for a particular type resolution result: Symbol instances are used to track resolution of + // SymbolLinks.type, SymbolLinks instances are used to track resolution of SymbolLinks.declaredType, and + // Signature instances are used to track resolution of Signature.resolvedReturnType. + function pushTypeResolution(target) { + var i = 0; + var count = resolutionTargets.length; + while (i < count && resolutionTargets[i] !== target) { + i++; + } + if (i < count) { + do { + resolutionResults[i++] = false; + } while (i < count); + return false; + } + resolutionTargets.push(target); + resolutionResults.push(true); + return true; + } + // Pop an entry from the type resolution stack and return its associated result value. The result value will + // be true if no circularities were detected, or false if a circularity was found. + function popTypeResolution() { + resolutionTargets.pop(); + return resolutionResults.pop(); + } function getRootDeclaration(node) { - while (node.kind === 152 /* BindingElement */) { + while (node.kind === 153 /* BindingElement */) { node = node.parent.parent; } return node; @@ -12484,7 +12615,7 @@ var ts; node = getRootDeclaration(node); // Parent chain: // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 198 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; + return node.kind === 199 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -12517,7 +12648,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 150 /* ObjectBindingPattern */) { + if (pattern.kind === 151 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_5 = declaration.propertyName || declaration.name; // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, @@ -12564,10 +12695,10 @@ 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 === 187 /* ForInStatement */) { + if (declaration.parent.parent.kind === 188 /* ForInStatement */) { return anyType; } - if (declaration.parent.parent.kind === 188 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 189 /* 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, @@ -12581,11 +12712,11 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129 /* Parameter */) { + if (declaration.kind === 130 /* 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 === 137 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136 /* GetAccessor */); + if (func.kind === 138 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 137 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -12601,7 +12732,7 @@ var ts; return checkExpressionCached(declaration.initializer); } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 225 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 226 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // No type specified and nothing can be inferred @@ -12636,7 +12767,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 175 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 176 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -12659,7 +12790,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) { - return pattern.kind === 150 /* ObjectBindingPattern */ + return pattern.kind === 151 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -12681,7 +12812,7 @@ 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. - return declaration.kind !== 224 /* PropertyAssignment */ ? getWidenedType(type) : type; + return declaration.kind !== 225 /* PropertyAssignment */ ? getWidenedType(type) : type; } // If no type was specified and nothing could be inferred, and if the declaration specifies a binding pattern, use // the type implied by the binding pattern @@ -12693,7 +12824,7 @@ var ts; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 129 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 130 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -12708,28 +12839,33 @@ var ts; } // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 223 /* CatchClause */) { + if (declaration.parent.kind === 224 /* CatchClause */) { return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 214 /* ExportAssignment */) { + if (declaration.kind === 215 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } // Handle variable, parameter or property - links.type = resolvingType; + if (!pushTypeResolution(symbol)) { + return unknownType; + } var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + if (!popTypeResolution()) { + if (symbol.valueDeclaration.type) { + // Variable has type annotation that circularly references the variable itself + type = unknownType; + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + } + else { + // Variable has initializer that circularly references the variable itself + type = anyType; + if (compilerOptions.noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + } } + links.type = type; } return links.type; } @@ -12738,7 +12874,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 136 /* GetAccessor */) { + if (accessor.kind === 137 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -12750,15 +12886,12 @@ var ts; } function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - function checkAndStoreTypeOfAccessors(symbol, links) { - links = links || getSymbolLinks(symbol); if (!links.type) { - links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 137 /* SetAccessor */); + if (!pushTypeResolution(symbol)) { + return unknownType; + } + var getter = ts.getDeclarationOfKind(symbol, 137 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 138 /* SetAccessor */); var type; // First try to see if the user specified a return type on the get-accessor. var getterReturnType = getAnnotatedAccessorType(getter); @@ -12784,17 +12917,16 @@ var ts; } } } - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); - error(getter, 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)); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 137 /* 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)); + } } + links.type = type; } + return links.type; } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); @@ -12861,7 +12993,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 203 /* InterfaceDeclaration */ || node.kind === 202 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -12895,10 +13027,10 @@ var ts; } function resolveBaseTypesOfClass(type) { type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(type.symbol, 201 /* ClassDeclaration */); + var declaration = ts.getDeclarationOfKind(type.symbol, 202 /* ClassDeclaration */); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + var baseType = getTypeFromTypeNode(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024 /* Class */) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -12918,10 +13050,10 @@ var ts; type.baseTypes = []; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 202 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 203 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; - var baseType = getTypeFromHeritageClauseElement(node); + var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -12939,10 +13071,11 @@ var ts; } } } - function getDeclaredTypeOfClass(symbol) { + function getDeclaredTypeOfClassOrInterface(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024 /* Class */, symbol); + var kind = symbol.flags & 32 /* Class */ ? 1024 /* Class */ : 2048 /* Interface */; + var type = links.declaredType = createObjectType(kind, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { type.flags |= 4096 /* Reference */; @@ -12952,49 +13085,24 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return links.declaredType; - } - function getDeclaredTypeOfInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } return links.declaredType; } function getDeclaredTypeOfTypeAlias(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); - var type = getTypeFromTypeNode(declaration.type); - if (links.declaredType === resolvingType) { - links.declaredType = type; + // Note that we use the links object as the target here because the symbol object is used as the unique + // identity for resolution of the 'type' property in SymbolLinks. + if (!pushTypeResolution(links)) { + return unknownType; } - } - else if (links.declaredType === resolvingType) { - links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 204 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (!popTypeResolution()) { + type = unknownType; + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + links.declaredType = type; } return links.declaredType; } @@ -13012,7 +13120,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).constraint) { + if (!ts.getDeclarationOfKind(symbol, 129 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -13028,11 +13136,8 @@ var ts; } function getDeclaredTypeOfSymbol(symbol) { ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); - if (symbol.flags & 32 /* Class */) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & 64 /* Interface */) { - return getDeclaredTypeOfInterface(symbol); + if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { + return getDeclaredTypeOfClassOrInterface(symbol); } if (symbol.flags & 524288 /* TypeAlias */) { return getDeclaredTypeOfTypeAlias(symbol); @@ -13080,15 +13185,27 @@ var ts; } } } + function resolveDeclaredMembers(type) { + if (!type.declaredProperties) { + var symbol = type.symbol; + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + return type; + } function resolveClassOrInterfaceMembers(type) { - var members = type.symbol.members; - var callSignatures = type.declaredCallSignatures; - var constructSignatures = type.declaredConstructSignatures; - var stringIndexType = type.declaredStringIndexType; - var numberIndexType = type.declaredNumberIndexType; - var baseTypes = getBaseTypes(type); + var target = resolveDeclaredMembers(type); + var members = target.symbol.members; + var callSignatures = target.declaredCallSignatures; + var constructSignatures = target.declaredConstructSignatures; + var stringIndexType = target.declaredStringIndexType; + var numberIndexType = target.declaredNumberIndexType; + var baseTypes = getBaseTypes(target); if (baseTypes.length) { - members = createSymbolTable(type.declaredProperties); + members = createSymbolTable(target.declaredProperties); for (var _i = 0; _i < baseTypes.length; _i++) { var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); @@ -13101,7 +13218,7 @@ var ts; setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveTypeReferenceMembers(type) { - var target = type.target; + var target = resolveDeclaredMembers(type.target); var mapper = createTypeMapper(target.typeParameters, type.typeArguments); var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); @@ -13246,7 +13363,7 @@ var ts; callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { - var classType = getDeclaredTypeOfClass(symbol); + var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); @@ -13353,7 +13470,7 @@ var ts; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (!prop) { + if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 /* Private */ | 64 /* Protected */)) { return undefined; } if (!props) { @@ -13472,7 +13589,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 136 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -13503,8 +13620,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 === 136 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 137 /* SetAccessor */); + if (declaration.kind === 137 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 138 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -13522,19 +13639,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 164 /* 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). @@ -13551,7 +13668,9 @@ var ts; } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; + if (!pushTypeResolution(signature)) { + return unknownType; + } var type; if (signature.target) { type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); @@ -13562,27 +13681,25 @@ var ts; else { type = getReturnTypeFromBody(signature.declaration); } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, 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, ts.declarationNameToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_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); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, 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, ts.declarationNameToString(declaration.name)); + } + else { + error(declaration, ts.Diagnostics.Function_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); + } } } + signature.resolvedReturnType = type; } return signature.resolvedReturnType; } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { - var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { return type.typeArguments[0]; } @@ -13611,7 +13728,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 === 135 /* Constructor */ || signature.declaration.kind === 139 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 136 /* Constructor */ || signature.declaration.kind === 140 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -13625,7 +13742,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 119 /* NumberKeyword */ : 121 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 120 /* NumberKeyword */ : 122 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -13655,7 +13772,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 129 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -13711,13 +13828,13 @@ var ts; currentNode = currentNode.parent; } // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 129 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 141 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { + if (n.kind === 142 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, undefined, undefined); @@ -13743,20 +13860,14 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReference(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromHeritageClauseElement(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromTypeReferenceOrHeritageClauseElement(node) { + function getTypeFromTypeReferenceOrExpressionWithTypeArguments(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var type; // We don't currently support heritage clauses with complex expressions in them. // For these cases, we just set the type to be the unknownType. - if (node.kind !== 177 /* HeritageClauseElement */ || ts.isSupportedHeritageClauseElement(node)) { - var typeNameOrExpression = node.kind === 141 /* TypeReference */ + if (node.kind !== 177 /* ExpressionWithTypeArguments */ || ts.isSupportedExpressionWithTypeArguments(node)) { + var typeNameOrExpression = node.kind === 142 /* TypeReference */ ? node.typeName : node.expression; var symbol = resolveEntityName(typeNameOrExpression, 793056 /* Type */); @@ -13810,9 +13921,9 @@ var ts; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: return declaration; } } @@ -14010,40 +14121,40 @@ var ts; switch (node.kind) { case 112 /* AnyKeyword */: return anyType; - case 121 /* StringKeyword */: + case 122 /* StringKeyword */: return stringType; - case 119 /* NumberKeyword */: + case 120 /* NumberKeyword */: return numberType; case 113 /* BooleanKeyword */: return booleanType; - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: return esSymbolType; case 99 /* VoidKeyword */: return voidType; case 8 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 141 /* TypeReference */: - return getTypeFromTypeReference(node); - case 177 /* HeritageClauseElement */: - return getTypeFromHeritageClauseElement(node); - case 144 /* TypeQuery */: + case 142 /* TypeReference */: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case 177 /* ExpressionWithTypeArguments */: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case 145 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 147 /* TupleType */: + case 148 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 148 /* UnionType */: + case 149 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return getTypeFromTypeNode(node.type); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 145 /* TypeLiteral */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 146 /* 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 65 /* Identifier */: - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -14201,27 +14312,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 !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return node.operatorToken.kind === 49 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 224 /* PropertyAssignment */: + case 225 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -15057,22 +15168,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 129 /* Parameter */: + case 130 /* 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 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -15341,10 +15452,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 144 /* TypeQuery */: + case 145 /* TypeQuery */: return true; case 65 /* Identifier */: - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: node = node.parent; continue; default: @@ -15392,7 +15503,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 53 /* FirstAssignment */ && node.operatorToken.kind <= 64 /* LastAssignment */) { var n = node.left; - while (n.kind === 161 /* ParenthesizedExpression */) { + while (n.kind === 162 /* ParenthesizedExpression */) { n = n.expression; } if (n.kind === 65 /* Identifier */ && getResolvedSymbol(n) === symbol) { @@ -15409,46 +15520,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: - case 153 /* ArrayLiteralExpression */: - case 154 /* ObjectLiteralExpression */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 160 /* TypeAssertionExpression */: - case 161 /* ParenthesizedExpression */: - case 167 /* PrefixUnaryExpression */: - case 164 /* DeleteExpression */: - case 165 /* TypeOfExpression */: - case 166 /* VoidExpression */: - case 168 /* PostfixUnaryExpression */: - case 170 /* ConditionalExpression */: - case 173 /* SpreadElementExpression */: - case 179 /* Block */: - case 180 /* VariableStatement */: - case 182 /* ExpressionStatement */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 191 /* ReturnStatement */: - case 192 /* WithStatement */: - case 193 /* SwitchStatement */: - case 220 /* CaseClause */: - case 221 /* DefaultClause */: - case 194 /* LabeledStatement */: - case 195 /* ThrowStatement */: - case 196 /* TryStatement */: - case 223 /* CatchClause */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: + case 154 /* ArrayLiteralExpression */: + case 155 /* ObjectLiteralExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 161 /* TypeAssertionExpression */: + case 162 /* ParenthesizedExpression */: + case 168 /* PrefixUnaryExpression */: + case 165 /* DeleteExpression */: + case 166 /* TypeOfExpression */: + case 167 /* VoidExpression */: + case 169 /* PostfixUnaryExpression */: + case 171 /* ConditionalExpression */: + case 174 /* SpreadElementExpression */: + case 180 /* Block */: + case 181 /* VariableStatement */: + case 183 /* ExpressionStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 192 /* ReturnStatement */: + case 193 /* WithStatement */: + case 194 /* SwitchStatement */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: + case 195 /* LabeledStatement */: + case 196 /* ThrowStatement */: + case 197 /* TryStatement */: + case 224 /* CatchClause */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -15500,19 +15611,19 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 183 /* IfStatement */: + case 184 /* IfStatement */: // In a branch of an if statement, narrow based on controlling expression if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: // In a branch of a conditional expression, narrow based on controlling condition if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: // In the right operand of an && or ||, narrow based on left operand if (child === node.right) { if (node.operatorToken.kind === 48 /* AmpersandAmpersandToken */) { @@ -15523,14 +15634,14 @@ var ts; } } break; - case 227 /* SourceFile */: - case 205 /* ModuleDeclaration */: - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: + case 228 /* SourceFile */: + case 206 /* ModuleDeclaration */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: // Stop at the first containing function or module declaration break loop; } @@ -15546,7 +15657,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 !== 165 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { + if (expr.left.kind !== 166 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { return type; } var left = expr.left; @@ -15621,17 +15732,34 @@ var ts; } // Target type is type of prototype property var prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (!prototypeProperty) { - return type; + if (prototypeProperty) { + var targetType = getTypeOfSymbol(prototypeProperty); + if (targetType !== anyType) { + // Narrow to the target type if it's a subtype of the current type + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + // If the current type is a union type, remove all constituents that aren't subtypes of the target. + if (type.flags & 16384 /* Union */) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + } + } } - var targetType = getTypeOfSymbol(prototypeProperty); - // Narrow to target type if it is a subtype of current type - if (isTypeSubtypeOf(targetType, type)) { - return targetType; + // Target type is type of construct signature + var constructSignatures; + if (rightType.flags & 2048 /* Interface */) { + constructSignatures = resolveDeclaredMembers(rightType).declaredConstructSignatures; } - // If current type is a union type, remove all constituents that aren't subtypes of target type - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + else if (rightType.flags & 32768 /* Anonymous */) { + constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); + } + if (constructSignatures && constructSignatures.length !== 0) { + var instanceType = getUnionType(ts.map(constructSignatures, function (signature) { return getReturnTypeOfSignature(getErasedSignature(signature)); })); + // Pickup type from union types + if (type.flags & 16384 /* Union */) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, instanceType); })); + } + return instanceType; } return type; } @@ -15639,9 +15767,9 @@ var ts; // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: var operator = expr.operatorToken.kind; if (operator === 30 /* EqualsEqualsEqualsToken */ || operator === 31 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -15656,7 +15784,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: if (expr.operator === 46 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -15673,7 +15801,7 @@ var ts; // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. // To avoid that we will give an error to users if they use arguments objects in arrow function so that they // can explicitly bound arguments objects - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163 /* ArrowFunction */ && languageVersion < 2 /* ES6 */) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 164 /* ArrowFunction */ && 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); } if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -15697,7 +15825,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 /* ES6 */ || (symbol.flags & 2 /* BlockScopedVariable */) === 0 || - symbol.valueDeclaration.parent.kind === 223 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 224 /* CatchClause */) { return; } // - check if binding is used in some function @@ -15706,12 +15834,12 @@ var ts; // nesting structure: // (variable declaration or binding element) -> variable declaration list -> container var container = symbol.valueDeclaration; - while (container.kind !== 199 /* VariableDeclarationList */) { + while (container.kind !== 200 /* VariableDeclarationList */) { container = container.parent; } // get the parent of variable declaration list container = container.parent; - if (container.kind === 180 /* VariableStatement */) { + if (container.kind === 181 /* VariableStatement */) { // if parent is variable statement - get its parent container = container.parent; } @@ -15730,9 +15858,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 132 /* PropertyDeclaration */ || container.kind === 135 /* Constructor */) { + if (container.kind === 133 /* PropertyDeclaration */ || container.kind === 136 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -15745,39 +15873,39 @@ var ts; var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 163 /* ArrowFunction */) { + if (container.kind === 164 /* ArrowFunction */) { container = ts.getThisContainer(container, 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 205 /* ModuleDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + case 206 /* 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 204 /* EnumDeclaration */: + case 205 /* 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 135 /* Constructor */: + case 136 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -15786,15 +15914,15 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 129 /* Parameter */) { + if (n.kind === 130 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 158 /* CallExpression */ && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 202 /* ClassDeclaration */); var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -15812,7 +15940,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - canUseSuperExpression = container.kind === 135 /* Constructor */; + canUseSuperExpression = container.kind === 136 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -15821,28 +15949,28 @@ var ts; // - In a static member function or static member accessor // super property access might appear in arrow functions with arbitrary deep nesting needToCaptureLexicalThis = false; - while (container && container.kind === 163 /* ArrowFunction */) { + while (container && container.kind === 164 /* ArrowFunction */) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } // topmost container must be something that is directly nested in the class declaration - if (container && container.parent && container.parent.kind === 201 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 202 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { canUseSuperExpression = - container.kind === 134 /* MethodDeclaration */ || - container.kind === 133 /* MethodSignature */ || - container.kind === 136 /* GetAccessor */ || - container.kind === 137 /* SetAccessor */; + container.kind === 135 /* MethodDeclaration */ || + container.kind === 134 /* MethodSignature */ || + container.kind === 137 /* GetAccessor */ || + container.kind === 138 /* SetAccessor */; } else { canUseSuperExpression = - container.kind === 134 /* MethodDeclaration */ || - container.kind === 133 /* MethodSignature */ || - container.kind === 136 /* GetAccessor */ || - container.kind === 137 /* SetAccessor */ || - container.kind === 132 /* PropertyDeclaration */ || - container.kind === 131 /* PropertySignature */ || - container.kind === 135 /* Constructor */; + container.kind === 135 /* MethodDeclaration */ || + container.kind === 134 /* MethodSignature */ || + container.kind === 137 /* GetAccessor */ || + container.kind === 138 /* SetAccessor */ || + container.kind === 133 /* PropertyDeclaration */ || + container.kind === 132 /* PropertySignature */ || + container.kind === 136 /* Constructor */; } } } @@ -15856,7 +15984,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 135 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 136 /* 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); returnType = unknownType; @@ -15870,7 +15998,7 @@ var ts; return returnType; } } - if (container && container.kind === 127 /* ComputedPropertyName */) { + if (container && container.kind === 128 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -15897,7 +16025,7 @@ var ts; // If last parameter is contextually rest parameter get its type if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters)); } } } @@ -15915,7 +16043,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129 /* Parameter */) { + if (declaration.kind === 130 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -15932,7 +16060,7 @@ var ts; if (func) { // 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 (func.type || func.kind === 135 /* Constructor */ || func.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137 /* SetAccessor */))) { + if (func.type || func.kind === 136 /* Constructor */ || func.kind === 137 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 138 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -15955,7 +16083,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 159 /* TaggedTemplateExpression */) { + if (template.parent.kind === 160 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -16086,32 +16214,32 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 198 /* VariableDeclaration */: - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 153 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 163 /* ArrowFunction */: - case 191 /* ReturnStatement */: + case 164 /* ArrowFunction */: + case 192 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return getTypeFromTypeNode(parent.type); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 224 /* PropertyAssignment */: + case 225 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 176 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 171 /* TemplateExpression */); + case 178 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 172 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return getContextualType(parent); } return undefined; @@ -16128,7 +16256,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 162 /* FunctionExpression */ || node.kind === 163 /* ArrowFunction */; + return node.kind === 163 /* FunctionExpression */ || node.kind === 164 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions and arrow functions are contextually typed. @@ -16140,7 +16268,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 !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -16196,13 +16324,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 === 169 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { + if (parent.kind === 170 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 224 /* PropertyAssignment */) { + if (parent.kind === 225 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 153 /* ArrayLiteralExpression */) { + if (parent.kind === 154 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; @@ -16227,7 +16355,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0; _i < elements.length; _i++) { var e = elements[_i]; - if (inDestructuringPattern && e.kind === 173 /* SpreadElementExpression */) { + if (inDestructuringPattern && e.kind === 174 /* SpreadElementExpression */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -16251,7 +16379,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 173 /* SpreadElementExpression */; + hasSpreadElement = hasSpreadElement || e.kind === 174 /* SpreadElementExpression */; } if (!hasSpreadElement) { var contextualType = getContextualType(node); @@ -16262,7 +16390,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 127 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 128 /* 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, @@ -16318,18 +16446,18 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 224 /* PropertyAssignment */ || - memberDecl.kind === 225 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 225 /* PropertyAssignment */ || + memberDecl.kind === 226 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 224 /* PropertyAssignment */) { + if (memberDecl.kind === 225 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 134 /* MethodDeclaration */) { + else if (memberDecl.kind === 135 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 225 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 226 /* ShorthandPropertyAssignment */); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -16349,7 +16477,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 === 136 /* GetAccessor */ || memberDecl.kind === 137 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 137 /* GetAccessor */ || memberDecl.kind === 138 /* SetAccessor */); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -16388,7 +16516,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 : 132 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 133 /* PropertyDeclaration */; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; @@ -16401,7 +16529,7 @@ var ts; } // Property is known to be private or protected at this point // Get the declaring and enclosing class instance types - var enclosingClassDeclaration = ts.getAncestor(node, 201 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 202 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); // Private property is accessible if declaring and enclosing class are the same @@ -16462,7 +16590,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 (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 135 /* MethodDeclaration */) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -16474,14 +16602,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 155 /* PropertyAccessExpression */ + var left = node.kind === 156 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 135 /* MethodDeclaration */) { return false; } else { @@ -16497,7 +16625,7 @@ var ts; // Grammar checking if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 159 /* 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); @@ -16626,7 +16754,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* TaggedTemplateExpression */) { checkExpression(node.template); } else { @@ -16694,7 +16822,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 173 /* SpreadElementExpression */) { + if (args[i].kind === 174 /* SpreadElementExpression */) { return i; } } @@ -16704,13 +16832,13 @@ var ts; var adjustedArgCount; // Apparent number of arguments we will have in this call var typeArguments; // Type arguments (undefined if none) var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* 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 === 171 /* TemplateExpression */) { + if (tagExpression.template.kind === 172 /* 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; @@ -16731,7 +16859,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 === 158 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 159 /* NewExpression */); return signature.minArgumentCount === 0; } // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. @@ -16808,10 +16936,10 @@ var ts; // wildcards for all context sensitive function expressions. for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175 /* OmittedExpression */) { + if (arg.kind !== 176 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 159 /* TaggedTemplateExpression */) { + if (i === 0 && args[i].parent.kind === 160 /* TaggedTemplateExpression */) { argType = globalTemplateStringsArrayType; } else { @@ -16858,12 +16986,12 @@ var ts; function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175 /* OmittedExpression */) { + if (arg.kind !== 176 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // A tagged template expression provides a special first argument, and string literals get string literal types // unless we're reporting errors - var argType = i === 0 && node.kind === 159 /* TaggedTemplateExpression */ + var argType = i === 0 && node.kind === 160 /* TaggedTemplateExpression */ ? globalTemplateStringsArrayType : arg.kind === 8 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) @@ -16885,10 +17013,10 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* TaggedTemplateExpression */) { var template = node.template; args = [template]; - if (template.kind === 171 /* TemplateExpression */) { + if (template.kind === 172 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -16911,7 +17039,7 @@ var ts; */ function getEffectiveTypeArguments(callExpression) { if (callExpression.expression.kind === 91 /* SuperKeyword */) { - var containingClass = ts.getAncestor(callExpression, 201 /* ClassDeclaration */); + var containingClass = ts.getAncestor(callExpression, 202 /* ClassDeclaration */); var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } @@ -16921,7 +17049,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 159 /* TaggedTemplateExpression */; + var isTaggedTemplate = node.kind === 160 /* TaggedTemplateExpression */; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); @@ -17234,13 +17362,13 @@ var ts; // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 157 /* CallExpression */) { + if (node.kind === 158 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 158 /* NewExpression */) { + else if (node.kind === 159 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 159 /* TaggedTemplateExpression */) { + else if (node.kind === 160 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -17256,12 +17384,12 @@ var ts; if (node.expression.kind === 91 /* SuperKeyword */) { return voidType; } - if (node.kind === 158 /* NewExpression */) { + if (node.kind === 159 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 135 /* Constructor */ && - declaration.kind !== 139 /* ConstructSignature */ && - declaration.kind !== 143 /* ConstructorType */) { + declaration.kind !== 136 /* Constructor */ && + declaration.kind !== 140 /* ConstructSignature */ && + declaration.kind !== 144 /* ConstructorType */) { // When resolved signature is a call signature (and not a construct signature) the result type is any if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); @@ -17298,9 +17426,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; + var parameter = ts.lastOrUndefined(signature.parameters); var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + links.type = instantiateType(getTypeOfSymbol(ts.lastOrUndefined(context.parameters)), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -17309,7 +17437,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 179 /* Block */) { + if (func.body.kind !== 180 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -17351,7 +17479,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 195 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 196 /* ThrowStatement */); } // TypeScript Specification 1.0 (6.3) - July 2014 // An explicitly typed function whose return type isn't the Void or the Any type @@ -17366,7 +17494,7 @@ var ts; return; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - if (ts.nodeIsMissing(func.body) || func.body.kind !== 179 /* Block */) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 180 /* Block */) { return; } var bodyBlock = func.body; @@ -17384,10 +17512,10 @@ var ts; error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 162 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 163 /* FunctionExpression */) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards @@ -17409,10 +17537,9 @@ var ts; if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } - if (!node.type) { - signature.resolvedReturnType = resolvingType; + if (!node.type && !signature.resolvedReturnType) { var returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { + if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } } @@ -17420,19 +17547,19 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { + if (produceDiagnostics && node.kind !== 135 /* MethodDeclaration */ && node.kind !== 134 /* MethodSignature */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); if (node.type && !node.asteriskToken) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { - if (node.body.kind === 179 /* Block */) { + if (node.body.kind === 180 /* Block */) { checkSourceElement(node.body); } else { @@ -17474,17 +17601,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 155 /* PropertyAccessExpression */: { + case 156 /* 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 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: // old compiler doesn't check indexed assess return true; - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -17493,11 +17620,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 65 /* Identifier */: - case 155 /* PropertyAccessExpression */: { + case 156 /* PropertyAccessExpression */: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192 /* Const */) !== 0; } - case 156 /* ElementAccessExpression */: { + case 157 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 8 /* StringLiteral */) { @@ -17507,7 +17634,7 @@ var ts; } return false; } - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -17658,7 +17785,7 @@ var ts; var properties = node.properties; for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + if (p.kind === 225 /* PropertyAssignment */ || p.kind === 226 /* ShorthandPropertyAssignment */) { // TODO(andersh): Computed property support var name_8 = p.name; var type = sourceType.flags & 1 /* Any */ ? sourceType : @@ -17686,8 +17813,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175 /* OmittedExpression */) { - if (e.kind !== 173 /* SpreadElementExpression */) { + if (e.kind !== 176 /* OmittedExpression */) { + if (e.kind !== 174 /* SpreadElementExpression */) { var propName = "" + i; var type = sourceType.flags & 1 /* Any */ ? sourceType : isTupleLikeType(sourceType) @@ -17711,7 +17838,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 169 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { + if (restExpression.kind === 170 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -17724,14 +17851,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { + if (target.kind === 170 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 154 /* ObjectLiteralExpression */) { + if (target.kind === 155 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 153 /* ArrayLiteralExpression */) { + if (target.kind === 154 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -17751,7 +17878,7 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 53 /* EqualsToken */ && (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { + if (operator === 53 /* EqualsToken */ && (node.left.kind === 155 /* ObjectLiteralExpression */ || node.left.kind === 154 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); @@ -17963,7 +18090,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); @@ -17974,7 +18101,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -18008,7 +18135,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 126 /* QualifiedName */) { + if (node.kind == 127 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -18020,9 +18147,9 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 156 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 157 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 65 /* Identifier */ || node.kind === 127 /* 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); } @@ -18049,54 +18176,54 @@ var ts; return booleanType; case 7 /* NumericLiteral */: return checkNumericLiteral(node); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: return checkTemplateExpression(node); case 8 /* StringLiteral */: case 10 /* NoSubstitutionTemplateLiteral */: return stringType; case 9 /* RegularExpressionLiteral */: return globalRegExpType; - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 155 /* PropertyAccessExpression */: + case 156 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return checkCallExpression(node); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return checkTypeAssertion(node); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: return checkClassExpression(node); - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 165 /* TypeOfExpression */: + case 166 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 164 /* DeleteExpression */: + case 165 /* DeleteExpression */: return checkDeleteExpression(node); - case 166 /* VoidExpression */: + case 167 /* VoidExpression */: return checkVoidExpression(node); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 168 /* PostfixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 173 /* SpreadElementExpression */: + case 174 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 175 /* OmittedExpression */: + case 176 /* OmittedExpression */: return undefinedType; - case 172 /* YieldExpression */: + case 173 /* YieldExpression */: checkYieldExpression(node); return unknownType; } @@ -18129,7 +18256,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 112 /* AccessibilityModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 135 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 136 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -18144,12 +18271,12 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 140 /* IndexSignature */) { + if (node.kind === 141 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 142 /* FunctionType */ || node.kind === 200 /* FunctionDeclaration */ || node.kind === 143 /* ConstructorType */ || - node.kind === 138 /* CallSignature */ || node.kind === 135 /* Constructor */ || - node.kind === 139 /* ConstructSignature */) { + else if (node.kind === 143 /* FunctionType */ || node.kind === 201 /* FunctionDeclaration */ || node.kind === 144 /* ConstructorType */ || + node.kind === 139 /* CallSignature */ || node.kind === 136 /* Constructor */ || + node.kind === 140 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -18161,10 +18288,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 138 /* CallSignature */: + case 139 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -18173,7 +18300,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 202 /* InterfaceDeclaration */) { + if (node.kind === 203 /* 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 @@ -18193,7 +18320,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 121 /* StringKeyword */: + case 122 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -18201,7 +18328,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 119 /* NumberKeyword */: + case 120 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -18245,17 +18372,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 157 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; + return n.kind === 158 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 154 /* ObjectLiteralExpression */: return false; + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 155 /* ObjectLiteralExpression */: return false; default: return ts.forEachChild(n, containsSuperCall); } } @@ -18263,12 +18390,12 @@ var ts; if (n.kind === 93 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 162 /* FunctionExpression */ && n.kind !== 200 /* FunctionDeclaration */) { + else if (n.kind !== 163 /* FunctionExpression */ && n.kind !== 201 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 132 /* PropertyDeclaration */ && + return n.kind === 133 /* PropertyDeclaration */ && !(n.flags & 128 /* Static */) && !!n.initializer; } @@ -18285,7 +18412,7 @@ var ts; ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 182 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 183 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -18303,7 +18430,7 @@ var ts; if (produceDiagnostics) { // Grammar checking accessors checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 136 /* GetAccessor */) { + if (node.kind === 137 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } @@ -18311,7 +18438,7 @@ var ts; 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 === 136 /* GetAccessor */ ? 137 /* SetAccessor */ : 136 /* GetAccessor */; + var otherKind = node.kind === 137 /* GetAccessor */ ? 138 /* SetAccessor */ : 137 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { @@ -18328,7 +18455,7 @@ var ts; } } } - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); + getTypeOfAccessors(getSymbolOfNode(node)); } checkFunctionLikeDeclaration(node); } @@ -18337,16 +18464,16 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeReferenceInStrictMode(node.typeName); - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkHeritageClauseElement(node) { - checkGrammarHeritageClauseElementInStrictMode(node.expression); - return checkTypeReferenceOrHeritageClauseElement(node); + function checkExpressionWithTypeArguments(node) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(node.expression); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkTypeReferenceOrHeritageClauseElement(node) { + function checkTypeReferenceOrExpressionWithTypeArguments(node) { // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); + var type = getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved var len = node.typeArguments.length; @@ -18408,9 +18535,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 === 202 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 138 /* CallSignature */ || signatureDeclarationNode.kind === 139 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 138 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 203 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 139 /* CallSignature */ || signatureDeclarationNode.kind === 140 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 139 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -18428,7 +18555,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 202 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 203 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported flags |= 1 /* Export */; @@ -18511,7 +18638,7 @@ var ts; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members - ts.Debug.assert(node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */); + ts.Debug.assert(node.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); @@ -18540,7 +18667,7 @@ var ts; var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 202 /* InterfaceDeclaration */ || node.parent.kind === 145 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 203 /* InterfaceDeclaration */ || node.parent.kind === 146 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -18551,7 +18678,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 === 200 /* FunctionDeclaration */ || node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */ || node.kind === 135 /* Constructor */) { + if (node.kind === 201 /* FunctionDeclaration */ || node.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */ || node.kind === 136 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -18674,16 +18801,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return d.name.kind === 8 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -18698,23 +18825,23 @@ var ts; var expression = node.expression; var exprType = checkExpression(expression); switch (node.parent.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]); checkTypeAssignableTo(exprType, classDecoratorType, node); break; - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node); break; - case 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]); checkTypeAssignableTo(exprType, methodDecoratorType, node); break; - case 129 /* Parameter */: + case 130 /* Parameter */: checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node); break; } @@ -18724,7 +18851,7 @@ 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 === 141 /* TypeReference */) { + if (node && node.kind === 142 /* TypeReference */) { var type = getTypeFromTypeNode(node); var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* StringLike */))) { @@ -18741,19 +18868,19 @@ var ts; */ function checkTypeAnnotationAsExpression(node) { switch (node.kind) { - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: checkTypeNodeAsExpression(node.type); break; - case 129 /* Parameter */: + case 130 /* Parameter */: checkTypeNodeAsExpression(node.type); break; - case 134 /* MethodDeclaration */: + case 135 /* MethodDeclaration */: checkTypeNodeAsExpression(node.type); break; - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: checkTypeNodeAsExpression(node.type); break; - case 137 /* SetAccessor */: + case 138 /* SetAccessor */: checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); break; } @@ -18779,25 +18906,25 @@ 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 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 134 /* MethodDeclaration */: + case 135 /* MethodDeclaration */: checkParameterTypeAnnotationsAsExpressions(node); // fall-through - case 137 /* SetAccessor */: - case 136 /* GetAccessor */: - case 132 /* PropertyDeclaration */: - case 129 /* Parameter */: + case 138 /* SetAccessor */: + case 137 /* GetAccessor */: + case 133 /* PropertyDeclaration */: + case 130 /* Parameter */: checkTypeAnnotationAsExpression(node); break; } } emitDecorate = true; - if (node.kind === 129 /* Parameter */) { + if (node.kind === 130 /* Parameter */) { emitParam = true; } ts.forEach(node.decorators, checkDecorator); @@ -18820,7 +18947,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 127 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 128 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -18856,11 +18983,11 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 179 /* Block */) { + if (node.kind === 180 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 206 /* ModuleBlock */) { + if (ts.isFunctionBlock(node) || node.kind === 207 /* ModuleBlock */) { checkFunctionExpressionBodies(node); } } @@ -18879,12 +19006,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 132 /* PropertyDeclaration */ || - node.kind === 131 /* PropertySignature */ || - node.kind === 134 /* MethodDeclaration */ || - node.kind === 133 /* MethodSignature */ || - node.kind === 136 /* GetAccessor */ || - node.kind === 137 /* SetAccessor */) { + if (node.kind === 133 /* PropertyDeclaration */ || + node.kind === 132 /* PropertySignature */ || + node.kind === 135 /* MethodDeclaration */ || + node.kind === 134 /* MethodSignature */ || + node.kind === 137 /* GetAccessor */ || + node.kind === 138 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -18893,7 +19020,7 @@ var ts; return false; } var root = getRootDeclaration(node); - if (root.kind === 129 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 130 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -18926,7 +19053,7 @@ var ts; return; } // bubble up and find containing type - var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 202 /* ClassDeclaration */); // if containing type was not found or it is ambient - exit (no codegen) if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; @@ -18946,14 +19073,14 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 206 /* 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 === 227 /* SourceFile */ && ts.isExternalModule(parent)) { + if (parent.kind === 228 /* SourceFile */ && ts.isExternalModule(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_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); + error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkVarDeclaredNamesNotShadowed(node) { @@ -18986,7 +19113,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 === 198 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 199 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -18996,17 +19123,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 199 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 180 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 200 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 181 /* 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 === 179 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 206 /* ModuleBlock */ || - container.kind === 205 /* ModuleDeclaration */ || - container.kind === 227 /* SourceFile */); + (container.kind === 180 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 207 /* ModuleBlock */ || + container.kind === 206 /* ModuleDeclaration */ || + container.kind === 228 /* 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 @@ -19020,14 +19147,14 @@ var ts; } } function isParameterDeclaration(node) { - while (node.kind === 152 /* BindingElement */) { + while (node.kind === 153 /* BindingElement */) { node = node.parent.parent; } - return node.kind === 129 /* Parameter */; + return node.kind === 130 /* Parameter */; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 129 /* Parameter */) { + if (getRootDeclaration(node).kind !== 130 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -19038,7 +19165,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 === 129 /* Parameter */) { + if (referencedSymbol.valueDeclaration.kind === 130 /* Parameter */) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -19065,7 +19192,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -19076,7 +19203,7 @@ 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 && getRootDeclaration(node).kind === 129 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 130 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -19108,10 +19235,10 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 132 /* PropertyDeclaration */ && node.kind !== 131 /* PropertySignature */) { + if (node.kind !== 133 /* PropertyDeclaration */ && node.kind !== 132 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 198 /* VariableDeclaration */ || node.kind === 152 /* BindingElement */) { + if (node.kind === 199 /* VariableDeclaration */ || node.kind === 153 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -19141,7 +19268,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 179 /* Block */ || node.kind === 154 /* ObjectLiteralExpression */) { + if (node.kind === 180 /* Block */ || node.kind === 155 /* ObjectLiteralExpression */) { return true; } node = node.parent; @@ -19174,12 +19301,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 199 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind == 200 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -19188,8 +19315,8 @@ var ts; } if (node.condition) checkExpression(node.condition); - if (node.iterator) - checkExpression(node.iterator); + if (node.incrementor) + checkExpression(node.incrementor); checkSourceElement(node.statement); } function checkForOfStatement(node) { @@ -19199,14 +19326,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 === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* 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 === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { + if (varExpr.kind === 154 /* ArrayLiteralExpression */ || varExpr.kind === 155 /* 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. @@ -19235,7 +19362,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 === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* 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); @@ -19249,7 +19376,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 === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { + if (varExpr.kind === 154 /* ArrayLiteralExpression */ || varExpr.kind === 155 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 /* Any */ | 258 /* StringLike */)) { @@ -19449,7 +19576,7 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137 /* SetAccessor */))); + return !!(node.kind === 137 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 138 /* SetAccessor */))); } function checkReturnStatement(node) { // Grammar checking @@ -19464,11 +19591,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 137 /* SetAccessor */) { + if (func.kind === 138 /* SetAccessor */) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 135 /* Constructor */) { + if (func.kind === 136 /* Constructor */) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -19498,7 +19625,7 @@ var ts; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 221 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 222 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -19510,7 +19637,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 220 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 221 /* 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. @@ -19531,7 +19658,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 194 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 195 /* 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; @@ -19601,7 +19728,7 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); }); - if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 201 /* ClassDeclaration */) { + if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 202 /* ClassDeclaration */) { var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; @@ -19639,7 +19766,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 === 127 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 128 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -19697,7 +19824,7 @@ var ts; function checkClassDeclaration(node) { checkGrammarDeclarationNameInStrictMode(node); // Grammar checking - if (node.parent.kind !== 206 /* ModuleBlock */ && node.parent.kind !== 227 /* SourceFile */) { + if (node.parent.kind !== 207 /* ModuleBlock */ && node.parent.kind !== 228 /* SourceFile */) { grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); } if (!node.name && !(node.flags & 256 /* Default */)) { @@ -19717,11 +19844,11 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - if (!ts.isSupportedHeritageClauseElement(baseTypeNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(baseTypeNode)) { error(baseTypeNode.expression, ts.Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); } emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkHeritageClauseElement(baseTypeNode); + checkExpressionWithTypeArguments(baseTypeNode); } var baseTypes = getBaseTypes(type); if (baseTypes.length) { @@ -19743,12 +19870,12 @@ var ts; var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(typeRefNode)) { error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(typeRefNode); + checkExpressionWithTypeArguments(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromHeritageClauseElement(typeRefNode); + var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { @@ -19834,7 +19961,7 @@ var ts; } } function isAccessor(kind) { - return kind === 136 /* GetAccessor */ || kind === 137 /* SetAccessor */; + return kind === 137 /* GetAccessor */ || kind === 138 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -19870,7 +19997,7 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; for (var _i = 0; _i < baseTypes.length; _i++) { var base = baseTypes[_i]; @@ -19904,7 +20031,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 203 /* 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); @@ -19923,10 +20050,10 @@ var ts; } } ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { - if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) { error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(heritageElement); + checkExpressionWithTypeArguments(heritageElement); }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { @@ -19948,7 +20075,7 @@ var ts; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 127 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 128 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; @@ -19988,7 +20115,7 @@ var ts; return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -19999,7 +20126,7 @@ var ts; case 47 /* TildeToken */: return ~value; } return undefined; - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -20024,11 +20151,11 @@ var ts; return undefined; case 7 /* NumericLiteral */: return +e.text; - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return evalConstant(e.expression); case 65 /* Identifier */: - case 156 /* ElementAccessExpression */: - case 155 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 156 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType; @@ -20041,7 +20168,7 @@ var ts; } else { var expression; - if (e.kind === 156 /* ElementAccessExpression */) { + if (e.kind === 157 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8 /* StringLiteral */) { return undefined; @@ -20059,7 +20186,7 @@ var ts; if (current.kind === 65 /* Identifier */) { break; } - else if (current.kind === 155 /* PropertyAccessExpression */) { + else if (current.kind === 156 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -20128,7 +20255,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 !== 204 /* EnumDeclaration */) { + if (declaration.kind !== 205 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -20151,8 +20278,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 /* ClassDeclaration */ || - (declaration.kind === 200 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 202 /* ClassDeclaration */ || + (declaration.kind === 201 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -20192,15 +20319,15 @@ var ts; var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } // 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, 201 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 202 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; @@ -20209,10 +20336,10 @@ var ts; // Checks for ambient external modules. if (node.name.kind === 8 /* StringLiteral */) { if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); } if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); } } } @@ -20220,10 +20347,10 @@ var ts; } function getFirstIdentifier(node) { while (true) { - if (node.kind === 126 /* QualifiedName */) { + if (node.kind === 127 /* QualifiedName */) { node = node.left; } - else if (node.kind === 155 /* PropertyAccessExpression */) { + else if (node.kind === 156 /* PropertyAccessExpression */) { node = node.expression; } else { @@ -20239,11 +20366,11 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; - if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 215 /* ExportDeclaration */ ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + var inAmbientExternalModule = node.parent.kind === 207 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 228 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 216 /* 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 && isExternalModuleNameRelative(moduleName.text)) { @@ -20251,7 +20378,7 @@ var ts; // 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_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); return false; } return true; @@ -20264,7 +20391,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 === 217 /* ExportSpecifier */ ? + var message = node.kind === 218 /* 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)); @@ -20287,7 +20414,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 212 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -20336,16 +20463,16 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; - if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { - error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); + var inAmbientExternalModule = node.parent.kind === 207 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 228 /* SourceFile */ && !inAmbientExternalModule) { + error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { // export * from "foo" var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { - error(node.moduleSpecifier, ts.Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); + error(node.moduleSpecifier, ts.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); } } } @@ -20357,9 +20484,9 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 227 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 205 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + var container = node.parent.kind === 228 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 206 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } // Grammar checking @@ -20373,16 +20500,22 @@ var ts; checkExpressionCached(node.expression); } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= 2 /* ES6 */) { - // export assignment is deprecated in es6 or above - grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + if (node.isExportEquals && !ts.isInAmbientContext(node)) { + if (languageVersion >= 2 /* ES6 */) { + // export assignment is deprecated in es6 or above + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + } + else if (compilerOptions.module === 4 /* System */) { + // system modules does not support export assignment + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } } } function getModuleStatements(node) { - if (node.kind === 227 /* SourceFile */) { + if (node.kind === 228 /* SourceFile */) { return node.statements; } - if (node.kind === 205 /* ModuleDeclaration */ && node.body.kind === 206 /* ModuleBlock */) { + if (node.kind === 206 /* ModuleDeclaration */ && node.body.kind === 207 /* ModuleBlock */) { return node.body.statements; } return emptyArray; @@ -20411,107 +20544,107 @@ var ts; if (!node) return; switch (node.kind) { - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: return checkTypeParameter(node); - case 129 /* Parameter */: + case 130 /* Parameter */: return checkParameter(node); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return checkPropertyDeclaration(node); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: return checkSignatureDeclaration(node); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return checkMethodDeclaration(node); - case 135 /* Constructor */: + case 136 /* Constructor */: return checkConstructorDeclaration(node); - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return checkAccessorDeclaration(node); - case 141 /* TypeReference */: + case 142 /* TypeReference */: return checkTypeReferenceNode(node); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return checkTypeQuery(node); - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: return checkTypeLiteral(node); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return checkArrayType(node); - case 147 /* TupleType */: + case 148 /* TupleType */: return checkTupleType(node); - case 148 /* UnionType */: + case 149 /* UnionType */: return checkUnionType(node); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return checkSourceElement(node.type); - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return checkBlock(node); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return checkVariableStatement(node); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return checkExpressionStatement(node); - case 183 /* IfStatement */: + case 184 /* IfStatement */: return checkIfStatement(node); - case 184 /* DoStatement */: + case 185 /* DoStatement */: return checkDoStatement(node); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: return checkWhileStatement(node); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return checkForStatement(node); - case 187 /* ForInStatement */: + case 188 /* ForInStatement */: return checkForInStatement(node); - case 188 /* ForOfStatement */: + case 189 /* ForOfStatement */: return checkForOfStatement(node); - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return checkReturnStatement(node); - case 192 /* WithStatement */: + case 193 /* WithStatement */: return checkWithStatement(node); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return checkSwitchStatement(node); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return checkLabeledStatement(node); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: return checkThrowStatement(node); - case 196 /* TryStatement */: + case 197 /* TryStatement */: return checkTryStatement(node); - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 152 /* BindingElement */: + case 153 /* BindingElement */: return checkBindingElement(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return checkClassDeclaration(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return checkImportDeclaration(node); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return checkExportDeclaration(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return checkExportAssignment(node); - case 181 /* EmptyStatement */: + case 182 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 197 /* DebuggerStatement */: + case 198 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 218 /* MissingDeclaration */: + case 219 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -20526,81 +20659,81 @@ var ts; // Delaying the type check of the body ensures foo has been assigned a type. function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 192 /* WithStatement */: + case 193 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: - case 152 /* BindingElement */: - case 153 /* ArrayLiteralExpression */: - case 154 /* ObjectLiteralExpression */: - case 224 /* PropertyAssignment */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 159 /* TaggedTemplateExpression */: - case 171 /* TemplateExpression */: - case 176 /* TemplateSpan */: - case 160 /* TypeAssertionExpression */: - case 161 /* ParenthesizedExpression */: - case 165 /* TypeOfExpression */: - case 166 /* VoidExpression */: - case 164 /* DeleteExpression */: - case 167 /* PrefixUnaryExpression */: - case 168 /* PostfixUnaryExpression */: - case 169 /* BinaryExpression */: - case 170 /* ConditionalExpression */: - case 173 /* SpreadElementExpression */: - case 179 /* Block */: - case 206 /* ModuleBlock */: - case 180 /* VariableStatement */: - case 182 /* ExpressionStatement */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: - case 191 /* ReturnStatement */: - case 193 /* SwitchStatement */: - case 207 /* CaseBlock */: - case 220 /* CaseClause */: - case 221 /* DefaultClause */: - case 194 /* LabeledStatement */: - case 195 /* ThrowStatement */: - case 196 /* TryStatement */: - case 223 /* CatchClause */: - case 198 /* VariableDeclaration */: - case 199 /* VariableDeclarationList */: - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 214 /* ExportAssignment */: - case 227 /* SourceFile */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: + case 153 /* BindingElement */: + case 154 /* ArrayLiteralExpression */: + case 155 /* ObjectLiteralExpression */: + case 225 /* PropertyAssignment */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 160 /* TaggedTemplateExpression */: + case 172 /* TemplateExpression */: + case 178 /* TemplateSpan */: + case 161 /* TypeAssertionExpression */: + case 162 /* ParenthesizedExpression */: + case 166 /* TypeOfExpression */: + case 167 /* VoidExpression */: + case 165 /* DeleteExpression */: + case 168 /* PrefixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: + case 170 /* BinaryExpression */: + case 171 /* ConditionalExpression */: + case 174 /* SpreadElementExpression */: + case 180 /* Block */: + case 207 /* ModuleBlock */: + case 181 /* VariableStatement */: + case 183 /* ExpressionStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: + case 192 /* ReturnStatement */: + case 194 /* SwitchStatement */: + case 208 /* CaseBlock */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: + case 195 /* LabeledStatement */: + case 196 /* ThrowStatement */: + case 197 /* TryStatement */: + case 224 /* CatchClause */: + case 199 /* VariableDeclaration */: + case 200 /* VariableDeclarationList */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 215 /* ExportAssignment */: + case 228 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -20663,7 +20796,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 192 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 193 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -20686,23 +20819,23 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162 /* FunctionExpression */: + case 163 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -20740,22 +20873,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162 /* FunctionExpression */: + case 163 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -20774,64 +20907,64 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 128 /* TypeParameter */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: + case 129 /* TypeParameter */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* 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 === 126 /* QualifiedName */) { + while (node.parent && node.parent.kind === 127 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 141 /* TypeReference */; + return node.parent && node.parent.kind === 142 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 155 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 156 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 177 /* HeritageClauseElement */; + return node.parent && node.parent.kind === 177 /* ExpressionWithTypeArguments */; } function isTypeNode(node) { - if (141 /* FirstTypeNode */ <= node.kind && node.kind <= 149 /* LastTypeNode */) { + if (142 /* FirstTypeNode */ <= node.kind && node.kind <= 150 /* LastTypeNode */) { return true; } switch (node.kind) { case 112 /* AnyKeyword */: - case 119 /* NumberKeyword */: - case 121 /* StringKeyword */: + case 120 /* NumberKeyword */: + case 122 /* StringKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: return true; case 99 /* VoidKeyword */: - return node.parent.kind !== 166 /* VoidExpression */; + return node.parent.kind !== 167 /* VoidExpression */; case 8 /* StringLiteral */: // Specialized signatures can have string literals as their parameters' type names - return node.parent.kind === 129 /* Parameter */; - case 177 /* HeritageClauseElement */: + return node.parent.kind === 130 /* Parameter */; + case 177 /* ExpressionWithTypeArguments */: return true; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 65 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // fall through - case 126 /* QualifiedName */: - case 155 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 127 /* QualifiedName */ || node.kind === 156 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); var parent_5 = node.parent; - if (parent_5.kind === 144 /* TypeQuery */) { + if (parent_5.kind === 145 /* TypeQuery */) { return false; } // Do not recursively call isTypeNode on the parent. In the example: @@ -20840,38 +20973,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 (141 /* FirstTypeNode */ <= parent_5.kind && parent_5.kind <= 149 /* LastTypeNode */) { + if (142 /* FirstTypeNode */ <= parent_5.kind && parent_5.kind <= 150 /* LastTypeNode */) { return true; } switch (parent_5.kind) { - case 177 /* HeritageClauseElement */: + case 177 /* ExpressionWithTypeArguments */: return true; - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: return node === parent_5.constraint; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: return node === parent_5.type; - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 135 /* Constructor */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 136 /* Constructor */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return node === parent_5.type; - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: return node === parent_5.type; - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return node === parent_5.type; - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -20879,13 +21012,13 @@ var ts; return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 126 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 127 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 209 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 214 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 215 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -20897,11 +21030,11 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 214 /* ExportAssignment */) { + if (entityName.parent.kind === 215 /* ExportAssignment */) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 155 /* PropertyAccessExpression */) { + if (entityName.kind !== 156 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); @@ -20911,7 +21044,7 @@ var ts; entityName = entityName.parent; } if (isHeritageClauseElementIdentifier(entityName)) { - var meaning = entityName.parent.kind === 177 /* HeritageClauseElement */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = entityName.parent.kind === 177 /* ExpressionWithTypeArguments */ ? 793056 /* Type */ : 1536 /* Namespace */; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } @@ -20926,14 +21059,14 @@ var ts; var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 155 /* PropertyAccessExpression */) { + else if (entityName.kind === 156 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 126 /* QualifiedName */) { + else if (entityName.kind === 127 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -20942,7 +21075,7 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 141 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = entityName.parent.kind === 142 /* 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 */; @@ -20961,14 +21094,14 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 65 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 214 /* ExportAssignment */ + return node.parent.kind === 215 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 65 /* Identifier */: - case 155 /* PropertyAccessExpression */: - case 126 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 93 /* ThisKeyword */: case 91 /* SuperKeyword */: @@ -20977,7 +21110,7 @@ var ts; case 114 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 135 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 136 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -20986,14 +21119,14 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 209 /* ImportDeclaration */ || node.parent.kind === 215 /* ExportDeclaration */) && + ((node.parent.kind === 210 /* ImportDeclaration */ || node.parent.kind === 216 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } // Intentional fall-through case 7 /* NumericLiteral */: // index access - if (node.parent.kind == 156 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind == 157 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -21010,7 +21143,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 225 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 226 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */); } return undefined; @@ -21090,7 +21223,7 @@ var ts; } // Emitter support function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 228 /* SourceFile */; } function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { // If this is es6 or higher, just use the name of the export @@ -21100,7 +21233,7 @@ var ts; } var node = getDeclarationOfAliasSymbol(symbol); if (node) { - if (node.kind === 210 /* ImportClause */) { + if (node.kind === 211 /* ImportClause */) { var defaultKeyword; if (languageVersion === 0 /* ES3 */) { defaultKeyword = "[\"default\"]"; @@ -21110,7 +21243,7 @@ var ts; } return getGeneratedNameForNode(node.parent) + defaultKeyword; } - if (node.kind === 213 /* ImportSpecifier */) { + if (node.kind === 214 /* ImportSpecifier */) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); var propertyName = node.propertyName || node.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -21119,9 +21252,11 @@ var ts; } function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { - // If this is es6 or higher, just use the name of the export + // 1. If this is es6 or higher, just use the name of the export // no need to qualify it. - if (languageVersion >= 2 /* ES6 */) { + // 2. export mechanism for System modules is different from CJS\AMD + // and it does not need qualifications for exports + if (languageVersion >= 2 /* ES6 */ || compilerOptions.module === 4 /* System */) { return undefined; } return "exports." + ts.unescapeIdentifier(symbol.name); @@ -21129,7 +21264,7 @@ var ts; var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 205 /* ModuleDeclaration */ || node.kind === 204 /* EnumDeclaration */) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 206 /* ModuleDeclaration */ || node.kind === 205 /* EnumDeclaration */) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; @@ -21158,22 +21293,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return node.expression && node.expression.kind === 65 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 227 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 228 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -21231,7 +21366,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 226 /* EnumMember */) { + if (node.kind === 227 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -21276,7 +21411,7 @@ var ts; // * The serialized type of a TypeReference with a value declaration is its entity name. // * The serialized type of a TypeReference with a call or construct signature is "Function". // * The serialized type of any other type is "Object". - var type = getTypeFromTypeReference(node); + var type = getTypeFromTypeNode(node); if (type.flags & 16 /* Void */) { return "void 0"; } @@ -21324,26 +21459,26 @@ var ts; switch (node.kind) { case 99 /* VoidKeyword */: return "void 0"; - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: return "Function"; - case 146 /* ArrayType */: - case 147 /* TupleType */: + case 147 /* ArrayType */: + case 148 /* TupleType */: return "Array"; case 113 /* BooleanKeyword */: return "Boolean"; - case 121 /* StringKeyword */: + case 122 /* StringKeyword */: case 8 /* StringLiteral */: return "String"; - case 119 /* NumberKeyword */: + case 120 /* NumberKeyword */: return "Number"; - case 141 /* TypeReference */: + case 142 /* TypeReference */: return serializeTypeReferenceNode(node, getGeneratedNameForNode); - case 144 /* TypeQuery */: - case 145 /* TypeLiteral */: - case 148 /* UnionType */: + case 145 /* TypeQuery */: + case 146 /* TypeLiteral */: + case 149 /* UnionType */: case 112 /* AnyKeyword */: break; default: @@ -21366,11 +21501,11 @@ var ts; // // For rules on serializing type annotations, see `serializeTypeNode`. switch (node.kind) { - case 201 /* ClassDeclaration */: return "Function"; - case 132 /* PropertyDeclaration */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 129 /* Parameter */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 136 /* GetAccessor */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 137 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + case 202 /* ClassDeclaration */: return "Function"; + case 133 /* PropertyDeclaration */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 130 /* Parameter */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137 /* GetAccessor */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 138 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); } if (ts.isFunctionLike(node)) { return "Function"; @@ -21387,7 +21522,7 @@ var ts; // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. if (node) { var valueDeclaration; - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* ClassDeclaration */) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -21402,10 +21537,10 @@ var ts; for (var i = 0; i < parameterCount; i++) { if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 146 /* ArrayType */) { + if (parameterType.kind === 147 /* ArrayType */) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 141 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 142 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -21453,15 +21588,21 @@ var ts; ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); return !!resolveName(location, name, 107455 /* Value */, undefined, undefined); } + function getReferencedValueDeclaration(reference) { + ts.Debug.assert(!ts.nodeIsSynthesized(reference)); + var symbol = getNodeLinks(reference).resolvedSymbol || + resolveName(reference, reference.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); + return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 152 /* BindingElement */ || (n.parent.kind === 198 /* VariableDeclaration */ && n.parent.name === n); + var isVariableDeclarationOrBindingElement = n.parent.kind === 153 /* BindingElement */ || (n.parent.kind === 199 /* VariableDeclaration */ && n.parent.name === n); var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); var isLetOrConst = symbol && (symbol.flags & 2 /* BlockScopedVariable */) && - symbol.valueDeclaration.parent.kind !== 223 /* CatchClause */; + symbol.valueDeclaration.parent.kind !== 224 /* CatchClause */; if (isLetOrConst) { // side-effect of calling this method: // assign id to symbol if it was not yet set @@ -21500,6 +21641,7 @@ var ts; resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId, + getReferencedValueDeclaration: getReferencedValueDeclaration, serializeTypeOfNode: serializeTypeOfNode, serializeParameterTypesOfNode: serializeParameterTypesOfNode, serializeReturnTypeOfNode: serializeReturnTypeOfNode @@ -21561,7 +21703,7 @@ var ts; function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) // if so, we would like to give more explicit invalid usage error. - if (ts.getAncestor(identifier, 201 /* ClassDeclaration */) || ts.getAncestor(identifier, 174 /* ClassExpression */)) { + if (ts.getAncestor(identifier, 202 /* ClassDeclaration */) || ts.getAncestor(identifier, 175 /* ClassExpression */)) { return grammarErrorOnNode(identifier, message, arg0); } return false; @@ -21572,14 +21714,14 @@ var ts; var impotClause = node.importClause; if (impotClause.namedBindings) { var nameBindings = impotClause.namedBindings; - if (nameBindings.kind === 211 /* NamespaceImport */) { + if (nameBindings.kind === 212 /* NamespaceImport */) { var name_11 = nameBindings.name; if (isReservedWordInStrictMode(name_11)) { var nameText = ts.declarationNameToString(name_11); return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } } - else if (nameBindings.kind === 212 /* NamedImports */) { + else if (nameBindings.kind === 213 /* NamedImports */) { var reportError = false; for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -21600,23 +21742,23 @@ var ts; if (name && name.kind === 65 /* Identifier */ && isReservedWordInStrictMode(name)) { var nameText = ts.declarationNameToString(name); switch (node.kind) { - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: - case 200 /* FunctionDeclaration */: - case 128 /* TypeParameter */: - case 152 /* BindingElement */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: + case 201 /* FunctionDeclaration */: + case 129 /* TypeParameter */: + case 153 /* BindingElement */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* EnumDeclaration */: return checkGrammarIdentifierInStrictMode(name); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: // Report an error if the class declaration uses strict-mode reserved word. return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: // Report an error if the module declaration uses strict-mode reserved word. // TODO(yuisu): fix this when having external module in strict mode return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: // TODO(yuisu): fix this when having external module in strict mode return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } @@ -21632,7 +21774,7 @@ var ts; if (typeName.kind === 65 /* Identifier */) { checkGrammarTypeNameInStrictMode(typeName); } - else if (typeName.kind === 126 /* QualifiedName */) { + else if (typeName.kind === 127 /* QualifiedName */) { // Walk from right to left and report a possible error at each Identifier in QualifiedName // Example: // x1: public.private.package // error at public and private @@ -21646,18 +21788,18 @@ var ts; // public // error at public // public.private.package // error at public // B.private.B // no error - function checkGrammarHeritageClauseElementInStrictMode(expression) { + function checkGrammarExpressionWithTypeArgumentsInStrictMode(expression) { // Example: // class C extends public // error at public if (expression && expression.kind === 65 /* Identifier */) { return checkGrammarIdentifierInStrictMode(expression); } - else if (expression && expression.kind === 155 /* PropertyAccessExpression */) { + else if (expression && expression.kind === 156 /* PropertyAccessExpression */) { // Walk from left to right in PropertyAccessExpression until we are at the left most expression // in PropertyAccessExpression. According to grammar production of MemberExpression, // the left component expression is a PrimaryExpression (i.e. Identifier) while the other // component after dots can be IdentifierName. - checkGrammarHeritageClauseElementInStrictMode(expression.expression); + checkGrammarExpressionWithTypeArgumentsInStrictMode(expression.expression); } } // The function takes an identifier itself or an expression which has SyntaxKind.Identifier. @@ -21694,7 +21836,7 @@ var ts; else if (languageVersion < 1 /* ES5 */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } - else if (node.kind === 136 /* GetAccessor */ || node.kind === 137 /* SetAccessor */) { + else if (node.kind === 137 /* GetAccessor */ || node.kind === 138 /* 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); @@ -21704,26 +21846,26 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 140 /* IndexSignature */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: - case 180 /* VariableStatement */: - case 200 /* FunctionDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 209 /* ImportDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 215 /* ExportDeclaration */: - case 214 /* ExportAssignment */: - case 129 /* Parameter */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 141 /* IndexSignature */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: + case 181 /* VariableStatement */: + case 201 /* FunctionDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 216 /* ExportDeclaration */: + case 215 /* ExportAssignment */: + case 130 /* Parameter */: break; default: return false; @@ -21757,7 +21899,7 @@ var ts; else if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { + else if (node.parent.kind === 207 /* ModuleBlock */ || node.parent.kind === 228 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -21766,10 +21908,10 @@ var ts; if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { + else if (node.parent.kind === 207 /* ModuleBlock */ || node.parent.kind === 228 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 129 /* Parameter */) { + else if (node.kind === 130 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128 /* Static */; @@ -21782,10 +21924,10 @@ var ts; else if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 129 /* Parameter */) { + else if (node.kind === 130 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; @@ -21794,13 +21936,13 @@ var ts; if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 129 /* Parameter */) { + else if (node.kind === 130 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 207 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -21808,7 +21950,7 @@ var ts; break; } } - if (node.kind === 135 /* Constructor */) { + if (node.kind === 136 /* Constructor */) { if (flags & 128 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -21819,13 +21961,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 210 /* ImportDeclaration */ || node.kind === 209 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 202 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { + else if (node.kind === 203 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 129 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 130 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -21889,7 +22031,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 163 /* ArrowFunction */) { + if (node.kind === 164 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -21924,7 +22066,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 121 /* StringKeyword */ && parameter.type.kind !== 119 /* NumberKeyword */) { + if (parameter.type.kind !== 122 /* StringKeyword */ && parameter.type.kind !== 120 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -21957,7 +22099,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 175 /* OmittedExpression */) { + if (arg.kind === 176 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -22031,11 +22173,11 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 127 /* ComputedPropertyName */) { + if (node.kind !== 128 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 169 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { + if (computedPropertyName.expression.kind === 170 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -22063,8 +22205,8 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; var name_13 = prop.name; - if (prop.kind === 175 /* OmittedExpression */ || - name_13.kind === 127 /* ComputedPropertyName */) { + if (prop.kind === 176 /* OmittedExpression */ || + name_13.kind === 128 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name_13); continue; @@ -22078,7 +22220,7 @@ 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 === 224 /* PropertyAssignment */ || prop.kind === 225 /* ShorthandPropertyAssignment */) { + if (prop.kind === 225 /* PropertyAssignment */ || prop.kind === 226 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_13.kind === 7 /* NumericLiteral */) { @@ -22086,13 +22228,13 @@ var ts; } currentKind = Property; } - else if (prop.kind === 134 /* MethodDeclaration */) { + else if (prop.kind === 135 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 136 /* GetAccessor */) { + else if (prop.kind === 137 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 137 /* SetAccessor */) { + else if (prop.kind === 138 /* SetAccessor */) { currentKind = SetAccesor; } else { @@ -22126,24 +22268,24 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 199 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 200 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 188 /* 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 188 /* 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 === 187 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 188 /* 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); @@ -22166,10 +22308,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 136 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 137 /* GetAccessor */ && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 137 /* SetAccessor */) { + else if (kind === 138 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -22194,7 +22336,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 127 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 128 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -22204,7 +22346,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 154 /* ObjectLiteralExpression */) { + if (node.parent.kind === 155 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -22212,7 +22354,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.kind === 202 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -22228,22 +22370,22 @@ 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 === 202 /* InterfaceDeclaration */) { + else if (node.parent.kind === 203 /* 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 === 145 /* TypeLiteral */) { + else if (node.parent.kind === 146 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: return true; - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -22255,11 +22397,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 194 /* LabeledStatement */: + case 195 /* 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 === 189 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 190 /* ContinueStatement */ && !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); @@ -22267,8 +22409,8 @@ var ts; return false; } break; - case 193 /* SwitchStatement */: - if (node.kind === 190 /* BreakStatement */ && !node.label) { + case 194 /* SwitchStatement */: + if (node.kind === 191 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -22283,13 +22425,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 190 /* BreakStatement */ + var message = node.kind === 191 /* 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 === 190 /* BreakStatement */ + var message = node.kind === 191 /* 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); @@ -22298,10 +22440,10 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== elements[elements.length - 1]) { + 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 === 151 /* ArrayBindingPattern */ || node.name.kind === 150 /* ObjectBindingPattern */) { + if (node.name.kind === 152 /* ArrayBindingPattern */ || node.name.kind === 151 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -22314,7 +22456,7 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 187 /* ForInStatement */ && node.parent.parent.kind !== 188 /* ForOfStatement */) { + if (node.parent.parent.kind !== 188 /* ForInStatement */ && node.parent.parent.kind !== 189 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { // Error on equals token which immediate precedes the initializer @@ -22351,7 +22493,7 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - if (element.kind !== 175 /* OmittedExpression */) { + if (element.kind !== 176 /* OmittedExpression */) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -22368,15 +22510,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 192 /* WithStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 193 /* WithStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: return false; - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -22392,7 +22534,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 167 /* PrefixUnaryExpression */) { + if (expression.kind === 168 /* PrefixUnaryExpression */) { var unaryExpression = expression; if (unaryExpression.operator === 33 /* PlusToken */ || unaryExpression.operator === 34 /* MinusToken */) { expression = unaryExpression.operand; @@ -22421,7 +22563,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -22494,18 +22636,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.kind === 202 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 202 /* InterfaceDeclaration */) { + else if (node.parent.kind === 203 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 145 /* TypeLiteral */) { + else if (node.parent.kind === 146 /* 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; } @@ -22525,11 +22667,11 @@ var ts; // export_opt ExternalImportDeclaration // export_opt AmbientDeclaration // - if (node.kind === 202 /* InterfaceDeclaration */ || - node.kind === 209 /* ImportDeclaration */ || - node.kind === 208 /* ImportEqualsDeclaration */ || - node.kind === 215 /* ExportDeclaration */ || - node.kind === 214 /* ExportAssignment */ || + if (node.kind === 203 /* InterfaceDeclaration */ || + node.kind === 210 /* ImportDeclaration */ || + node.kind === 209 /* ImportEqualsDeclaration */ || + node.kind === 216 /* ExportDeclaration */ || + node.kind === 215 /* ExportAssignment */ || (node.flags & 2 /* Ambient */) || (node.flags & (1 /* Export */ | 256 /* Default */))) { return false; @@ -22539,7 +22681,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 === 180 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 181 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -22565,7 +22707,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 === 179 /* Block */ || node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { + if (node.parent.kind === 180 /* Block */ || node.parent.kind === 207 /* ModuleBlock */ || node.parent.kind === 228 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -22611,10 +22753,6 @@ var ts; return diagnostics; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -22647,7 +22785,7 @@ var ts; ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } @@ -22659,7 +22797,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 209 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 210 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0); writeImportDeclaration(aliasEmitInfo.node); @@ -22673,13 +22811,13 @@ var ts; // Emit references corresponding to this file var emittedReferencedFiles = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { // Check what references need to be added if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && + if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); @@ -22735,10 +22873,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 198 /* VariableDeclaration */) { + if (declaration.kind === 199 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 212 /* NamedImports */ || declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 210 /* ImportClause */) { + else if (declaration.kind === 213 /* NamedImports */ || declaration.kind === 214 /* ImportSpecifier */ || declaration.kind === 211 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -22756,7 +22894,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 === 209 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 210 /* 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; @@ -22766,12 +22904,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 206 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 206 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -22864,41 +23002,41 @@ var ts; function emitType(type) { switch (type.kind) { case 112 /* AnyKeyword */: - case 121 /* StringKeyword */: - case 119 /* NumberKeyword */: + case 122 /* StringKeyword */: + case 120 /* NumberKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: case 99 /* VoidKeyword */: case 8 /* StringLiteral */: return writeTextOfNode(currentSourceFile, type); - case 177 /* HeritageClauseElement */: - return emitHeritageClauseElement(type); - case 141 /* TypeReference */: + case 177 /* ExpressionWithTypeArguments */: + return emitExpressionWithTypeArguments(type); + case 142 /* TypeReference */: return emitTypeReference(type); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return emitTypeQuery(type); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return emitArrayType(type); - case 147 /* TupleType */: + case 148 /* TupleType */: return emitTupleType(type); - case 148 /* UnionType */: + case 149 /* UnionType */: return emitUnionType(type); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return emitParenType(type); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: return emitTypeLiteral(type); case 65 /* Identifier */: return emitEntityName(type); - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: return emitEntityName(type); } function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 208 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 209 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -22906,17 +23044,17 @@ var ts; writeTextOfNode(currentSourceFile, entityName); } else { - var left = entityName.kind === 126 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 126 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 127 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 127 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentSourceFile, right); } } } - function emitHeritageClauseElement(node) { - if (ts.isSupportedHeritageClauseElement(node)) { - ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 155 /* PropertyAccessExpression */); + function emitExpressionWithTypeArguments(node) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { + ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 156 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -23028,10 +23166,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 208 /* ImportEqualsDeclaration */ || - (node.parent.kind === 227 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { + else if (node.kind === 209 /* ImportEqualsDeclaration */ || + (node.parent.kind === 228 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 228 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -23041,7 +23179,7 @@ var ts; }); } else { - if (node.kind === 209 /* ImportDeclaration */) { + if (node.kind === 210 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -23059,23 +23197,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return writeVariableStatement(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return writeClassDeclaration(node); - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -23091,7 +23229,7 @@ var ts; if (node.flags & 256 /* Default */) { write("default "); } - else if (node.kind !== 202 /* InterfaceDeclaration */) { + else if (node.kind !== 203 /* InterfaceDeclaration */) { write("declare "); } } @@ -23137,7 +23275,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 211 /* NamespaceImport */) { + if (namedBindings.kind === 212 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -23165,7 +23303,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 212 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); } @@ -23218,7 +23356,7 @@ var ts; emitModuleElementDeclarationFlags(node); write("module "); writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 206 /* ModuleBlock */) { + while (node.body.kind !== 207 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentSourceFile, node.name); @@ -23279,7 +23417,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 134 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); + return node.parent.kind === 135 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -23290,15 +23428,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 === 142 /* FunctionType */ || - node.parent.kind === 143 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 145 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 134 /* MethodDeclaration */ || - node.parent.kind === 133 /* MethodSignature */ || - node.parent.kind === 142 /* FunctionType */ || - node.parent.kind === 143 /* ConstructorType */ || - node.parent.kind === 138 /* CallSignature */ || - node.parent.kind === 139 /* ConstructSignature */); + if (node.parent.kind === 143 /* FunctionType */ || + node.parent.kind === 144 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 146 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 135 /* MethodDeclaration */ || + node.parent.kind === 134 /* MethodSignature */ || + node.parent.kind === 143 /* FunctionType */ || + node.parent.kind === 144 /* ConstructorType */ || + node.parent.kind === 139 /* CallSignature */ || + node.parent.kind === 140 /* ConstructSignature */); emitType(node.constraint); } else { @@ -23309,31 +23447,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 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 138 /* CallSignature */: + case 139 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.parent.flags & 128 /* 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 === 201 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 202 /* 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 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -23358,13 +23496,13 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - if (ts.isSupportedHeritageClauseElement(node)) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.parent.kind === 202 /* 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 : @@ -23445,7 +23583,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 !== 198 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 199 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -23455,10 +23593,10 @@ var ts; // what we want, namely the name expression enclosed in brackets. writeTextOfNode(currentSourceFile, node.name); // If optional property emit ? - if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && ts.hasQuestionToken(node)) { + if ((node.kind === 133 /* PropertyDeclaration */ || node.kind === 132 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && node.parent.kind === 145 /* TypeLiteral */) { + if ((node.kind === 133 /* PropertyDeclaration */ || node.kind === 132 /* PropertySignature */) && node.parent.kind === 146 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 32 /* Private */)) { @@ -23467,14 +23605,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 198 /* VariableDeclaration */) { + if (node.kind === 199 /* 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 === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) { + else if (node.kind === 133 /* PropertyDeclaration */ || node.kind === 132 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (node.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? @@ -23483,7 +23621,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 === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* 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 : @@ -23515,7 +23653,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 175 /* OmittedExpression */) { + if (element.kind !== 176 /* OmittedExpression */) { elements.push(element); } } @@ -23585,7 +23723,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 === 136 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 137 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -23598,7 +23736,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 136 /* GetAccessor */ + return accessor.kind === 137 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -23607,7 +23745,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 137 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 138 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (accessorWithTypeAnnotation.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? @@ -23657,17 +23795,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 200 /* FunctionDeclaration */) { + if (node.kind === 201 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 134 /* MethodDeclaration */) { + else if (node.kind === 135 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 200 /* FunctionDeclaration */) { + if (node.kind === 201 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 135 /* Constructor */) { + else if (node.kind === 136 /* Constructor */) { write("constructor"); } else { @@ -23685,11 +23823,11 @@ var ts; } function emitSignatureDeclaration(node) { // Construct signature or constructor type write new Signature - if (node.kind === 139 /* ConstructSignature */ || node.kind === 143 /* ConstructorType */) { + if (node.kind === 140 /* ConstructSignature */ || node.kind === 144 /* ConstructorType */) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 140 /* IndexSignature */) { + if (node.kind === 141 /* IndexSignature */) { write("["); } else { @@ -23699,22 +23837,22 @@ var ts; enclosingDeclaration = node; // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 140 /* IndexSignature */) { + if (node.kind === 141 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 142 /* FunctionType */ || node.kind === 143 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 145 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 143 /* FunctionType */ || node.kind === 144 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 146 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 135 /* Constructor */ && !(node.flags & 32 /* Private */)) { + else if (node.kind !== 136 /* Constructor */ && !(node.flags & 32 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -23725,26 +23863,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 139 /* ConstructSignature */: + case 140 /* 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 138 /* CallSignature */: + case 139 /* 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 140 /* IndexSignature */: + case 141 /* 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 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -23752,7 +23890,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 === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* 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 : @@ -23766,7 +23904,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 200 /* FunctionDeclaration */: + case 201 /* 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 : @@ -23801,9 +23939,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 142 /* FunctionType */ || - node.parent.kind === 143 /* ConstructorType */ || - node.parent.parent.kind === 145 /* TypeLiteral */) { + if (node.parent.kind === 143 /* FunctionType */ || + node.parent.kind === 144 /* ConstructorType */ || + node.parent.parent.kind === 146 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32 /* Private */)) { @@ -23819,24 +23957,24 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 135 /* Constructor */: + case 136 /* 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 139 /* ConstructSignature */: + case 140 /* 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 138 /* CallSignature */: + case 139 /* 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 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.parent.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -23844,7 +23982,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 === 201 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 202 /* 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 : @@ -23857,7 +23995,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 200 /* FunctionDeclaration */: + case 201 /* 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 : @@ -23869,12 +24007,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 === 150 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 151 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 151 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 152 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -23893,7 +24031,7 @@ var ts; typeName: bindingElement.name } : undefined; } - if (bindingElement.kind === 175 /* OmittedExpression */) { + if (bindingElement.kind === 176 /* 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) @@ -23902,7 +24040,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 152 /* BindingElement */) { + else if (bindingElement.kind === 153 /* 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" @@ -23943,40 +24081,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 205 /* ModuleDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 202 /* InterfaceDeclaration */: - case 201 /* ClassDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: + case 201 /* FunctionDeclaration */: + case 206 /* ModuleDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 203 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, !node.importClause); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return emitExportDeclaration(node); - case 135 /* Constructor */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 136 /* Constructor */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return writeFunctionDeclaration(node); - case 139 /* ConstructSignature */: - case 138 /* CallSignature */: - case 140 /* IndexSignature */: + case 140 /* ConstructSignature */: + case 139 /* CallSignature */: + case 141 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return emitAccessorDeclaration(node); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return emitPropertyDeclaration(node); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return emitExportAssignment(node); - case 227 /* SourceFile */: + case 228 /* SourceFile */: return emitSourceFile(node); } } @@ -24023,6 +24161,10 @@ var ts; /* @internal */ var ts; (function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; // Flags enum to track count of temp variables and a few dedicated names var TempFlags; (function (TempFlags) { @@ -24033,16 +24175,16 @@ var ts; // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature function emitFiles(resolver, host, targetSourceFile) { // emit output for the __extends helper function - var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; // emit output for the __decorate helper function - var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; // emit output for the __metadata helper function - var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\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};"; // emit output for the __param helper function - var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; + var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0 /* ES3 */; - var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var diagnostics = []; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { @@ -24100,6 +24242,13 @@ var ts; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; var currentSourceFile; + // name of an exporter function if file is a System external module + // System.register([...], function () {...}) + // exporting in System modules looks like: + // export var x; ... x = 1 + // => + // var x;... exporter("x", x = 1) + var exportFunctionForFile; var generatedNameSet = {}; var nodeToGeneratedName = []; var blockScopedVariableToGeneratedName; @@ -24118,7 +24267,8 @@ var ts; var writeEmittedFiles = writeJavaScriptFile; var detachedCommentsInfo; var writeComment = ts.writeCommentRange; - var emitSourceFileStart = function (node) { }; + /** Emit a node */ + var emit = emitNodeWithoutSourceMap; /** Called just before starting emit of a node */ var emitStart = function (node) { }; /** Called once the emit of the node is done */ @@ -24138,7 +24288,7 @@ var ts; var scopeEmitEnd = function () { }; /** Sourcemap data that will get encoded */ var sourceMapData; - if (compilerOptions.sourceMap) { + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { initializeEmitterWithSourceMaps(); } if (root) { @@ -24147,7 +24297,7 @@ var ts; } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { emitSourceFile(sourceFile); } }); @@ -24157,6 +24307,7 @@ var ts; return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + exportFunctionForFile = undefined; emit(sourceFile); } function isUniqueName(name) { @@ -24243,25 +24394,25 @@ var ts; } function generateNameForNode(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 201 /* ClassDeclaration */: - case 174 /* ClassExpression */: + case 201 /* FunctionDeclaration */: + case 202 /* ClassDeclaration */: + case 175 /* ClassExpression */: generateNameForFunctionOrClassDeclaration(node); break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: generateNameForModuleOrEnum(node); generateNameForNode(node.body); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: generateNameForModuleOrEnum(node); break; - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: generateNameForImportDeclaration(node); break; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: generateNameForExportDeclaration(node); break; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: generateNameForExportAssignment(node); break; } @@ -24281,7 +24432,7 @@ var ts; var sourceMapNameIndexMap = {}; var sourceMapNameIndices = []; function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; } // Last recorded and encoded spans var lastRecordedSourceMapSpan; @@ -24417,6 +24568,12 @@ var ts; sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; // The one that can be used from program to get the actual source file sourceMapData.inputSourceFileNames.push(node.fileName); + if (compilerOptions.inlineSources) { + if (!sourceMapData.sourceMapSourcesContent) { + sourceMapData.sourceMapSourcesContent = []; + } + sourceMapData.sourceMapSourcesContent.push(node.text); + } } function recordScopeNameOfNode(node, scopeName) { function recordScopeNameIndex(scopeNameIndex) { @@ -24431,7 +24588,7 @@ var ts; // unless it is a computed property. Then it is shown with brackets, // but the brackets are included in the name. var name_17 = node.name; - if (!name_17 || name_17.kind !== 127 /* ComputedPropertyName */) { + if (!name_17 || name_17.kind !== 128 /* ComputedPropertyName */) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -24449,20 +24606,20 @@ var ts; // The scope was already given a name use it recordScopeNameStart(scopeName); } - else if (node.kind === 200 /* FunctionDeclaration */ || - node.kind === 162 /* FunctionExpression */ || - node.kind === 134 /* MethodDeclaration */ || - node.kind === 133 /* MethodSignature */ || - node.kind === 136 /* GetAccessor */ || - node.kind === 137 /* SetAccessor */ || - node.kind === 205 /* ModuleDeclaration */ || - node.kind === 201 /* ClassDeclaration */ || - node.kind === 204 /* EnumDeclaration */) { + else if (node.kind === 201 /* FunctionDeclaration */ || + node.kind === 163 /* FunctionExpression */ || + node.kind === 135 /* MethodDeclaration */ || + node.kind === 134 /* MethodSignature */ || + node.kind === 137 /* GetAccessor */ || + node.kind === 138 /* SetAccessor */ || + node.kind === 206 /* ModuleDeclaration */ || + node.kind === 202 /* ClassDeclaration */ || + node.kind === 205 /* EnumDeclaration */) { // Declaration and has associated name use it if (node.name) { var name_18 = node.name; // For computed property names, the text will include the brackets - scopeName = name_18.kind === 127 /* ComputedPropertyName */ + scopeName = name_18.kind === 128 /* ComputedPropertyName */ ? ts.getTextOfNode(name_18) : node.name.text; } @@ -24482,18 +24639,22 @@ var ts; ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { + function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { if (typeof JSON !== "undefined") { - return JSON.stringify({ + var map_1 = { version: version, file: file, sourceRoot: sourceRoot, sources: sources, names: names, mappings: mappings - }); + }; + if (sourcesContent !== undefined) { + map_1.sourcesContent = sourcesContent; + } + return JSON.stringify(map_1); } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; + return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; function serializeStringArray(list) { var output = ""; for (var i = 0, n = list.length; i < n; i++) { @@ -24506,12 +24667,22 @@ var ts; } } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { - // Write source map file encodeLastRecordedSourceMapSpan(); - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); + var sourceMapUrl; + if (compilerOptions.inlineSourceMap) { + // Encode the sourceMap into the sourceMap url + var base64SourceMapText = ts.convertToBase64(sourceMapText); + sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; + } + else { + // Write source map file + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); + sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; + } // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); } // Initialize source map data var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); @@ -24524,6 +24695,7 @@ var ts; inputSourceFileNames: [], sourceMapNames: [], sourceMapMappings: "", + sourceMapSourcesContent: undefined, sourceMapDecodedMappings: [] }; // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -24552,8 +24724,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { + if (node) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node, false); + } + if (node.kind != 228 /* SourceFile */) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); + recordEmitNodeEndSpan(node); + } + else { + recordNewSourceFileStart(node); + emitNodeWithoutSourceMap(node, false); + } + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emitSourceFileStart = recordNewSourceFileStart; + emit = emitNodeWithSourceMap; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -24715,7 +24903,7 @@ var ts; } function emitLiteral(node) { var text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { + if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else if (languageVersion < 2 /* ES6 */ && isBinaryOrOctalIntegerLiteral(node, text)) { @@ -24804,10 +24992,10 @@ var ts; write("("); emit(tempVariable); // Now we emit the expressions - if (node.template.kind === 171 /* TemplateExpression */) { + if (node.template.kind === 172 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 169 /* BinaryExpression */ + var needsParens = templateSpan.expression.kind === 170 /* BinaryExpression */ && templateSpan.expression.operatorToken.kind === 23 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -24842,7 +25030,7 @@ var ts; // ("abc" + 1) << (2 + "") // rather than // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 161 /* ParenthesizedExpression */ + var needsParens = templateSpan.expression.kind !== 162 /* 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 @@ -24884,11 +25072,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return parent.expression === template; - case 159 /* TaggedTemplateExpression */: - case 161 /* ParenthesizedExpression */: + case 160 /* TaggedTemplateExpression */: + case 162 /* ParenthesizedExpression */: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; @@ -24909,7 +25097,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 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: switch (expression.operatorToken.kind) { case 35 /* AsteriskToken */: case 36 /* SlashToken */: @@ -24921,8 +25109,8 @@ var ts; default: return -1 /* LessThan */; } - case 172 /* YieldExpression */: - case 170 /* ConditionalExpression */: + case 173 /* YieldExpression */: + case 171 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -24937,11 +25125,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 !== 152 /* BindingElement */); + ts.Debug.assert(node.kind !== 153 /* BindingElement */); if (node.kind === 8 /* StringLiteral */) { emitLiteral(node); } - else if (node.kind === 127 /* ComputedPropertyName */) { + else if (node.kind === 128 /* 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: @@ -24985,36 +25173,36 @@ var ts; function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: - case 226 /* EnumMember */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 200 /* FunctionDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 205 /* ModuleDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: + case 227 /* EnumMember */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 206 /* ModuleDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: return parent.name === node; - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: return parent.name === node || parent.propertyName === node; - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: - case 214 /* ExportAssignment */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 215 /* ExportAssignment */: return false; - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return node.parent.label === node; } } @@ -25091,7 +25279,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emitVerbatimDeclarationName(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -25122,11 +25310,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 65 /* Identifier */: - case 153 /* ArrayLiteralExpression */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 161 /* ParenthesizedExpression */: + case 154 /* ArrayLiteralExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 162 /* 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; @@ -25146,14 +25334,14 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 173 /* SpreadElementExpression */) { + if (e.kind === 174 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < length && elements[i].kind !== 173 /* SpreadElementExpression */) { + while (i < length && elements[i].kind !== 174 /* SpreadElementExpression */) { i++; } write("["); @@ -25174,7 +25362,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 173 /* SpreadElementExpression */; + return node.kind === 174 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; @@ -25244,7 +25432,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 136 /* GetAccessor */ || property.kind === 137 /* SetAccessor */) { + if (property.kind === 137 /* GetAccessor */ || property.kind === 138 /* SetAccessor */) { // TODO (drosen): Reconcile with 'emitMemberFunctions'. var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { @@ -25296,13 +25484,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 224 /* PropertyAssignment */) { + if (property.kind === 225 /* PropertyAssignment */) { emit(property.initializer); } - else if (property.kind === 225 /* ShorthandPropertyAssignment */) { + else if (property.kind === 226 /* ShorthandPropertyAssignment */) { emitExpressionIdentifier(property.name); } - else if (property.kind === 134 /* MethodDeclaration */) { + else if (property.kind === 135 /* MethodDeclaration */) { emitFunctionDeclaration(property); } else { @@ -25336,7 +25524,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 === 127 /* ComputedPropertyName */) { + if (properties[i].name.kind === 128 /* ComputedPropertyName */) { numInitialNonComputedProperties = i; break; } @@ -25352,21 +25540,21 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(169 /* BinaryExpression */, startsOnNewLine); + var result = ts.createSynthesizedNode(170 /* BinaryExpression */, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(155 /* PropertyAccessExpression */); + var result = ts.createSynthesizedNode(156 /* PropertyAccessExpression */); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(20 /* DotToken */); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(156 /* ElementAccessExpression */); + var result = ts.createSynthesizedNode(157 /* ElementAccessExpression */); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; @@ -25380,10 +25568,10 @@ var ts; // NumberLiteral // 1.x -> not the same as (1).x // - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { return expr; } - var node = ts.createSynthesizedNode(161 /* ParenthesizedExpression */); + var node = ts.createSynthesizedNode(162 /* ParenthesizedExpression */); node.expression = expr; return node; } @@ -25396,19 +25584,19 @@ var ts; if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { write("*"); } - emitVerbatimDeclarationName(node.name); + emit(node.name, false); if (languageVersion < 2 /* ES6 */) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment. For example: // module m { // export let y; @@ -25447,7 +25635,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 155 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 156 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -25481,7 +25669,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emitVerbatimDeclarationName(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -25499,10 +25687,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 173 /* SpreadElementExpression */; }); + return ts.forEach(elements, function (e) { return e.kind === 174 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 161 /* ParenthesizedExpression */ || node.kind === 160 /* TypeAssertionExpression */) { + while (node.kind === 162 /* ParenthesizedExpression */ || node.kind === 161 /* TypeAssertionExpression */) { node = node.expression; } return node; @@ -25523,13 +25711,13 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 155 /* PropertyAccessExpression */) { + if (expr.kind === 156 /* PropertyAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 156 /* ElementAccessExpression */) { + else if (expr.kind === 157 /* ElementAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); @@ -25574,7 +25762,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 155 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; + superCall = node.expression.kind === 156 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; } if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); @@ -25611,12 +25799,12 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 163 /* ArrowFunction */) { - if (node.expression.kind === 160 /* TypeAssertionExpression */) { + if (!node.parent || node.parent.kind !== 164 /* ArrowFunction */) { + if (node.expression.kind === 161 /* TypeAssertionExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind == 160 /* TypeAssertionExpression */) { + while (operand.kind == 161 /* TypeAssertionExpression */) { operand = operand.expression; } // We have an expression of the form: (SubExpr) @@ -25627,14 +25815,14 @@ 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 !== 167 /* PrefixUnaryExpression */ && - operand.kind !== 166 /* VoidExpression */ && - operand.kind !== 165 /* TypeOfExpression */ && - operand.kind !== 164 /* DeleteExpression */ && - operand.kind !== 168 /* PostfixUnaryExpression */ && - operand.kind !== 158 /* NewExpression */ && - !(operand.kind === 157 /* CallExpression */ && node.parent.kind === 158 /* NewExpression */) && - !(operand.kind === 162 /* FunctionExpression */ && node.parent.kind === 157 /* CallExpression */)) { + if (operand.kind !== 168 /* PrefixUnaryExpression */ && + operand.kind !== 167 /* VoidExpression */ && + operand.kind !== 166 /* TypeOfExpression */ && + operand.kind !== 165 /* DeleteExpression */ && + operand.kind !== 169 /* PostfixUnaryExpression */ && + operand.kind !== 159 /* NewExpression */ && + !(operand.kind === 158 /* CallExpression */ && node.parent.kind === 159 /* NewExpression */) && + !(operand.kind === 163 /* FunctionExpression */ && node.parent.kind === 158 /* CallExpression */)) { emit(operand); return; } @@ -25659,7 +25847,27 @@ var ts; write(" "); emit(node.expression); } + function isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node) { + if (!isCurrentFileSystemExternalModule() || node.kind !== 65 /* Identifier */ || ts.nodeIsSynthesized(node)) { + return false; + } + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 199 /* VariableDeclaration */ || node.parent.kind === 153 /* BindingElement */); + var targetDeclaration = isVariableDeclarationOrBindingElement + ? node.parent + : resolver.getReferencedValueDeclaration(node); + return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); + } function emitPrefixUnaryExpression(node) { + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + // emit + // ++x + // as + // exports('x', ++x) + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + } write(ts.tokenToString(node.operator)); // In some cases, we need to emit a space between the operator and the operand. One obvious case // is when the operator is an identifier, like delete or typeof. We also need to do this for plus @@ -25673,7 +25881,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 === 167 /* PrefixUnaryExpression */) { + if (node.operand.kind === 168 /* PrefixUnaryExpression */) { var operand = node.operand; if (node.operator === 33 /* PlusToken */ && (operand.operator === 33 /* PlusToken */ || operand.operator === 38 /* PlusPlusToken */)) { write(" "); @@ -25683,23 +25891,87 @@ var ts; } } emit(node.operand); + if (exportChanged) { + write(")"); + } } function emitPostfixUnaryExpression(node) { - emit(node.operand); - write(ts.tokenToString(node.operator)); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + // export function returns the value that was passes as the second argument + // however for postfix unary expressions result value should be the value before modification. + // emit 'x++' as '(export('x', ++x) - 1)' and 'x--' as '(export('x', --x) + 1)' + write("(" + exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + write(ts.tokenToString(node.operator)); + emit(node.operand); + if (node.operator === 38 /* PlusPlusToken */) { + write(") - 1)"); + } + else { + write(") + 1)"); + } + } + else { + emit(node.operand); + write(ts.tokenToString(node.operator)); + } + } + function shouldHoistDeclarationInSystemJsModule(node) { + return isSourceFileLevelDeclarationInSystemJsModule(node, false); + } + /* + * Checks if given node is a source file level declaration (not nested in module/function). + * If 'isExported' is true - then declaration must also be exported. + * This function is used in two cases: + * - check if node is a exported source file level value to determine + * if we should also export the value after its it changed + * - check if node is a source level declaration to emit it differently, + * i.e non-exported variable statement 'var x = 1' is hoisted so + * we we emit variable statement 'var' should be dropped. + */ + function isSourceFileLevelDeclarationInSystemJsModule(node, isExported) { + if (!node || languageVersion >= 2 /* ES6 */ || !isCurrentFileSystemExternalModule()) { + return false; + } + var current = node; + while (current) { + if (current.kind === 228 /* SourceFile */) { + return !isExported || ((ts.getCombinedNodeFlags(node) & 1 /* Export */) !== 0); + } + else if (ts.isFunctionLike(current) || current.kind === 207 /* ModuleBlock */) { + return false; + } + else { + current = current.parent; + } + } } function emitBinaryExpression(node) { if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 53 /* EqualsToken */ && - (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 182 /* ExpressionStatement */); + (node.left.kind === 155 /* ObjectLiteralExpression */ || node.left.kind === 154 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 183 /* ExpressionStatement */); } else { + var exportChanged = node.operatorToken.kind >= 53 /* FirstAssignment */ && + node.operatorToken.kind <= 64 /* LastAssignment */ && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.left); + if (exportChanged) { + // emit assignment 'x y' as 'exports("x", x y)' + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.left); + write("\", "); + } emit(node.left); var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 /* CommaToken */ ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + if (exportChanged) { + write(")"); + } } } function synthesizedNodeStartsOnNewLine(node) { @@ -25731,7 +26003,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 179 /* Block */) { + if (node && node.kind === 180 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -25746,12 +26018,12 @@ var ts; emitToken(14 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 206 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 205 /* ModuleDeclaration */); + if (node.kind === 207 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 206 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 206 /* ModuleBlock */) { + if (node.kind === 207 /* ModuleBlock */) { emitTempDeclarations(true); } decreaseIndent(); @@ -25760,7 +26032,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 179 /* Block */) { + if (node.kind === 180 /* Block */) { write(" "); emit(node); } @@ -25772,7 +26044,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 163 /* ArrowFunction */); + emitParenthesizedIf(node.expression, node.expression.kind === 164 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { @@ -25785,7 +26057,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(76 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 183 /* IfStatement */) { + if (node.elseStatement.kind === 184 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -25797,7 +26069,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 179 /* Block */) { + if (node.statement.kind === 180 /* Block */) { write(" "); } else { @@ -25813,7 +26085,15 @@ var ts; write(")"); emitEmbeddedStatement(node.statement); } - function emitStartOfVariableDeclarationList(decl, startPos) { + /* Returns true if start of variable declaration list was emitted. + * Return false if nothing was written - this can happen for source file level variable declarations + * in system modules - such variable declarations are hoisted. + */ + function tryEmitStartOfVariableDeclarationList(decl, startPos) { + if (shouldHoistVariable(decl, true)) { + // variables in variable declaration list were already hoisted + return false; + } var tokenKind = 98 /* VarKeyword */; if (decl && languageVersion >= 2 /* ES6 */) { if (ts.isLet(decl)) { @@ -25825,28 +26105,53 @@ var ts; } if (startPos !== undefined) { emitToken(tokenKind, startPos); + write(" "); } else { switch (tokenKind) { case 98 /* VarKeyword */: - return write("var "); + write("var "); + break; case 104 /* LetKeyword */: - return write("let "); + write("let "); + break; case 70 /* ConstKeyword */: - return write("const "); + write("const "); + break; } } + return true; + } + function emitVariableDeclarationListSkippingUninitializedEntries(list) { + var started = false; + for (var _a = 0, _b = list.declarations; _a < _b.length; _a++) { + var decl = _b[_a]; + if (!decl.initializer) { + continue; + } + if (!started) { + started = true; + } + else { + write(", "); + } + emit(decl); + } + return started; } function emitForStatement(node) { var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(16 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 200 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; - var declarations = variableDeclarationList.declarations; - emitStartOfVariableDeclarationList(declarations[0], endPos); - write(" "); - emitCommaList(declarations); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + if (startIsEmitted) { + emitCommaList(variableDeclarationList.declarations); + } + else { + emitVariableDeclarationListSkippingUninitializedEntries(variableDeclarationList); + } } else if (node.initializer) { emit(node.initializer); @@ -25854,30 +26159,28 @@ var ts; write(";"); emitOptional(" ", node.condition); write(";"); - emitOptional(" ", node.iterator); + emitOptional(" ", node.incrementor); write(")"); emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 188 /* ForOfStatement */) { + if (languageVersion < 2 /* ES6 */ && node.kind === 189 /* ForOfStatement */) { return emitDownLevelForOfStatement(node); } var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(16 /* OpenParenToken */, endPos); - if (node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - var decl = variableDeclarationList.declarations[0]; - emitStartOfVariableDeclarationList(decl, endPos); - write(" "); - emit(decl); + tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 187 /* ForInStatement */) { + if (node.kind === 188 /* ForInStatement */) { write(" in "); } else { @@ -25927,30 +26230,30 @@ var ts; emitStart(node.expression); write("var "); // _i = 0 - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); if (!rhsIsIdentifier) { // , _a = expr write(", "); emitStart(node.expression); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(" = "); - emitWithoutSourceMap(node.expression); + emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } write("; "); // _i < _a.length; emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" < "); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(".length"); emitEnd(node.initializer); write("; "); // _i++) emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); emitToken(17 /* CloseParenToken */, node.expression.end); @@ -25962,7 +26265,7 @@ var ts; // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -25975,35 +26278,35 @@ var ts; else { // The following call does not include the initializer, so we have // to emit it separately. - emitWithoutSourceMap(declaration); + emitNodeWithoutSourceMap(declaration); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { // It's an empty declaration list. This can only happen in an error case, if the user wrote // for (let of []) {} - emitWithoutSourceMap(createTempVariable(0 /* Auto */)); + emitNodeWithoutSourceMap(createTempVariable(0 /* Auto */)); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { // Initializer is an expression. Emit the expression in the body, so that it's // evaluated on every iteration. var assignmentExpression = createBinaryExpression(node.initializer, 53 /* EqualsToken */, rhsIterationValue, false); - if (node.initializer.kind === 153 /* ArrayLiteralExpression */ || node.initializer.kind === 154 /* ObjectLiteralExpression */) { + if (node.initializer.kind === 154 /* ArrayLiteralExpression */ || node.initializer.kind === 155 /* 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, true, undefined); } else { - emitWithoutSourceMap(assignmentExpression); + emitNodeWithoutSourceMap(assignmentExpression); } } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 179 /* Block */) { + if (node.statement.kind === 180 /* Block */) { emitLines(node.statement.statements); } else { @@ -26015,7 +26318,7 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 191 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -26060,7 +26363,7 @@ var ts; ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 220 /* CaseClause */) { + if (node.kind === 221 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -26115,7 +26418,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 205 /* ModuleDeclaration */); + } while (node && node.kind !== 206 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -26130,17 +26433,17 @@ var ts; write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < 2 /* ES6 */) { + else if (languageVersion < 2 /* ES6 */ && compilerOptions.module !== 4 /* System */) { write("exports."); } } - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { var zero = ts.createSynthesizedNode(7 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(166 /* VoidExpression */); + var result = ts.createSynthesizedNode(167 /* VoidExpression */); result.expression = zero; return result; } @@ -26148,19 +26451,35 @@ var ts; if (node.flags & 1 /* Export */) { writeLine(); emitStart(node); - if (node.flags & 256 /* Default */) { - if (languageVersion === 0 /* ES3 */) { - write("exports[\"default\"]"); + if (compilerOptions.module === 4 /* System */) { + // emit export default as + // export("default", ) + write(exportFunctionForFile + "(\""); + if (node.flags & 256 /* Default */) { + write("default"); } else { - write("exports.default"); + emitNodeWithoutSourceMap(node.name); } + write("\", "); + emitDeclarationName(node); + write(")"); } else { - emitModuleMemberName(node); + if (node.flags & 256 /* Default */) { + if (languageVersion === 0 /* ES3 */) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); } - write(" = "); - emitNameOfDeclaration(node); emitEnd(node); write(";"); } @@ -26170,13 +26489,24 @@ var ts; for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { var specifier = _b[_a]; writeLine(); - emitStart(specifier.name); - emitContainingModuleName(specifier); - write("."); - emitWithoutSourceMap(specifier.name); - emitEnd(specifier.name); - write(" = "); - emitExpressionIdentifier(name); + if (compilerOptions.module === 4 /* System */) { + emitStart(specifier.name); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(specifier.name); + write("\", "); + emitExpressionIdentifier(name); + write(")"); + emitEnd(specifier.name); + } + else { + emitStart(specifier.name); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier.name); + write(" = "); + emitExpressionIdentifier(name); + } write(";"); } } @@ -26185,8 +26515,18 @@ var ts; var emitCount = 0; // An exported declaration is actually emitted as an assignment (to a property on the module object), so // temporary variables in an exported declaration need to have real declarations elsewhere - var isDeclaration = (root.kind === 198 /* VariableDeclaration */ && !(ts.getCombinedNodeFlags(root) & 1 /* Export */)) || root.kind === 129 /* Parameter */; - if (root.kind === 169 /* BinaryExpression */) { + // 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 === 199 /* VariableDeclaration */) { + var isExported = ts.getCombinedNodeFlags(root) & 1 /* Export */; + var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); + canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; + } + else if (root.kind === 130 /* Parameter */) { + canDefineTempVariablesInPlace = true; + } + if (root.kind === 170 /* BinaryExpression */) { emitAssignmentExpression(root); } else { @@ -26198,7 +26538,14 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 198 /* VariableDeclaration */ || name.parent.kind === 152 /* BindingElement */)) { + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 199 /* VariableDeclaration */ || name.parent.kind === 153 /* BindingElement */); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(name); + write("\", "); + } + if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } else { @@ -26206,11 +26553,14 @@ var ts; } write(" = "); emit(value); + if (exportChanged) { + write(")"); + } } function ensureIdentifier(expr) { if (expr.kind !== 65 /* Identifier */) { var identifier = createTempVariable(0 /* Auto */); - if (!isDeclaration) { + if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -26223,14 +26573,14 @@ var ts; // we need to generate a temporary variable value = ensureIdentifier(value); // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(169 /* BinaryExpression */); + var equals = ts.createSynthesizedNode(170 /* BinaryExpression */); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(30 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(170 /* ConditionalExpression */); + var cond = ts.createSynthesizedNode(171 /* ConditionalExpression */); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50 /* QuestionToken */); cond.whenTrue = whenTrue; @@ -26250,7 +26600,7 @@ var ts; return createPropertyAccessExpression(object, propName); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(157 /* CallExpression */); + var call = ts.createSynthesizedNode(158 /* CallExpression */); var sliceIdentifier = ts.createSynthesizedNode(65 /* Identifier */); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -26267,7 +26617,7 @@ var ts; } for (var _a = 0; _a < properties.length; _a++) { var p = properties[_a]; - if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + if (p.kind === 225 /* PropertyAssignment */ || p.kind === 226 /* ShorthandPropertyAssignment */) { // TODO(andersh): Computed property support var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); @@ -26283,8 +26633,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175 /* OmittedExpression */) { - if (e.kind !== 173 /* SpreadElementExpression */) { + if (e.kind !== 176 /* OmittedExpression */) { + if (e.kind !== 174 /* SpreadElementExpression */) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -26294,14 +26644,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { + if (target.kind === 170 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 154 /* ObjectLiteralExpression */) { + if (target.kind === 155 /* ObjectLiteralExpression */) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 153 /* ArrayLiteralExpression */) { + else if (target.kind === 154 /* ArrayLiteralExpression */) { emitArrayLiteralAssignment(target, value); } else { @@ -26315,14 +26665,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 161 /* ParenthesizedExpression */) { + if (root.parent.kind !== 162 /* ParenthesizedExpression */) { write("("); } value = ensureIdentifier(value); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 161 /* ParenthesizedExpression */) { + if (root.parent.kind !== 162 /* ParenthesizedExpression */) { write(")"); } } @@ -26346,12 +26696,12 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 150 /* ObjectBindingPattern */) { + if (pattern.kind === 151 /* 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 !== 175 /* OmittedExpression */) { + else if (element.kind !== 176 /* OmittedExpression */) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); @@ -26379,7 +26729,6 @@ var ts; } else { renameNonTopLevelLetAndConst(node.name); - emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2 /* ES6 */) { // downlevel emit for non-initialized let bindings defined in loops @@ -26392,16 +26741,26 @@ var ts; (getCombinedFlagsForIdentifier(node.name) & 4096 /* Let */); // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isUninitializedLet && - node.parent.parent.kind !== 187 /* ForInStatement */ && - node.parent.parent.kind !== 188 /* ForOfStatement */) { + node.parent.parent.kind !== 188 /* ForInStatement */ && + node.parent.parent.kind !== 189 /* ForOfStatement */) { initializer = createVoidZero(); } } + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.name); + write("\", "); + } + emitModuleMemberName(node); emitOptional(" = ", initializer); + if (exportChanged) { + write(")"); + } } } function emitExportVariableAssignments(node) { - if (node.kind === 175 /* OmittedExpression */) { + if (node.kind === 176 /* OmittedExpression */) { return; } var name = node.name; @@ -26413,7 +26772,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { + if (!node.parent || (node.parent.kind !== 199 /* VariableDeclaration */ && node.parent.kind !== 153 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -26428,7 +26787,7 @@ var ts; if (languageVersion >= 2 /* ES6 */ || ts.nodeIsSynthesized(node) || node.kind !== 65 /* Identifier */ || - (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { + (node.parent.kind !== 199 /* VariableDeclaration */ && node.parent.kind !== 153 /* BindingElement */)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); @@ -26437,17 +26796,17 @@ var ts; return; } // here it is known that node is a block scoped variable - var list = ts.getAncestor(node, 199 /* VariableDeclarationList */); - if (list.parent.kind === 180 /* VariableStatement */) { - var isSourceFileLevelBinding = list.parent.parent.kind === 227 /* SourceFile */; - var isModuleLevelBinding = list.parent.parent.kind === 206 /* ModuleBlock */; - var isFunctionLevelBinding = list.parent.parent.kind === 179 /* Block */ && ts.isFunctionLike(list.parent.parent.parent); + var list = ts.getAncestor(node, 200 /* VariableDeclarationList */); + if (list.parent.kind === 181 /* VariableStatement */) { + var isSourceFileLevelBinding = list.parent.parent.kind === 228 /* SourceFile */; + var isModuleLevelBinding = list.parent.parent.kind === 207 /* ModuleBlock */; + var isFunctionLevelBinding = list.parent.parent.kind === 180 /* Block */ && ts.isFunctionLike(list.parent.parent.parent); if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { return; } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 227 /* SourceFile */ + var parent = blockScopeContainer.kind === 228 /* SourceFile */ ? blockScopeContainer : blockScopeContainer.parent; if (resolver.resolvesToSomeValue(parent, node.text)) { @@ -26462,19 +26821,28 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 1 /* Export */) && languageVersion >= 2 /* ES6 */ && - node.parent.kind === 227 /* SourceFile */; + node.parent.kind === 228 /* SourceFile */; } function emitVariableStatement(node) { + var startIsEmitted = true; if (!(node.flags & 1 /* Export */)) { - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { // Exported ES6 module member write("export "); - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); + } + if (startIsEmitted) { + emitCommaList(node.declarationList.declarations); + write(";"); + } + else { + var atLeastOneItem = emitVariableDeclarationListSkippingUninitializedEntries(node.declarationList); + if (atLeastOneItem) { + write(";"); + } } - emitCommaList(node.declarationList.declarations); - write(";"); if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); } @@ -26521,14 +26889,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitWithoutSourceMap(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -26548,7 +26916,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -26569,7 +26937,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -26578,27 +26946,27 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 136 /* GetAccessor */ ? "get " : "set "); - emitVerbatimDeclarationName(node.name); + write(node.kind === 137 /* GetAccessor */ ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 163 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; + return node.kind === 164 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } - function emitNameOfDeclaration(node) { + function emitDeclarationName(node) { if (node.name) { - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(getGeneratedNameForNode(node)); } } function shouldEmitFunctionName(node) { - if (node.kind === 162 /* FunctionExpression */) { + if (node.kind === 163 /* FunctionExpression */) { // Emit name if one is present return !!node.name; } - if (node.kind === 200 /* FunctionDeclaration */) { + if (node.kind === 201 /* FunctionDeclaration */) { // Emit name if one is present, or emit generated name in down-level case (for export default case) return !!node.name || languageVersion < 2 /* ES6 */; } @@ -26607,6 +26975,10 @@ var ts; if (ts.nodeIsMissing(node.body)) { return emitOnlyPinnedOrTripleSlashComments(node); } + if (node.kind !== 135 /* MethodDeclaration */ && node.kind !== 134 /* MethodSignature */) { + // Methods will emit the comments as part of emitting method declaration + emitLeadingComments(node); + } // For targeting below es6, emit functions-like declaration including arrow function using function keyword. // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead if (!shouldEmitAsArrowFunction(node)) { @@ -26623,12 +26995,15 @@ var ts; write(" "); } if (shouldEmitFunctionName(node)) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 /* ES6 */ && node.kind === 200 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 /* ES6 */ && node.kind === 201 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } + if (node.kind !== 135 /* MethodDeclaration */ && node.kind !== 134 /* MethodSignature */) { + emitTrailingComments(node); + } } function emitCaptureThisForNodeIfNecessary(node) { if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { @@ -26677,7 +27052,7 @@ var ts; // in that case. write(" { }"); } - else if (node.body.kind === 179 /* Block */) { + else if (node.body.kind === 180 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -26708,10 +27083,10 @@ var ts; write(" "); // Unwrap all type assertions. var current = body; - while (current.kind === 160 /* TypeAssertionExpression */) { + while (current.kind === 161 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 154 /* ObjectLiteralExpression */); + emitParenthesizedIf(body, current.kind === 155 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -26787,9 +27162,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 182 /* ExpressionStatement */) { + if (statement && statement.kind === 183 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 157 /* CallExpression */) { + if (expr && expr.kind === 158 /* CallExpression */) { var func = expr.expression; if (func && func.kind === 91 /* SuperKeyword */) { return statement; @@ -26805,7 +27180,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitWithoutSourceMap(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -26818,22 +27193,22 @@ var ts; // TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here. if (memberName.kind === 8 /* StringLiteral */ || memberName.kind === 7 /* NumericLiteral */) { write("["); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 127 /* ComputedPropertyName */) { + else if (memberName.kind === 128 /* ComputedPropertyName */) { emitComputedPropertyName(memberName); } else { write("."); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); } } - function getInitializedProperties(node, static) { + function getInitializedProperties(node, isStatic) { var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 132 /* PropertyDeclaration */ && static === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { + if (member.kind === 133 /* PropertyDeclaration */ && isStatic === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { properties.push(member); } } @@ -26855,7 +27230,7 @@ var ts; } else { if (property.flags & 128 /* Static */) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } else { write("this"); @@ -26873,11 +27248,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 178 /* SemicolonClassElement */) { + if (member.kind === 179 /* SemicolonClassElement */) { writeLine(); write(";"); } - else if (member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) { + else if (member.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */) { if (!member.body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -26896,7 +27271,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) { + else if (member.kind === 137 /* GetAccessor */ || member.kind === 138 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -26946,22 +27321,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) && !member.body) { + if ((member.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */) && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === 134 /* MethodDeclaration */ || - member.kind === 136 /* GetAccessor */ || - member.kind === 137 /* SetAccessor */) { + else if (member.kind === 135 /* MethodDeclaration */ || + member.kind === 137 /* GetAccessor */ || + member.kind === 138 /* SetAccessor */) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 128 /* Static */) { write("static "); } - if (member.kind === 136 /* GetAccessor */) { + if (member.kind === 137 /* GetAccessor */) { write("get "); } - else if (member.kind === 137 /* SetAccessor */) { + else if (member.kind === 138 /* SetAccessor */) { write("set "); } if (member.asteriskToken) { @@ -26972,7 +27347,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 178 /* SemicolonClassElement */) { + else if (member.kind === 179 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -26997,11 +27372,11 @@ var ts; var hasInstancePropertyWithInitializer = false; // Emit the constructor overload pinned comments ts.forEach(node.members, function (member) { - if (member.kind === 135 /* Constructor */ && !member.body) { + if (member.kind === 136 /* Constructor */ && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } // Check if there is any non-static property assignment - if (member.kind === 132 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { + if (member.kind === 133 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -27017,7 +27392,7 @@ var ts; emitStart(ctor || node); if (languageVersion < 2 /* ES6 */) { write("function "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitSignatureParameters(ctor); } else { @@ -27109,7 +27484,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* 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: @@ -27167,7 +27542,7 @@ var ts; write("export "); } write("let "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = "); } else if (isES6ExportedDeclaration(node)) { @@ -27189,7 +27564,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, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174 /* ClassExpression */; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 175 /* ClassExpression */; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0 /* Auto */); @@ -27202,7 +27577,7 @@ var ts; // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. if ((node.name || !(node.flags & 256 /* Default */)) && !thisNodeIsDecorated) { write(" "); - emitNameOfDeclaration(node); + emitDeclarationName(node); } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { @@ -27219,6 +27594,7 @@ var ts; writeLine(); emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); + // TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now. // For a decorated class, we need to assign its name (if it has one). This is because we emit // the class as a class expression to avoid the double-binding of the identifier: // @@ -27228,15 +27604,6 @@ var ts; // if (thisNodeIsDecorated) { write(";"); - if (node.name) { - writeLine(); - write("Object.defineProperty("); - emitNameOfDeclaration(node); - write(", \"name\", { value: \""); - emitNameOfDeclaration(node); - write("\", configurable: true });"); - writeLine(); - } } // Emit static property assignment. Because classDeclaration is lexically evaluated, // it is safe to emit static property assignment after classDeclaration @@ -27268,7 +27635,7 @@ var ts; emitStart(node); emitModuleMemberName(node); write(" = "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitEnd(node); write(";"); } @@ -27276,14 +27643,17 @@ var ts; // if this is a top level default export of decorated class, write the export after the declaration. writeLine(); write("export default "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(";"); } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 201 /* ClassDeclaration */) { - write("var "); - emitNameOfDeclaration(node); + if (node.kind === 202 /* ClassDeclaration */) { + // source file level classes in system modules are hoisted so 'var's for them are already defined + if (!shouldHoistDeclarationInSystemJsModule(node)) { + write("var "); + } + emitDeclarationName(node); write(" = "); } write("(function ("); @@ -27306,7 +27676,7 @@ var ts; writeLine(); emitStart(baseTypeNode); write("__extends("); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(", _super);"); emitEnd(baseTypeNode); } @@ -27319,7 +27689,7 @@ var ts; writeLine(); emitToken(15 /* CloseBraceToken */, node.members.end, function () { write("return "); - emitNameOfDeclaration(node); + emitDeclarationName(node); }); write(";"); emitTempDeclarations(true); @@ -27337,11 +27707,11 @@ var ts; emit(baseTypeNode.expression); } write(")"); - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* ClassDeclaration */) { emitExportMemberAssignment(node); } if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile && node.name) { @@ -27349,7 +27719,7 @@ var ts; } } function emitClassMemberPrefix(node, member) { - emitNameOfDeclaration(node); + emitDeclarationName(node); if (!(member.flags & 128 /* Static */)) { write(".prototype"); } @@ -27379,7 +27749,7 @@ var ts; // writeLine(); emitStart(node); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); @@ -27394,7 +27764,7 @@ var ts; decreaseIndent(); writeLine(); write("], "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); @@ -27433,7 +27803,7 @@ var ts; else { decorators = member.decorators; // we only decorate the parameters here if this is a method - if (member.kind === 134 /* MethodDeclaration */) { + if (member.kind === 135 /* MethodDeclaration */) { functionLikeMember = member; } } @@ -27471,7 +27841,7 @@ var ts; // writeLine(); emitStart(member); - if (member.kind !== 132 /* PropertyDeclaration */) { + if (member.kind !== 133 /* PropertyDeclaration */) { write("Object.defineProperty("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -27501,7 +27871,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - if (member.kind !== 132 /* PropertyDeclaration */) { + if (member.kind !== 133 /* PropertyDeclaration */) { write(", Object.getOwnPropertyDescriptor("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -27543,10 +27913,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 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 132 /* PropertyDeclaration */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 133 /* PropertyDeclaration */: return true; } return false; @@ -27556,7 +27926,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 134 /* MethodDeclaration */: + case 135 /* MethodDeclaration */: return true; } return false; @@ -27566,9 +27936,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 201 /* ClassDeclaration */: - case 134 /* MethodDeclaration */: - case 137 /* SetAccessor */: + case 202 /* ClassDeclaration */: + case 135 /* MethodDeclaration */: + case 138 /* SetAccessor */: return true; } return false; @@ -27731,7 +28101,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 205 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 206 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -27748,7 +28118,9 @@ var ts; if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - if (!isModuleMergedWithES6Class(node)) { + var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); + var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); + if (emitVarForModule) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); @@ -27765,7 +28137,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 206 /* ModuleBlock */) { + if (node.body.kind === 207 /* ModuleBlock */) { var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; tempFlags = 0; @@ -27799,6 +28171,14 @@ var ts; write(" = {}));"); emitEnd(node); if (!isES6ExportedDeclaration(node) && node.name.kind === 65 /* Identifier */ && node.parent === currentSourceFile) { + if (compilerOptions.module === 4 /* System */ && (node.flags & 1 /* Export */)) { + writeLine(); + write(exportFunctionForFile + "(\""); + emitDeclarationName(node); + write("\", "); + emitDeclarationName(node); + write(")"); + } emitExportMemberAssignments(node.name); } } @@ -27815,16 +28195,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 208 /* ImportEqualsDeclaration */) { + if (node.kind === 209 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 212 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 209 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; + return node.kind === 210 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -27852,7 +28232,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 212 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -27878,7 +28258,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 208 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; + var isExportedImport = node.kind === 209 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2 /* AMD */) { emitLeadingComments(node); @@ -27897,7 +28277,7 @@ var ts; // import { x, y } from "foo" // import d, * as x from "foo" // import d, { x, y } from "foo" - var isNakedImport = 209 /* ImportDeclaration */ && !node.importClause; + var isNakedImport = 210 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -27965,6 +28345,7 @@ var ts; } } function emitExportDeclaration(node) { + ts.Debug.assert(compilerOptions.module !== 4 /* System */); if (languageVersion < 2 /* ES6 */) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); @@ -27985,11 +28366,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitWithoutSourceMap(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); } @@ -28025,7 +28406,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitWithoutSourceMap(node.moduleSpecifier); + emitNodeWithoutSourceMap(node.moduleSpecifier); } write(";"); emitEnd(node); @@ -28043,10 +28424,10 @@ var ts; } emitStart(specifier); if (specifier.propertyName) { - emitWithoutSourceMap(specifier.propertyName); + emitNodeWithoutSourceMap(specifier.propertyName); write(" as "); } - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier); needsComma = true; } @@ -28060,8 +28441,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 200 /* FunctionDeclaration */ && - expression.kind !== 201 /* ClassDeclaration */) { + if (expression.kind !== 201 /* FunctionDeclaration */ && + expression.kind !== 202 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -28069,14 +28450,21 @@ var ts; else { writeLine(); emitStart(node); - emitContainingModuleName(node); - if (languageVersion === 0 /* ES3 */) { - write("[\"default\"] = "); + if (compilerOptions.module === 4 /* System */) { + write(exportFunctionForFile + "(\"default\","); + emit(node.expression); + write(")"); } else { - write(".default = "); + emitContainingModuleName(node); + if (languageVersion === 0 /* ES3 */) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } + emit(node.expression); } - emit(node.expression); write(";"); emitEnd(node); } @@ -28090,7 +28478,7 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { // import "mod" @@ -28100,13 +28488,13 @@ var ts; externalImports.push(node); } break; - case 208 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 219 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + case 209 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 220 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -28127,7 +28515,7 @@ var ts; } } break; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; @@ -28148,25 +28536,494 @@ var ts; write("}"); } } - function emitAMDModule(node, startIndex) { + function getLocalNameForExternalImport(importNode) { + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + return getGeneratedNameForNode(importNode); + } + } + function getExternalModuleNameText(importNode) { + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8 /* StringLiteral */) { + return getLiteralText(moduleName); + } + return undefined; + } + function emitVariableDeclarationsForImports() { + if (externalImports.length === 0) { + return; + } + writeLine(); + var started = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; + // do not create variable declaration for exports and imports that lack import clause + var skipNode = importNode.kind === 216 /* ExportDeclaration */ || + (importNode.kind === 210 /* ImportDeclaration */ && !importNode.importClause); + if (skipNode) { + continue; + } + if (!started) { + write("var "); + started = true; + } + else { + write(", "); + } + write(getLocalNameForExternalImport(importNode)); + } + if (started) { + write(";"); + } + } + function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { + // when resolving exports local exported entries/indirect exported entries in the module + // should always win over entries with similar names that were added via star exports + // to support this we store names of local/indirect exported entries in a set. + // this set is used to filter names brought by star expors. + if (!hasExportStars) { + // local names set is needed only in presence of star exports + return undefined; + } + // local names set should only be added if we have anything exported + if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { + // no exported declarations (export var ...) or export specifiers (export {x}) + // check if we have any non star export declarations. + var hasExportDeclarationWithExportClause = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var externalImport = externalImports[_a]; + if (externalImport.kind === 216 /* ExportDeclaration */ && externalImport.exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + if (!hasExportDeclarationWithExportClause) { + // we still need to emit exportStar helper + return emitExportStarFunction(undefined); + } + } + var exportedNamesStorageRef = makeUniqueName("exportedNames"); + writeLine(); + write("var " + exportedNamesStorageRef + " = {"); + increaseIndent(); + var started = false; + if (exportedDeclarations) { + for (var i = 0; i < exportedDeclarations.length; ++i) { + // write name of exported declaration, i.e 'export var x...' + writeExportedName(exportedDeclarations[i]); + } + } + if (exportSpecifiers) { + for (var n in exportSpecifiers) { + for (var _b = 0, _c = exportSpecifiers[n]; _b < _c.length; _b++) { + var specifier = _c[_b]; + // write name of export specified, i.e. 'export {x}' + writeExportedName(specifier.name); + } + } + } + for (var _d = 0; _d < externalImports.length; _d++) { + var externalImport = externalImports[_d]; + if (externalImport.kind !== 216 /* ExportDeclaration */) { + continue; + } + var exportDecl = externalImport; + if (!exportDecl.exportClause) { + // export * from ... + continue; + } + for (var _e = 0, _f = exportDecl.exportClause.elements; _e < _f.length; _e++) { + var element = _f[_e]; + // write name of indirectly exported entry, i.e. 'export {x} from ...' + writeExportedName(element.name || element.propertyName); + } + } + decreaseIndent(); + writeLine(); + write("};"); + return emitExportStarFunction(exportedNamesStorageRef); + function emitExportStarFunction(localNames) { + var exportStarFunction = makeUniqueName("exportStar"); + writeLine(); + // define an export star helper function + write("function " + exportStarFunction + "(m) {"); + increaseIndent(); + writeLine(); + write("for(var n in m) {"); + increaseIndent(); + writeLine(); + write("if (n !== \"default\""); + if (localNames) { + write("&& !" + localNames + ".hasOwnProperty(n)"); + } + write(") " + exportFunctionForFile + "(n, m[n]);"); + decreaseIndent(); + writeLine(); + write("}"); + decreaseIndent(); + writeLine(); + write("}"); + return exportStarFunction; + } + function writeExportedName(node) { + // do not record default exports + // they are local to module and never overwritten (explicitly skipped) by star export + if (node.kind !== 65 /* Identifier */ && node.flags & 256 /* Default */) { + return; + } + if (started) { + write(","); + } + else { + started = true; + } + writeLine(); + write("'"); + if (node.kind === 65 /* Identifier */) { + emitNodeWithoutSourceMap(node); + } + else { + emitDeclarationName(node); + } + write("': true"); + } + } + function processTopLevelVariableAndFunctionDeclarations(node) { + // per ES6 spec: + // 15.2.1.16.4 ModuleDeclarationInstantiation() Concrete Method + // - var declarations are initialized to undefined - 14.a.ii + // - function/generator declarations are instantiated - 16.a.iv + // this means that after module is instantiated but before its evaluation + // exported functions are already accessible at import sites + // in theory we should hoist only exported functions and its dependencies + // in practice to simplify things we'll hoist all source level functions and variable declaration + // including variables declarations for module and class declarations + var hoistedVars; + var hoistedFunctionDeclarations; + var exportedDeclarations; + visit(node); + if (hoistedVars) { + writeLine(); + write("var "); + for (var i = 0; i < hoistedVars.length; ++i) { + var local = hoistedVars[i]; + if (i !== 0) { + write(", "); + } + if (local.kind === 202 /* ClassDeclaration */ || local.kind === 206 /* ModuleDeclaration */) { + emitDeclarationName(local); + } + else { + emit(local); + } + var flags = ts.getCombinedNodeFlags(local.kind === 65 /* Identifier */ ? local.parent : local); + if (flags & 1 /* Export */) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(local); + } + } + write(";"); + } + if (hoistedFunctionDeclarations) { + for (var _a = 0; _a < hoistedFunctionDeclarations.length; _a++) { + var f = hoistedFunctionDeclarations[_a]; + writeLine(); + emit(f); + if (f.flags & 1 /* Export */) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(f); + } + } + } + return exportedDeclarations; + function visit(node) { + if (node.kind === 201 /* FunctionDeclaration */) { + if (!hoistedFunctionDeclarations) { + hoistedFunctionDeclarations = []; + } + hoistedFunctionDeclarations.push(node); + return; + } + if (node.kind === 202 /* ClassDeclaration */) { + // TODO: rename block scoped classes + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 206 /* ModuleDeclaration */ && shouldEmitModuleDeclaration(node)) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 199 /* VariableDeclaration */ || node.kind === 153 /* BindingElement */) { + if (shouldHoistVariable(node, false)) { + var name_21 = node.name; + if (name_21.kind === 65 /* Identifier */) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(name_21); + } + else { + ts.forEachChild(name_21, visit); + } + } + return; + } + if (ts.isBindingPattern(node)) { + ts.forEach(node.elements, visit); + return; + } + if (!ts.isDeclaration(node)) { + ts.forEachChild(node, visit); + } + } + } + function shouldHoistVariable(node, checkIfSourceFileLevelDecl) { + if (checkIfSourceFileLevelDecl && !shouldHoistDeclarationInSystemJsModule(node)) { + return false; + } + // hoist variable if + // - it is not block scoped + // - it is top level block scoped + // 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) & 12288 /* BlockScoped */) === 0 || + ts.getEnclosingBlockScopeContainer(node).kind === 228 /* SourceFile */; + } + function isCurrentFileSystemExternalModule() { + return compilerOptions.module === 4 /* System */ && ts.isExternalModule(currentSourceFile); + } + function emitSystemModuleBody(node, startIndex) { + // shape of the body in system modules: + // function (exports) { + // + // + // + // return { + // setters: [ + // + // ], + // execute: function() { + // + // } + // } + // + // } + // I.e: + // import {x} from 'file1' + // var y = 1; + // export function foo() { return y + x(); } + // console.log(y); + // will be transformed to + // function(exports) { + // var file1; // local alias + // var y; + // function foo() { return y + file1.x(); } + // exports("foo", foo); + // return { + // setters: [ + // function(v) { file1 = v } + // ], + // execute(): function() { + // y = 1; + // console.log(y); + // } + // }; + // } + emitVariableDeclarationsForImports(); + writeLine(); + var exportedDeclarations = processTopLevelVariableAndFunctionDeclarations(node); + var exportStarFunction = emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations); + writeLine(); + write("return {"); + increaseIndent(); + writeLine(); + emitSetters(exportStarFunction); + writeLine(); + emitExecute(node, startIndex); + emitTempDeclarations(true); + decreaseIndent(); + writeLine(); + write("}"); // return + } + function emitSetters(exportStarFunction) { + write("setters:["); + for (var i = 0; i < externalImports.length; ++i) { + if (i !== 0) { + write(","); + } + writeLine(); + increaseIndent(); + var importNode = externalImports[i]; + var importVariableName = getLocalNameForExternalImport(importNode) || ""; + var parameterName = "_" + importVariableName; + write("function (" + parameterName + ") {"); + switch (importNode.kind) { + case 210 /* ImportDeclaration */: + if (!importNode.importClause) { + // 'import "..."' case + // module is imported only for side-effects, setter body will be empty + break; + } + // fall-through + case 209 /* ImportEqualsDeclaration */: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + writeLine(); + // save import into the local + write(importVariableName + " = " + parameterName + ";"); + writeLine(); + var defaultName = importNode.kind === 210 /* ImportDeclaration */ + ? importNode.importClause.name + : importNode.name; + if (defaultName) { + // emit re-export for imported default name + // import n1 from 'foo1' + // import n2 = require('foo2') + // export {n1} + // export {n2} + emitExportMemberAssignments(defaultName); + writeLine(); + } + if (importNode.kind === 210 /* ImportDeclaration */ && + importNode.importClause.namedBindings) { + var namedBindings = importNode.importClause.namedBindings; + if (namedBindings.kind === 212 /* NamespaceImport */) { + // emit re-export for namespace + // import * as n from 'foo' + // export {n} + emitExportMemberAssignments(namedBindings.name); + writeLine(); + } + else { + // emit re-exports for named imports + // import {a, b} from 'foo' + // export {a, b as c} + for (var _a = 0, _b = namedBindings.elements; _a < _b.length; _a++) { + var element = _b[_a]; + emitExportMemberAssignments(element.name || element.propertyName); + writeLine(); + } + } + } + decreaseIndent(); + break; + case 216 /* ExportDeclaration */: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + if (importNode.exportClause) { + // export {a, b as c} from 'foo' + // emit as: + // exports('a', _foo["a"]) + // exports('c', _foo["b"]) + for (var _c = 0, _d = importNode.exportClause.elements; _c < _d.length; _c++) { + var e = _d[_c]; + writeLine(); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(e.name); + write("\", " + parameterName + "[\""); + emitNodeWithoutSourceMap(e.propertyName || e.name); + write("\"]);"); + } + } + else { + writeLine(); + // export * from 'foo' + // emit as: + // exportStar(_foo); + write(exportStarFunction + "(" + parameterName + ");"); + } + writeLine(); + decreaseIndent(); + break; + } + write("}"); + decreaseIndent(); + } + write("],"); + } + function emitExecute(node, startIndex) { + write("execute: function() {"); + increaseIndent(); + writeLine(); + for (var i = startIndex; i < node.statements.length; ++i) { + var statement = node.statements[i]; + // - imports/exports are not emitted for system modules + // - function declarations are not emitted because they were already hoisted + switch (statement.kind) { + case 216 /* ExportDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 201 /* FunctionDeclaration */: + continue; + } + writeLine(); + emit(statement); + } + decreaseIndent(); + writeLine(); + write("}"); // execute + } + function emitSystemModule(node, startIndex) { collectExternalModuleInfo(node); + // System modules has the following shape + // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) + // 'exports' here is a function 'exports(name: string, value: T): T' that is used to publish exported values. + // 'exports' returns its 'value' argument so in most cases expressions + // that mutate exported values can be rewritten as: + // expr -> exports('name', expr). + // The only exception in this rule is postfix unary operators, + // see comment to 'emitPostfixUnaryExpression' for more details + ts.Debug.assert(!exportFunctionForFile); + // make sure that name of 'exports' function does not conflict with existing identifiers + exportFunctionForFile = makeUniqueName("exports"); + write("System.register(["); + for (var i = 0; i < externalImports.length; ++i) { + var text = getExternalModuleNameText(externalImports[i]); + if (i !== 0) { + write(", "); + } + write(text); + } + write("], function(" + exportFunctionForFile + ") {"); + writeLine(); + increaseIndent(); + emitCaptureThisForNodeIfNecessary(node); + emitSystemModuleBody(node, startIndex); + decreaseIndent(); + writeLine(); + write("});"); + } + function emitAMDDependencies(node, includeNonAmdDependencies) { // An AMD define function has the following shape: // define(id?, dependencies?, factory); // // This has the shape of // define(name, ["module1", "module2"], function (module1Alias) { - // The location of the alias in the parameter list in the factory function needs to + // The location of the alias in the parameter list in the factory function needs to // match the position of the module name in the dependency list. // - // To ensure this is true in cases of modules with no aliases, e.g.: - // `import "module"` or `` + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` // we need to add modules without alias names to the end of the dependencies list - var aliasedModuleNames = []; // names of modules with corresponding parameter in the + var aliasedModuleNames = []; // names of modules with corresponding parameter in the // factory function. var unaliasedModuleNames = []; // names of modules with no corresponding parameters in // factory function. var importAliasNames = []; // names of the parameters in the factory function; these - // paramters need to match the indexes of the corresponding + // parameters need to match the indexes of the corresponding // module names in aliasedModuleNames. // Fill in amd-dependency tags for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { @@ -28182,21 +29039,10 @@ var ts; for (var _c = 0; _c < externalImports.length; _c++) { var importNode = externalImports[_c]; // Find the name of the external module - var externalModuleName = ""; - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8 /* StringLiteral */) { - externalModuleName = getLiteralText(moduleName); - } - // Find the name of the module alais, if there is one - var importAliasName = void 0; - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); - } - else { - importAliasName = getGeneratedNameForNode(importNode); - } - if (importAliasName) { + var externalModuleName = getExternalModuleNameText(importNode); + // Find the name of the module alias, if there is one + var importAliasName = getLocalNameForExternalImport(importNode); + if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); importAliasNames.push(importAliasName); } @@ -28204,11 +29050,6 @@ var ts; unaliasedModuleNames.push(externalModuleName); } } - writeLine(); - write("define("); - if (node.amdModuleName) { - write("\"" + node.amdModuleName + "\", "); - } write("[\"require\", \"exports\""); if (aliasedModuleNames.length) { write(", "); @@ -28223,6 +29064,15 @@ var ts; write(", "); write(importAliasNames.join(", ")); } + } + function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); + writeLine(); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + emitAMDDependencies(node, true); write(") {"); increaseIndent(); emitExportStarHelper(); @@ -28242,6 +29092,22 @@ var ts; emitTempDeclarations(true); emitExportEquals(false); } + function emitUMDModule(node, startIndex) { + collectExternalModuleInfo(node); + // Module is detected first to support Browserify users that load into a browser with an AMD loader + writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})("); + emitAMDDependencies(node, false); + write(") {"); + increaseIndent(); + emitExportStarHelper(); + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + emitExportEquals(true); + decreaseIndent(); + writeLine(); + write("});"); + } function emitES6Module(node, startIndex) { externalImports = undefined; exportSpecifiers = undefined; @@ -28294,30 +29160,39 @@ var ts; emitDetachedComments(node); // emit prologue directives prior to __extends var startIndex = emitDirectivePrologues(node.statements, false); - // 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 */)) { - writeLines(extendsHelper); - extendsEmitted = true; - } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { - writeLines(decorateHelper); - if (compilerOptions.emitDecoratorMetadata) { - writeLines(metadataHelper); + // Only emit helpers if the user did not say otherwise. + 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 */)) { + writeLines(extendsHelper); + extendsEmitted = true; + } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } + decorateEmitted = true; + } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { + writeLines(paramHelper); + paramEmitted = true; } - decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { - writeLines(paramHelper); - paramEmitted = true; - } - if (ts.isExternalModule(node)) { + if (ts.isExternalModule(node) || compilerOptions.separateCompilation) { if (languageVersion >= 2 /* ES6 */) { emitES6Module(node, startIndex); } else if (compilerOptions.module === 2 /* AMD */) { emitAMDModule(node, startIndex); } + else if (compilerOptions.module === 4 /* System */) { + emitSystemModule(node, startIndex); + } + else if (compilerOptions.module === 3 /* UMD */) { + emitUMDModule(node, startIndex); + } else { emitCommonJSModule(node, startIndex); } @@ -28333,86 +29208,18 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - /** - * The standard function to emit on any Node. - * This will take care of leading/trailing comments, and sourcemaps if applicable. - */ - function emit(node) { - emitNodeWorker(node, true, true); - } - /** - * A function to be called in the case where sourcemaps should not be tracked for a single node. - * This will still take care of leading/trailing comments. - * - * Note, however, that sourcemap tracking may resume for child nodes within the given - * node depending on the specifics of how the given node will be emitted. - * - * For instance, if this function is called with the node 'a + b', then we will not track - * the sourcemap for 'a + b' itself, but if 'emit' is called instead for nodes 'a' and 'b', - * then both 'a' and 'b' will have sourcemaps recorded if appropriate. - */ - function emitWithoutSourceMap(node) { - emitNodeWorker(node, false, true); - } - /** - * Emits a node with comments and tracks sourcemaps for said node, disallowing the renaming - * of identifiers to be *for this node*. - * - * This is useful in scenarios when a name's usage can be non-local and it is not feasible to - * rename it (e.g. the declaration name of a property for a shorthand property). - * - * Note that preventing generated identifier renaming only applies if the given node is an - * identifier. If it is not an identifier, contained identifiers may still be replaced - * by their generated counterparts. - * - * For instance, given an the computed property '[a + b]' from below : - * var x = { - * [a + b]() { - * } - * } - * Both 'a' and 'b' may be replaced by generated counterparts in '[a + b]'. - */ - function emitVerbatimDeclarationName(node) { - emitNodeWorker(node, true, false); - } - /** - * Do not call this function directly. - * - * This function acts as a common path to 'emit' and 'emitNodeWithoutSourceMap' - * that is aware of ordering between comments and sourcemap spans. - */ - function emitNodeWorker(node, shouldEmitSourceMap, allowGeneratedIdentifiers) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2 /* Ambient */) { - emitOnlyPinnedOrTripleSlashComments(node); - return; - } - // Emitting on a SourceFile is a special case; there is not necessarily - // a corresponding start/end we're interested in, and comments will be - // emitted for the end-of-file - if (node.kind === 227 /* SourceFile */) { - if (shouldEmitSourceMap) { - emitSourceFileStart(node); - } - emitBareNode(node, allowGeneratedIdentifiers); - return; + return emitOnlyPinnedOrTripleSlashComments(node); } var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } - // Only track sourcemaps on *parsed* nodes when requested. - // Synthesized nodes do not correspond to text in the original source. - if (shouldEmitSourceMap && !ts.nodeIsSynthesized(node)) { - emitStart(node); - emitBareNode(node, allowGeneratedIdentifiers); - emitEnd(node); - } - else { - emitBareNode(node, allowGeneratedIdentifiers); - } + emitJavaScriptWorker(node, allowGeneratedIdentifiers); if (emitComments) { emitTrailingComments(node); } @@ -28421,19 +29228,18 @@ var ts; 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 202 /* InterfaceDeclaration */: - case 209 /* ImportDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 214 /* ExportAssignment */: + case 203 /* InterfaceDeclaration */: + case 201 /* FunctionDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 215 /* ExportAssignment */: return false; - case 200 /* FunctionDeclaration */: - return !!node.body; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); @@ -28442,9 +29248,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 !== 179 /* Block */ && + if (node.kind !== 180 /* Block */ && node.parent && - node.parent.kind === 163 /* ArrowFunction */ && + node.parent.kind === 164 /* ArrowFunction */ && node.parent.body === node && compilerOptions.target <= 1 /* ES5 */) { return false; @@ -28452,21 +29258,19 @@ var ts; // Emit comments for everything else. return true; } - /** - * Emits a node without emitting comments or tracking sourcemap information. - */ - function emitBareNode(node, allowGeneratedIdentifiers) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } // Check if the node can be emitted regardless of the ScriptTarget switch (node.kind) { case 65 /* Identifier */: return emitIdentifier(node, allowGeneratedIdentifiers); - case 129 /* Parameter */: + case 130 /* Parameter */: return emitParameter(node); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return emitMethod(node); - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return emitAccessor(node); case 93 /* ThisKeyword */: return emitThis(node); @@ -28486,140 +29290,140 @@ var ts; case 12 /* TemplateMiddle */: case 13 /* TemplateTail */: return emitLiteral(node); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: return emitTemplateExpression(node); - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return emitTemplateSpan(node); - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: return emitQualifiedName(node); - case 150 /* ObjectBindingPattern */: + case 151 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 151 /* ArrayBindingPattern */: + case 152 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 152 /* BindingElement */: + case 153 /* BindingElement */: return emitBindingElement(node); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 224 /* PropertyAssignment */: + case 225 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 225 /* ShorthandPropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 155 /* PropertyAccessExpression */: + case 156 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 157 /* CallExpression */: + case 158 /* CallExpression */: return emitCallExpression(node); - case 158 /* NewExpression */: + case 159 /* NewExpression */: return emitNewExpression(node); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return emit(node.expression); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return emitParenExpression(node); - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 164 /* DeleteExpression */: + case 165 /* DeleteExpression */: return emitDeleteExpression(node); - case 165 /* TypeOfExpression */: + case 166 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 166 /* VoidExpression */: + case 167 /* VoidExpression */: return emitVoidExpression(node); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 168 /* PostfixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return emitBinaryExpression(node); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return emitConditionalExpression(node); - case 173 /* SpreadElementExpression */: + case 174 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 172 /* YieldExpression */: + case 173 /* YieldExpression */: return emitYieldExpression(node); - case 175 /* OmittedExpression */: + case 176 /* OmittedExpression */: return; - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return emitBlock(node); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return emitVariableStatement(node); - case 181 /* EmptyStatement */: + case 182 /* EmptyStatement */: return write(";"); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return emitExpressionStatement(node); - case 183 /* IfStatement */: + case 184 /* IfStatement */: return emitIfStatement(node); - case 184 /* DoStatement */: + case 185 /* DoStatement */: return emitDoStatement(node); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: return emitWhileStatement(node); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return emitForStatement(node); - case 188 /* ForOfStatement */: - case 187 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 188 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return emitReturnStatement(node); - case 192 /* WithStatement */: + case 193 /* WithStatement */: return emitWithStatement(node); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return emitSwitchStatement(node); - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return emitLabelledStatement(node); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: return emitThrowStatement(node); - case 196 /* TryStatement */: + case 197 /* TryStatement */: return emitTryStatement(node); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return emitCatchClause(node); - case 197 /* DebuggerStatement */: + case 198 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: return emitClassExpression(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return emitClassDeclaration(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return emitEnumMember(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return emitImportDeclaration(node); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return emitExportDeclaration(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return emitExportAssignment(node); - case 227 /* SourceFile */: + case 228 /* SourceFile */: return emitSourceFileNode(node); } } function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; + return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -28642,7 +29446,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 === 227 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 228 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); @@ -28657,7 +29461,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 === 227 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 228 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } @@ -28720,13 +29524,13 @@ var ts; // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { // Valid detachedComments ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } @@ -28767,7 +29571,9 @@ var ts; /* @internal */ ts.ioReadTime = 0; /* @internal */ ts.ioWriteTime = 0; /** The version of the TypeScript compiler release */ - ts.version = "1.5.0-beta"; + ts.version = "1.5.0"; + var carriageReturnLineFeed = "\r\n"; + var lineFeed = "\n"; function findConfigFile(searchPath) { var fileName = "tsconfig.json"; while (true) { @@ -28841,6 +29647,9 @@ var ts; } } } + var newLine = options.newLine === 0 /* CarriageReturnLineFeed */ ? carriageReturnLineFeed : + options.newLine === 1 /* LineFeed */ ? lineFeed : + ts.sys.newLine; return { getSourceFile: getSourceFile, getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, @@ -28848,14 +29657,14 @@ var ts; getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { return newLine; } }; } ts.createCompilerHost = createCompilerHost; - function getPreEmitDiagnostics(program) { - var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + function getPreEmitDiagnostics(program, sourceFile) { + var diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics()); + diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -29103,7 +29912,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */ || node.kind === 215 /* ExportDeclaration */) { + if (node.kind === 210 /* ImportDeclaration */ || node.kind === 209 /* ImportEqualsDeclaration */ || node.kind === 216 /* ExportDeclaration */) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8 /* StringLiteral */) { var moduleNameText = moduleNameExpr.text; @@ -29123,7 +29932,7 @@ var ts; } } } - else if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { + else if (node.kind === 206 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { // TypeScript 1.0 spec (April 2014): 12.1.6 // An AmbientExternalModuleDeclaration declares an external module. // This type of declaration is permitted only in the global module. @@ -29218,6 +30027,22 @@ var ts; diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); } } + if (options.inlineSourceMap) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.mapRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.sourceRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + } + if (options.inlineSources) { + if (!options.sourceMap && !options.inlineSourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); + } + } if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { @@ -29237,17 +30062,17 @@ var ts; var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided)); } } else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); } // Cannot specify module gen target when in es6 or above if (options.module && languageVersion >= 2 /* ES6 */) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher)); } // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted @@ -29314,6 +30139,14 @@ var ts; type: "boolean", description: ts.Diagnostics.Print_this_message }, + { + name: "inlineSourceMap", + type: "boolean" + }, + { + name: "inlineSources", + type: "boolean" + }, { name: "listFiles", type: "boolean" @@ -29334,17 +30167,33 @@ var ts; shortName: "m", type: { "commonjs": 1 /* CommonJS */, - "amd": 2 /* AMD */ + "amd": 2 /* AMD */, + "system": 4 /* System */, + "umd": 3 /* UMD */ }, - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd, paramType: ts.Diagnostics.KIND, - error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd + error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd + }, + { + name: "newLine", + type: { + "crlf": 0 /* CarriageReturnLineFeed */, + "lf": 1 /* LineFeed */ + }, + description: ts.Diagnostics.Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + paramType: ts.Diagnostics.NEWLINE, + error: ts.Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF }, { name: "noEmit", type: "boolean", description: ts.Diagnostics.Do_not_emit_outputs }, + { + name: "noEmitHelpers", + type: "boolean" + }, { name: "noEmitOnError", type: "boolean", @@ -29434,7 +30283,7 @@ var ts; type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 + error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 }, { name: "version", @@ -29565,19 +30414,34 @@ var ts; function readConfigFile(fileName) { try { var text = ts.sys.readFile(fileName); - return /\S/.test(text) ? JSON.parse(text) : {}; } catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; } + return parseConfigFileText(fileName, text); } ts.readConfigFile = readConfigFile; + /** + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ + function parseConfigFileText(fileName, jsonText) { + try { + return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} }; + } + catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; + } + } + ts.parseConfigFileText = parseConfigFileText; /** * Parse the contents of a config file (tsconfig.json). * @param json The contents of the config file to parse * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseConfigFile(json, basePath) { + function parseConfigFile(json, host, basePath) { var errors = []; return { options: getCompilerOptions(), @@ -29633,7 +30497,7 @@ var ts; } } else { - var sysFiles = ts.sys.readDirectory(basePath, ".ts"); + var sysFiles = host.readDirectory(basePath, ".ts"); for (var i = 0; i < sysFiles.length; i++) { var name = sysFiles[i]; if (!ts.fileExtensionIs(name, ".d.ts") || !ts.contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) { @@ -29718,7 +30582,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 163 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 164 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -29730,7 +30594,7 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 179 /* Block */: + case 180 /* Block */: if (!ts.isFunctionBlock(n)) { var parent_6 = n.parent; var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); @@ -29738,18 +30602,18 @@ var ts; // 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_6.kind === 184 /* DoStatement */ || - parent_6.kind === 187 /* ForInStatement */ || - parent_6.kind === 188 /* ForOfStatement */ || - parent_6.kind === 186 /* ForStatement */ || - parent_6.kind === 183 /* IfStatement */ || - parent_6.kind === 185 /* WhileStatement */ || - parent_6.kind === 192 /* WithStatement */ || - parent_6.kind === 223 /* CatchClause */) { + if (parent_6.kind === 185 /* DoStatement */ || + parent_6.kind === 188 /* ForInStatement */ || + parent_6.kind === 189 /* ForOfStatement */ || + parent_6.kind === 187 /* ForStatement */ || + parent_6.kind === 184 /* IfStatement */ || + parent_6.kind === 186 /* WhileStatement */ || + parent_6.kind === 193 /* WithStatement */ || + parent_6.kind === 224 /* CatchClause */) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_6.kind === 196 /* TryStatement */) { + if (parent_6.kind === 197 /* TryStatement */) { // Could be the try-block, or the finally-block. var tryStatement = parent_6; if (tryStatement.tryBlock === n) { @@ -29776,23 +30640,23 @@ var ts; break; } // Fallthrough. - case 206 /* ModuleBlock */: { + case 207 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 154 /* ObjectLiteralExpression */: - case 207 /* CaseBlock */: { + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 155 /* ObjectLiteralExpression */: + case 208 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 18 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -29820,12 +30684,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_21 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_21); + for (var name_22 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_22); 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_21); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_22); if (!matches) { continue; } @@ -29838,14 +30702,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_21); + matches = patternMatcher.getMatches(containers, name_22); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_22, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -29883,7 +30747,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 127 /* ComputedPropertyName */) { + else if (declaration.name.kind === 128 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -29904,7 +30768,7 @@ var ts; } return true; } - if (expression.kind === 155 /* PropertyAccessExpression */) { + if (expression.kind === 156 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -29917,7 +30781,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 === 127 /* ComputedPropertyName */) { + if (declaration.name.kind === 128 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -29993,17 +30857,17 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* 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 === 205 /* ModuleDeclaration */); + } while (current.kind === 206 /* ModuleDeclaration */); // fall through - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 202 /* InterfaceDeclaration */: - case 200 /* FunctionDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 203 /* InterfaceDeclaration */: + case 201 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -30014,21 +30878,21 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 215 /* ExportDeclaration */: + case 216 /* 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 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -30040,7 +30904,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 212 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -30049,21 +30913,21 @@ var ts; } } break; - case 152 /* BindingElement */: - case 198 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 199 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } // Fall through - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 200 /* FunctionDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 201 /* FunctionDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: childNodes.push(node); break; } @@ -30111,17 +30975,17 @@ var ts; for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 203 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -30132,12 +30996,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 200 /* FunctionDeclaration */) { + if (functionDeclaration.kind === 201 /* FunctionDeclaration */) { // A function declaration is 'top level' if it contains any function declarations // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 179 /* Block */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 180 /* Block */) { // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 201 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } // Or if it is not parented by another function. i.e all functions @@ -30197,7 +31061,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 129 /* Parameter */: + case 130 /* Parameter */: if (ts.isBindingPattern(node.name)) { break; } @@ -30205,36 +31069,36 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 137 /* SetAccessor */: + case 138 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 138 /* CallSignature */: + case 139 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: var variableDeclarationNode; - var name_22; - if (node.kind === 152 /* BindingElement */) { - name_22 = node.name; + var name_23; + if (node.kind === 153 /* BindingElement */) { + name_23 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 198 /* VariableDeclaration */) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 199 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -30242,24 +31106,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_22 = node.name; + name_23 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.variableElement); } - case 135 /* Constructor */: + case 136 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 217 /* ExportSpecifier */: - case 213 /* ImportSpecifier */: - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: + case 218 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -30289,17 +31153,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: return createSourceFileItem(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return createClassItem(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return createEnumItem(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return createModuleItem(node); - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -30311,7 +31175,7 @@ var ts; // 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 === 205 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 206 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -30323,7 +31187,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 === 179 /* Block */) { + if (node.body && node.body.kind === 180 /* 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)); } @@ -30344,7 +31208,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 135 /* Constructor */ && member; + return member.kind === 136 /* 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 @@ -30368,7 +31232,7 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127 /* ComputedPropertyName */; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 128 /* ComputedPropertyName */; }); } /** * Like removeComputedProperties, but retains the properties with well known symbol names @@ -30377,13 +31241,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 205 /* ModuleDeclaration */) { + while (node.body.kind === 206 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 227 /* SourceFile */ + return node.kind === 228 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -31178,7 +32042,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 157 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 158 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -31186,7 +32050,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 65 /* Identifier */ ? expression - : expression.kind === 155 /* PropertyAccessExpression */ + : expression.kind === 156 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -31219,7 +32083,7 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 157 /* CallExpression */ || node.parent.kind === 158 /* NewExpression */) { + if (node.parent.kind === 158 /* CallExpression */ || node.parent.kind === 159 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: // 1. The token introduces a list, and should begin a sig help session @@ -31272,25 +32136,25 @@ var ts; }; } } - else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 159 /* TaggedTemplateExpression */) { + else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 160 /* 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, 0); } } - else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 159 /* TaggedTemplateExpression */) { + else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 160 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 172 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 176 /* TemplateSpan */ && node.parent.parent.parent.kind === 159 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 178 /* TemplateSpan */ && node.parent.parent.parent.kind === 160 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 172 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 13 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -31408,7 +32272,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 === 171 /* TemplateExpression */) { + if (template.kind === 172 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -31417,7 +32281,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 227 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 228 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -31618,40 +32482,40 @@ var ts; return false; } switch (n.kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 154 /* ObjectLiteralExpression */: - case 150 /* ObjectBindingPattern */: - case 145 /* TypeLiteral */: - case 179 /* Block */: - case 206 /* ModuleBlock */: - case 207 /* CaseBlock */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 155 /* ObjectLiteralExpression */: + case 151 /* ObjectBindingPattern */: + case 146 /* TypeLiteral */: + case 180 /* Block */: + case 207 /* ModuleBlock */: + case 208 /* CaseBlock */: return nodeEndsWith(n, 15 /* CloseBraceToken */, sourceFile); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 158 /* NewExpression */: + case 159 /* NewExpression */: if (!n.arguments) { return true; } // fall through - case 157 /* CallExpression */: - case 161 /* ParenthesizedExpression */: - case 149 /* ParenthesizedType */: + case 158 /* CallExpression */: + case 162 /* ParenthesizedExpression */: + case 150 /* ParenthesizedType */: return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 139 /* ConstructSignature */: - case 138 /* CallSignature */: - case 163 /* ArrowFunction */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 140 /* ConstructSignature */: + case 139 /* CallSignature */: + case 164 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -31661,63 +32525,63 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 17 /* CloseParenToken */, sourceFile); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 183 /* IfStatement */: + case 184 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 153 /* ArrayLiteralExpression */: - case 151 /* ArrayBindingPattern */: - case 156 /* ElementAccessExpression */: - case 127 /* ComputedPropertyName */: - case 147 /* TupleType */: + case 154 /* ArrayLiteralExpression */: + case 152 /* ArrayBindingPattern */: + case 157 /* ElementAccessExpression */: + case 128 /* ComputedPropertyName */: + case 148 /* TupleType */: return nodeEndsWith(n, 19 /* CloseBracketToken */, sourceFile); - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 185 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 186 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 184 /* DoStatement */: + case 185 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, 100 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 165 /* TypeOfExpression */: - case 164 /* DeleteExpression */: - case 166 /* VoidExpression */: - case 172 /* YieldExpression */: - case 173 /* SpreadElementExpression */: + case 166 /* TypeOfExpression */: + case 165 /* DeleteExpression */: + case 167 /* VoidExpression */: + case 173 /* YieldExpression */: + case 174 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -31731,7 +32595,7 @@ var ts; function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { - var last = children[children.length - 1]; + var last = ts.lastOrUndefined(children); if (last.kind === expectedLastToken) { return true; } @@ -31773,7 +32637,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 === 228 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 229 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -31907,7 +32771,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 227 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 228 /* 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. @@ -31951,17 +32815,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 141 /* TypeReference */ || node.kind === 157 /* CallExpression */) { + if (node.kind === 142 /* TypeReference */ || node.kind === 158 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 201 /* ClassDeclaration */ || node.kind === 202 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 202 /* ClassDeclaration */ || node.kind === 203 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 125 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 126 /* LastToken */; } ts.isToken = isToken; function isWord(kind) { @@ -32016,7 +32880,7 @@ var ts; var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 130 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -32225,7 +33089,7 @@ var ts; if (isStarted) { if (trailingTrivia) { ts.Debug.assert(trailingTrivia.length !== 0); - wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4 /* NewLineTrivia */; + wasNewLine = ts.lastOrUndefined(trailingTrivia).kind === 4 /* NewLineTrivia */; } else { wasNewLine = false; @@ -32718,7 +33582,7 @@ var ts; this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([96 /* TryKeyword */, 81 /* FinallyKeyword */]), 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 120 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 121 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); @@ -32726,9 +33590,9 @@ var ts; // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114 /* ConstructorKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // Use of module as a function call. e.g.: import m2 = module("m2"); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 118 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 119 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 120 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 118 /* NamespaceKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 121 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); @@ -32748,7 +33612,7 @@ var ts; // decorators this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 121 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ @@ -32838,9 +33702,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_23 in o) { - if (o[name_23] === rule) { - return name_23; + for (var name_24 in o) { + if (o[name_24] === rule) { + return name_24; } } throw new Error("Unknown rule"); @@ -32849,34 +33713,36 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 186 /* ForStatement */; + return context.contextNode.kind === 187 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 169 /* BinaryExpression */: - case 170 /* ConditionalExpression */: + case 170 /* BinaryExpression */: + case 171 /* ConditionalExpression */: return true; + // equals in binding elements: function foo([[x, y] = [1, 2]]) + case 153 /* BindingElement */: + // equals in type X = ... + case 204 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: // equal in p = 0; - case 129 /* Parameter */: - case 226 /* EnumMember */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 130 /* Parameter */: + case 227 /* EnumMember */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 187 /* ForInStatement */: + case 188 /* ForInStatement */: return context.currentTokenSpan.kind === 86 /* InKeyword */ || context.nextTokenSpan.kind === 86 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 188 /* ForOfStatement */: - return context.currentTokenSpan.kind === 125 /* OfKeyword */ || context.nextTokenSpan.kind === 125 /* OfKeyword */; - case 152 /* BindingElement */: - return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; + case 189 /* ForOfStatement */: + return context.currentTokenSpan.kind === 126 /* OfKeyword */ || context.nextTokenSpan.kind === 126 /* OfKeyword */; } return false; }; @@ -32884,7 +33750,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 170 /* ConditionalExpression */; + return context.contextNode.kind === 171 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -32928,31 +33794,31 @@ var ts; return true; } switch (node.kind) { - case 179 /* Block */: - case 207 /* CaseBlock */: - case 154 /* ObjectLiteralExpression */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 208 /* CaseBlock */: + case 155 /* ObjectLiteralExpression */: + case 207 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: //case SyntaxKind.MemberFunctionDeclaration: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: ///case SyntaxKind.MethodSignature: - case 138 /* CallSignature */: - case 162 /* FunctionExpression */: - case 135 /* Constructor */: - case 163 /* ArrowFunction */: + case 139 /* CallSignature */: + case 163 /* FunctionExpression */: + case 136 /* Constructor */: + case 164 /* ArrowFunction */: //case SyntaxKind.ConstructorDeclaration: //case SyntaxKind.SimpleArrowFunctionExpression: //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return true; } return false; @@ -32962,55 +33828,55 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 145 /* TypeLiteral */: - case 205 /* ModuleDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 146 /* TypeLiteral */: + case 206 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 201 /* ClassDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: - case 179 /* Block */: - case 223 /* CatchClause */: - case 206 /* ModuleBlock */: - case 193 /* SwitchStatement */: + case 202 /* ClassDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: + case 180 /* Block */: + case 224 /* CatchClause */: + case 207 /* ModuleBlock */: + case 194 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 183 /* IfStatement */: - case 193 /* SwitchStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 185 /* WhileStatement */: - case 196 /* TryStatement */: - case 184 /* DoStatement */: - case 192 /* WithStatement */: + case 184 /* IfStatement */: + case 194 /* SwitchStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 186 /* WhileStatement */: + case 197 /* TryStatement */: + case 185 /* DoStatement */: + case 193 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 223 /* CatchClause */: + case 224 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 154 /* ObjectLiteralExpression */; + return context.contextNode.kind === 155 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 157 /* CallExpression */; + return context.contextNode.kind === 158 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 158 /* NewExpression */; + return context.contextNode.kind === 159 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -33031,38 +33897,38 @@ var ts; while (ts.isExpression(node)) { node = node.parent; } - return node.kind === 130 /* Decorator */; + return node.kind === 131 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 199 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 200 /* 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 === 205 /* ModuleDeclaration */; + return context.contextNode.kind === 206 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 145 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 146 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { if (token.kind !== 24 /* LessThanToken */ && token.kind !== 25 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 141 /* TypeReference */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 142 /* TypeReference */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return true; default: return false; @@ -33073,7 +33939,7 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 166 /* VoidExpression */; + return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 167 /* VoidExpression */; }; return Rules; })(); @@ -33097,7 +33963,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 125 /* LastToken */ + 1; + this.mapRowLength = 126 /* 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); @@ -33292,7 +34158,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 125 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 126 /* LastToken */; token++) { result.push(token); } return result; @@ -33334,9 +34200,9 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 125 /* LastKeyword */); + TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 126 /* LastKeyword */); TokenRange.BinaryOperators = TokenRange.FromRange(24 /* FirstBinaryOperator */, 64 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 125 /* OfKeyword */]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 126 /* OfKeyword */]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38 /* PlusPlusToken */, 39 /* MinusMinusToken */, 47 /* TildeToken */, 46 /* ExclamationToken */]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7 /* NumericLiteral */, 65 /* Identifier */, 16 /* OpenParenToken */, 18 /* OpenBracketToken */, 14 /* OpenBraceToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); @@ -33344,7 +34210,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 119 /* NumberKeyword */, 121 /* StringKeyword */, 113 /* BooleanKeyword */, 122 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); + TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 120 /* NumberKeyword */, 122 /* StringKeyword */, 113 /* BooleanKeyword */, 123 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -33547,17 +34413,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 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 179 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 227 /* SourceFile */: - case 179 /* Block */: - case 206 /* ModuleBlock */: + return body && body.kind === 180 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 228 /* SourceFile */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -33682,6 +34548,8 @@ var ts; var previousRange; var previousParent; var previousRangeStartLine; + var lastIndentedLine; + var indentationOnLastIndentedLine; var edits = []; formattingScanner.advance(); if (formattingScanner.isOnToken()) { @@ -33728,9 +34596,9 @@ var ts; // - source file // - switch\default clauses if (isSomeBlock(parent.kind) || - parent.kind === 227 /* SourceFile */ || - parent.kind === 220 /* CaseClause */ || - parent.kind === 221 /* DefaultClause */) { + parent.kind === 228 /* SourceFile */ || + parent.kind === 221 /* CaseClause */ || + parent.kind === 222 /* DefaultClause */) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -33751,7 +34619,9 @@ var ts; // if node is located on the same line with the parent // - inherit indentation from the parent // - push children if either parent of node itself has non-zero delta - indentation = parentDynamicIndentation.getIndentation(); + indentation = startLine === lastIndentedLine + ? indentationOnLastIndentedLine + : parentDynamicIndentation.getIndentation(); delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { @@ -33764,19 +34634,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 201 /* ClassDeclaration */: return 69 /* ClassKeyword */; - case 202 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; - case 200 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; - case 204 /* EnumDeclaration */: return 204 /* EnumDeclaration */; - case 136 /* GetAccessor */: return 116 /* GetKeyword */; - case 137 /* SetAccessor */: return 120 /* SetKeyword */; - case 134 /* MethodDeclaration */: + case 202 /* ClassDeclaration */: return 69 /* ClassKeyword */; + case 203 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; + case 201 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; + case 205 /* EnumDeclaration */: return 205 /* EnumDeclaration */; + case 137 /* GetAccessor */: return 116 /* GetKeyword */; + case 138 /* SetAccessor */: return 121 /* SetKeyword */; + case 135 /* MethodDeclaration */: if (node.asteriskToken) { return 35 /* AsteriskToken */; } // fall-through - case 132 /* PropertyDeclaration */: - case 129 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 130 /* Parameter */: return node.name.kind; } } @@ -33909,7 +34779,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 130 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 131 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -33999,7 +34869,6 @@ var ts; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; } - var triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { case 3 /* MultiLineCommentTrivia */: var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); @@ -34023,6 +34892,8 @@ var ts; if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + lastIndentedLine = tokenStart.line; + indentationOnLastIndentedLine = tokenIndentation; } } formattingScanner.advance(); @@ -34231,20 +35102,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 135 /* Constructor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 163 /* ArrowFunction */: + case 136 /* Constructor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 164 /* ArrowFunction */: if (node.typeParameters === list) { return 24 /* LessThanToken */; } @@ -34252,8 +35123,8 @@ var ts; return 16 /* OpenParenToken */; } break; - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: if (node.typeArguments === list) { return 24 /* LessThanToken */; } @@ -34261,7 +35132,7 @@ var ts; return 16 /* OpenParenToken */; } break; - case 141 /* TypeReference */: + case 142 /* TypeReference */: if (node.typeArguments === list) { return 24 /* LessThanToken */; } @@ -34360,7 +35231,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 169 /* BinaryExpression */) { + if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 170 /* 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 */) { @@ -34471,7 +35342,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 === 227 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 228 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -34504,7 +35375,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 183 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 184 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 76 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -34516,23 +35387,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 141 /* TypeReference */: + case 142 /* TypeReference */: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return node.parent.properties; - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return node.parent.elements; - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: { + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -34543,8 +35414,8 @@ var ts; } break; } - case 158 /* NewExpression */: - case 157 /* CallExpression */: { + case 159 /* NewExpression */: + case 158 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -34623,28 +35494,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 153 /* ArrayLiteralExpression */: - case 179 /* Block */: - case 206 /* ModuleBlock */: - case 154 /* ObjectLiteralExpression */: - case 145 /* TypeLiteral */: - case 147 /* TupleType */: - case 207 /* CaseBlock */: - case 221 /* DefaultClause */: - case 220 /* CaseClause */: - case 161 /* ParenthesizedExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 180 /* VariableStatement */: - case 198 /* VariableDeclaration */: - case 214 /* ExportAssignment */: - case 191 /* ReturnStatement */: - case 170 /* ConditionalExpression */: - case 151 /* ArrayBindingPattern */: - case 150 /* ObjectBindingPattern */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 154 /* ArrayLiteralExpression */: + case 180 /* Block */: + case 207 /* ModuleBlock */: + case 155 /* ObjectLiteralExpression */: + case 146 /* TypeLiteral */: + case 148 /* TupleType */: + case 208 /* CaseBlock */: + case 222 /* DefaultClause */: + case 221 /* CaseClause */: + case 162 /* ParenthesizedExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 181 /* VariableStatement */: + case 199 /* VariableDeclaration */: + case 215 /* ExportAssignment */: + case 192 /* ReturnStatement */: + case 171 /* ConditionalExpression */: + case 152 /* ArrayBindingPattern */: + case 151 /* ObjectBindingPattern */: return true; } return false; @@ -34654,22 +35525,22 @@ var ts; return true; } switch (parent) { - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 186 /* ForStatement */: - case 183 /* IfStatement */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 138 /* CallSignature */: - case 163 /* ArrowFunction */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - return child !== 179 /* Block */; + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 187 /* ForStatement */: + case 184 /* IfStatement */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 139 /* CallSignature */: + case 164 /* ArrowFunction */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + return child !== 180 /* Block */; default: return false; } @@ -34679,7 +35550,7 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); /// -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -34774,7 +35645,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(228 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); + var list = createNode(229 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0; _i < nodes.length; _i++) { @@ -34793,7 +35664,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 126 /* FirstNode */) { + if (this.kind >= 127 /* FirstNode */) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -34838,7 +35709,7 @@ var ts; var children = this.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 126 /* FirstNode */) { + if (child.kind < 127 /* FirstNode */) { return child; } return child.getFirstToken(sourceFile); @@ -34848,7 +35719,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 126 /* FirstNode */) { + if (child.kind < 127 /* FirstNode */) { return child; } return child.getLastToken(sourceFile); @@ -34901,7 +35772,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 === 129 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 130 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -34910,15 +35781,15 @@ var ts; }); } // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 205 /* ModuleDeclaration */ && declaration.body.kind === 205 /* ModuleDeclaration */) { + if (declaration.kind === 206 /* ModuleDeclaration */ && declaration.body.kind === 206 /* ModuleDeclaration */) { return; } // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 205 /* ModuleDeclaration */ && declaration.parent.kind === 205 /* ModuleDeclaration */) { + while (declaration.kind === 206 /* ModuleDeclaration */ && declaration.parent.kind === 206 /* ModuleDeclaration */) { declaration = declaration.parent; } // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 199 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -35257,9 +36128,9 @@ var ts; if (result_2 !== undefined) { return result_2; } - if (declaration.name.kind === 127 /* ComputedPropertyName */) { + if (declaration.name.kind === 128 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 155 /* PropertyAccessExpression */) { + if (expr.kind === 156 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -35279,9 +36150,9 @@ var ts; } function visit(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -35301,60 +36172,60 @@ var ts; ts.forEachChild(node, visit); } break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: - case 205 /* ModuleDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 217 /* ExportSpecifier */: - case 213 /* ImportSpecifier */: - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 145 /* TypeLiteral */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* EnumDeclaration */: + case 206 /* ModuleDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 218 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 146 /* TypeLiteral */: addDeclaration(node); // fall through - case 135 /* Constructor */: - case 180 /* VariableStatement */: - case 199 /* VariableDeclarationList */: - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: - case 206 /* ModuleBlock */: + case 136 /* Constructor */: + case 181 /* VariableStatement */: + case 200 /* VariableDeclarationList */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: + case 207 /* ModuleBlock */: ts.forEachChild(node, visit); break; - case 179 /* Block */: + case 180 /* Block */: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 129 /* Parameter */: + case 130 /* Parameter */: // Only consider properties defined as constructor parameters if (!(node.flags & 112 /* AccessibilityModifier */)) { break; } // fall through - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 226 /* EnumMember */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 227 /* EnumMember */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: addDeclaration(node); break; - case 215 /* ExportDeclaration */: + case 216 /* 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 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -35366,7 +36237,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 212 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -35425,7 +36296,7 @@ var ts; })(ts.OutputFileType || (ts.OutputFileType = {})); var OutputFileType = ts.OutputFileType; (function (EndOfLineState) { - EndOfLineState[EndOfLineState["Start"] = 0] = "Start"; + EndOfLineState[EndOfLineState["None"] = 0] = "None"; EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; @@ -35527,10 +36398,31 @@ var ts; ClassificationTypeNames.interfaceName = "interface name"; ClassificationTypeNames.moduleName = "module name"; ClassificationTypeNames.typeParameterName = "type parameter name"; - ClassificationTypeNames.typeAlias = "type alias name"; + ClassificationTypeNames.typeAliasName = "type alias name"; + ClassificationTypeNames.parameterName = "parameter name"; return ClassificationTypeNames; })(); ts.ClassificationTypeNames = ClassificationTypeNames; + (function (ClassificationType) { + ClassificationType[ClassificationType["comment"] = 1] = "comment"; + ClassificationType[ClassificationType["identifier"] = 2] = "identifier"; + ClassificationType[ClassificationType["keyword"] = 3] = "keyword"; + ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType[ClassificationType["operator"] = 5] = "operator"; + ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType[ClassificationType["text"] = 9] = "text"; + ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation"; + ClassificationType[ClassificationType["className"] = 11] = "className"; + ClassificationType[ClassificationType["enumName"] = 12] = "enumName"; + ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName"; + ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName"; + ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; + })(ts.ClassificationType || (ts.ClassificationType = {})); + var ClassificationType = ts.ClassificationType; function displayPartsToString(displayParts) { if (displayParts) { return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); @@ -35544,16 +36436,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 162 /* FunctionExpression */) { + if (declaration.kind === 163 /* FunctionExpression */) { return true; } - if (declaration.kind !== 198 /* VariableDeclaration */ && declaration.kind !== 200 /* FunctionDeclaration */) { + if (declaration.kind !== 199 /* VariableDeclaration */ && declaration.kind !== 201 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { // Reached source file or module block - if (parent_7.kind === 227 /* SourceFile */ || parent_7.kind === 206 /* ModuleBlock */) { + if (parent_7.kind === 228 /* SourceFile */ || parent_7.kind === 207 /* ModuleBlock */) { return false; } } @@ -35905,7 +36797,7 @@ var ts; else { if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // import d from "mod"; @@ -35915,7 +36807,7 @@ var ts; } else if (token === 53 /* EqualsToken */) { token = scanner.scan(); - if (token === 118 /* RequireKeyword */) { + if (token === 119 /* RequireKeyword */) { token = scanner.scan(); if (token === 16 /* OpenParenToken */) { token = scanner.scan(); @@ -35944,7 +36836,7 @@ var ts; } if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // import {a as A} from "mod"; @@ -35960,7 +36852,7 @@ var ts; token = scanner.scan(); if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // import * as NS from "mod" @@ -35983,7 +36875,7 @@ var ts; } if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // export {a as A} from "mod"; @@ -35995,7 +36887,7 @@ var ts; } else if (token === 35 /* AsteriskToken */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // export * from "mod" @@ -36018,7 +36910,7 @@ var ts; /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 194 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 195 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -36027,12 +36919,12 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 65 /* Identifier */ && - (node.parent.kind === 190 /* BreakStatement */ || node.parent.kind === 189 /* ContinueStatement */) && + (node.parent.kind === 191 /* BreakStatement */ || node.parent.kind === 190 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 65 /* Identifier */ && - node.parent.kind === 194 /* LabeledStatement */ && + node.parent.kind === 195 /* LabeledStatement */ && node.parent.label === node; } /** @@ -36040,7 +36932,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 194 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 195 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -36051,25 +36943,25 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 159 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 205 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 206 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 65 /* Identifier */ && @@ -36078,22 +36970,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 === 65 /* Identifier */ || node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) && - (node.parent.kind === 224 /* PropertyAssignment */ || node.parent.kind === 225 /* ShorthandPropertyAssignment */) && node.parent.name === node; + (node.parent.kind === 225 /* PropertyAssignment */ || node.parent.kind === 226 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) { switch (node.parent.kind) { - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 226 /* EnumMember */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 205 /* ModuleDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 227 /* EnumMember */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 206 /* ModuleDeclaration */: return node.parent.name === node; - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } @@ -36152,7 +37044,7 @@ var ts; })(BreakContinueSearchType || (BreakContinueSearchType = {})); // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 66 /* FirstKeyword */; i <= 125 /* LastKeyword */; i++) { + for (var i = 66 /* FirstKeyword */; i <= 126 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -36167,17 +37059,17 @@ var ts; return undefined; } switch (node.kind) { - case 227 /* SourceFile */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 205 /* ModuleDeclaration */: + case 228 /* SourceFile */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 206 /* ModuleDeclaration */: return node; } } @@ -36185,38 +37077,38 @@ var ts; ts.getContainerNode = getContainerNode; /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 205 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 201 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 202 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 203 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 204 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 198 /* VariableDeclaration */: + case 206 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 202 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 203 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 204 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 205 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 199 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 200 /* FunctionDeclaration */: return ScriptElementKind.functionElement; - case 136 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; - case 137 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 201 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 137 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 138 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return ScriptElementKind.memberFunctionElement; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return ScriptElementKind.memberVariableElement; - case 140 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; - case 139 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; - case 138 /* CallSignature */: return ScriptElementKind.callSignatureElement; - case 135 /* Constructor */: return ScriptElementKind.constructorImplementationElement; - case 128 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 226 /* EnumMember */: return ScriptElementKind.variableElement; - case 129 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 208 /* ImportEqualsDeclaration */: - case 213 /* ImportSpecifier */: - case 210 /* ImportClause */: - case 217 /* ExportSpecifier */: - case 211 /* NamespaceImport */: + case 141 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 140 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 139 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 136 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 129 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 227 /* EnumMember */: return ScriptElementKind.variableElement; + case 130 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 209 /* ImportEqualsDeclaration */: + case 214 /* ImportSpecifier */: + case 211 /* ImportClause */: + case 218 /* ExportSpecifier */: + case 212 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -36417,44 +37309,44 @@ var ts; return false; } switch (node.kind) { - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 222 /* HeritageClause */: + case 223 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 102 /* ImplementsKeyword */) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 200 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -36462,20 +37354,20 @@ var ts; return true; } break; - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start = expression.typeArguments.pos; @@ -36483,7 +37375,7 @@ var ts; return true; } break; - case 129 /* Parameter */: + case 130 /* Parameter */: var parameter = node; if (parameter.modifiers) { var start = parameter.modifiers.pos; @@ -36499,17 +37391,17 @@ var ts; return true; } break; - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 160 /* TypeAssertionExpression */: + case 161 /* 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 130 /* Decorator */: + case 131 /* Decorator */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -36642,11 +37534,11 @@ var ts; // visible symbols in the scope, and the node is the current location. var node = currentToken; var isRightOfDot = false; - if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 155 /* PropertyAccessExpression */) { + if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 156 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 126 /* QualifiedName */) { + else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 127 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -36673,7 +37565,7 @@ var ts; // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */) { + if (node.kind === 65 /* Identifier */ || node.kind === 127 /* QualifiedName */ || node.kind === 156 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -36715,13 +37607,13 @@ var ts; symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(contextToken, 210 /* ImportClause */)) { + else if (ts.getAncestor(contextToken, 211 /* ImportClause */)) { // cursor is in import clause // try to show exported member for imported module isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(contextToken)) { - var importDeclaration = ts.getAncestor(contextToken, 209 /* ImportDeclaration */); + var importDeclaration = ts.getAncestor(contextToken, 210 /* ImportDeclaration */); ts.Debug.assert(importDeclaration !== undefined); var exports; if (importDeclaration.moduleSpecifier) { @@ -36800,7 +37692,7 @@ var ts; // import {| // import {a,| if (node.kind === 14 /* OpenBraceToken */ || node.kind === 23 /* CommaToken */) { - return node.parent.kind === 212 /* NamedImports */; + return node.parent.kind === 213 /* NamedImports */; } } return false; @@ -36810,35 +37702,36 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23 /* CommaToken */: - return containingNodeKind === 157 /* CallExpression */ // func( a, | - || containingNodeKind === 135 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion - || containingNodeKind === 158 /* NewExpression */ // new C(a, | - || containingNodeKind === 153 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 169 /* BinaryExpression */; // let x = (a, | + return containingNodeKind === 158 /* CallExpression */ // func( a, | + || containingNodeKind === 136 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion + || containingNodeKind === 159 /* NewExpression */ // new C(a, | + || containingNodeKind === 154 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 170 /* BinaryExpression */; // let x = (a, | case 16 /* OpenParenToken */: - return containingNodeKind === 157 /* CallExpression */ // func( | - || containingNodeKind === 135 /* Constructor */ // constructor( | - || containingNodeKind === 158 /* NewExpression */ // new C(a| - || containingNodeKind === 161 /* ParenthesizedExpression */; // let x = (a| + return containingNodeKind === 158 /* CallExpression */ // func( | + || containingNodeKind === 136 /* Constructor */ // constructor( | + || containingNodeKind === 159 /* NewExpression */ // new C(a| + || containingNodeKind === 162 /* ParenthesizedExpression */; // let x = (a| case 18 /* OpenBracketToken */: - return containingNodeKind === 153 /* ArrayLiteralExpression */; // [ | - case 117 /* ModuleKeyword */: + return containingNodeKind === 154 /* ArrayLiteralExpression */; // [ | + case 117 /* ModuleKeyword */: // module | + case 118 /* NamespaceKeyword */: return true; case 20 /* DotToken */: - return containingNodeKind === 205 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 206 /* ModuleDeclaration */; // module A.| case 14 /* OpenBraceToken */: - return containingNodeKind === 201 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 202 /* ClassDeclaration */; // class A{ | case 53 /* EqualsToken */: - return containingNodeKind === 198 /* VariableDeclaration */ // let x = a| - || containingNodeKind === 169 /* BinaryExpression */; // x = a| + return containingNodeKind === 199 /* VariableDeclaration */ // let x = a| + || containingNodeKind === 170 /* BinaryExpression */; // x = a| case 11 /* TemplateHead */: - return containingNodeKind === 171 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 172 /* TemplateExpression */; // `aa ${| case 12 /* TemplateMiddle */: - return containingNodeKind === 176 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 178 /* TemplateSpan */; // `aa ${10} dd ${| case 108 /* PublicKeyword */: case 106 /* PrivateKeyword */: case 107 /* ProtectedKeyword */: - return containingNodeKind === 132 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 133 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -36874,7 +37767,7 @@ var ts; switch (previousToken.kind) { case 14 /* OpenBraceToken */: // let x = { | case 23 /* CommaToken */: - if (parent_8 && parent_8.kind === 154 /* ObjectLiteralExpression */) { + if (parent_8 && parent_8.kind === 155 /* ObjectLiteralExpression */) { return parent_8; } break; @@ -36884,16 +37777,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: return true; } return false; @@ -36903,56 +37796,56 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23 /* CommaToken */: - return containingNodeKind === 198 /* VariableDeclaration */ || - containingNodeKind === 199 /* VariableDeclarationList */ || - containingNodeKind === 180 /* VariableStatement */ || - containingNodeKind === 204 /* EnumDeclaration */ || + return containingNodeKind === 199 /* VariableDeclaration */ || + containingNodeKind === 200 /* VariableDeclarationList */ || + containingNodeKind === 181 /* VariableStatement */ || + containingNodeKind === 205 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 201 /* ClassDeclaration */ || - containingNodeKind === 200 /* FunctionDeclaration */ || - containingNodeKind === 202 /* InterfaceDeclaration */ || - containingNodeKind === 151 /* ArrayBindingPattern */ || - containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x, y| + containingNodeKind === 202 /* ClassDeclaration */ || + containingNodeKind === 201 /* FunctionDeclaration */ || + containingNodeKind === 203 /* InterfaceDeclaration */ || + containingNodeKind === 152 /* ArrayBindingPattern */ || + containingNodeKind === 151 /* ObjectBindingPattern */; // function func({ x, y| case 20 /* DotToken */: - return containingNodeKind === 151 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 152 /* ArrayBindingPattern */; // var [.| case 18 /* OpenBracketToken */: - return containingNodeKind === 151 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 152 /* ArrayBindingPattern */; // var [x| case 16 /* OpenParenToken */: - return containingNodeKind === 223 /* CatchClause */ || + return containingNodeKind === 224 /* CatchClause */ || isFunction(containingNodeKind); case 14 /* OpenBraceToken */: - return containingNodeKind === 204 /* EnumDeclaration */ || - containingNodeKind === 202 /* InterfaceDeclaration */ || - containingNodeKind === 145 /* TypeLiteral */ || - containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x| + return containingNodeKind === 205 /* EnumDeclaration */ || + containingNodeKind === 203 /* InterfaceDeclaration */ || + containingNodeKind === 146 /* TypeLiteral */ || + containingNodeKind === 151 /* ObjectBindingPattern */; // function func({ x| case 22 /* SemicolonToken */: - return containingNodeKind === 131 /* PropertySignature */ && + return containingNodeKind === 132 /* PropertySignature */ && previousToken.parent && previousToken.parent.parent && - (previousToken.parent.parent.kind === 202 /* InterfaceDeclaration */ || - previousToken.parent.parent.kind === 145 /* TypeLiteral */); // let x : { a; | + (previousToken.parent.parent.kind === 203 /* InterfaceDeclaration */ || + previousToken.parent.parent.kind === 146 /* TypeLiteral */); // let x : { a; | case 24 /* LessThanToken */: - return containingNodeKind === 201 /* ClassDeclaration */ || - containingNodeKind === 200 /* FunctionDeclaration */ || - containingNodeKind === 202 /* InterfaceDeclaration */ || + return containingNodeKind === 202 /* ClassDeclaration */ || + containingNodeKind === 201 /* FunctionDeclaration */ || + containingNodeKind === 203 /* InterfaceDeclaration */ || isFunction(containingNodeKind); case 109 /* StaticKeyword */: - return containingNodeKind === 132 /* PropertyDeclaration */; + return containingNodeKind === 133 /* PropertyDeclaration */; case 21 /* DotDotDotToken */: - return containingNodeKind === 129 /* Parameter */ || - containingNodeKind === 135 /* Constructor */ || + return containingNodeKind === 130 /* Parameter */ || + containingNodeKind === 136 /* Constructor */ || (previousToken.parent && previousToken.parent.parent && - previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z| + previousToken.parent.parent.kind === 152 /* ArrayBindingPattern */); // var [ ...z| case 108 /* PublicKeyword */: case 106 /* PrivateKeyword */: case 107 /* ProtectedKeyword */: - return containingNodeKind === 129 /* Parameter */; + return containingNodeKind === 130 /* Parameter */; case 69 /* ClassKeyword */: case 77 /* EnumKeyword */: case 103 /* InterfaceKeyword */: case 83 /* FunctionKeyword */: case 98 /* VarKeyword */: case 116 /* GetKeyword */: - case 120 /* SetKeyword */: + case 121 /* SetKeyword */: case 85 /* ImportKeyword */: case 104 /* LetKeyword */: case 70 /* ConstKeyword */: @@ -36988,7 +37881,7 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 212 /* NamedImports */) { + importDeclaration.importClause.namedBindings.kind === 213 /* NamedImports */) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -37005,7 +37898,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 224 /* PropertyAssignment */ && m.kind !== 225 /* ShorthandPropertyAssignment */) { + if (m.kind !== 225 /* PropertyAssignment */ && m.kind !== 226 /* ShorthandPropertyAssignment */) { // Ignore omitted expressions for missing members in the object literal return; } @@ -37055,10 +37948,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameTable = getNameTable(sourceFile); - for (var name_24 in nameTable) { - if (!allNames[name_24]) { - allNames[name_24] = name_24; - var displayName = getCompletionEntryDisplayName(name_24, target, true); + for (var name_25 in nameTable) { + if (!allNames[name_25]) { + allNames[name_25] = name_25; + var displayName = getCompletionEntryDisplayName(name_25, target, true); if (displayName) { var entry = { name: displayName, @@ -37233,22 +38126,6 @@ var ts; } return ScriptElementKind.unknown; } - function getTypeKind(type) { - var flags = type.getFlags(); - if (flags & 128 /* Enum */) - return ScriptElementKind.enumElement; - if (flags & 1024 /* Class */) - return ScriptElementKind.classElement; - if (flags & 2048 /* Interface */) - return ScriptElementKind.interfaceElement; - if (flags & 512 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - if (flags & 1048703 /* Intrinsic */) - return ScriptElementKind.primitiveType; - if (flags & 256 /* StringLiteral */) - return ScriptElementKind.primitiveType; - return ScriptElementKind.unknown; - } function getSymbolModifiers(symbol) { return symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) @@ -37273,7 +38150,7 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 155 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 156 /* 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)) { @@ -37282,7 +38159,7 @@ var ts; } // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 157 /* CallExpression */ || location.kind === 158 /* NewExpression */) { + if (location.kind === 158 /* CallExpression */ || location.kind === 159 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -37295,7 +38172,7 @@ var ts; // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 158 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 159 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { // Get the first signature if there @@ -37347,24 +38224,24 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 135 /* Constructor */)) { + (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 136 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 135 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 136 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 135 /* Constructor */) { + if (functionDeclaration.kind === 136 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 139 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -37387,7 +38264,7 @@ var ts; } if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(123 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(124 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); @@ -37407,7 +38284,9 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(117 /* ModuleKeyword */)); + var declaration = ts.getDeclarationOfKind(symbol, 206 /* ModuleDeclaration */); + var isNamespace = declaration && declaration.name && declaration.name.kind === 65 /* Identifier */; + displayParts.push(ts.keywordPart(isNamespace ? 118 /* NamespaceKeyword */ : 117 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -37428,13 +38307,13 @@ var ts; } else { // Method/function type parameter - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).parent; + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 129 /* TypeParameter */).parent; var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 139 /* ConstructSignature */) { + if (signatureDeclaration.kind === 140 /* ConstructSignature */) { displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 138 /* CallSignature */ && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 139 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -37443,7 +38322,7 @@ var ts; if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 226 /* EnumMember */) { + if (declaration.kind === 227 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -37459,13 +38338,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 208 /* ImportEqualsDeclaration */) { + if (declaration.kind === 209 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(118 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(119 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); @@ -37592,8 +38471,8 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 65 /* Identifier */: - case 155 /* PropertyAccessExpression */: - case 126 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: case 93 /* ThisKeyword */: case 91 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position @@ -37629,6 +38508,62 @@ var ts; containerName: containerName }; } + function getDefinitionFromSymbol(symbol, node) { + var typeChecker = program.getTypeChecker(); + var result = []; + var declarations = symbol.getDeclarations(); + var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + var symbolKind = getSymbolKind(symbol, node); + var containerSymbol = symbol.parent; + var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && + !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + // Just add all the declarations. + ts.forEach(declarations, function (declaration) { + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + }); + } + return result; + function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { + // Applicable only if we are in a new expression, or we are on a constructor declaration + // and in either case the symbol has a construct signature definition, i.e. class + if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { + if (symbol.flags & 32 /* Class */) { + var classDeclaration = symbol.getDeclarations()[0]; + ts.Debug.assert(classDeclaration && classDeclaration.kind === 202 /* ClassDeclaration */); + return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); + } + } + return false; + } + function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { + if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { + return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); + } + return false; + } + function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + var declarations = []; + var definition; + ts.forEach(signatureDeclarations, function (d) { + if ((selectConstructors && d.kind === 136 /* Constructor */) || + (!selectConstructors && (d.kind === 201 /* FunctionDeclaration */ || d.kind === 135 /* MethodDeclaration */ || d.kind === 134 /* MethodSignature */))) { + declarations.push(d); + if (d.body) + definition = d; + } + }); + if (definition) { + result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); + return true; + } + else if (declarations.length) { + result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + return true; + } + return false; + } + } /// Goto definition function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); @@ -37681,7 +38616,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 === 225 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 226 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -37692,59 +38627,38 @@ var ts; var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } - var result = []; - var declarations = symbol.getDeclarations(); - var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol - var symbolKind = getSymbolKind(symbol, node); - var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); + return getDefinitionFromSymbol(symbol, node); + } + /// Goto type + function getTypeDefinitionAtPosition(fileName, position) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var node = ts.getTouchingPropertyName(sourceFile, position); + if (!node) { + return undefined; } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - // Applicable only if we are in a new expression, or we are on a constructor declaration - // and in either case the symbol has a construct signature definition, i.e. class - if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { - if (symbol.flags & 32 /* Class */) { - var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 201 /* ClassDeclaration */); - return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); - } - } - return false; + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + return undefined; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); - } - return false; + var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + if (!type) { + return undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 135 /* Constructor */) || - (!selectConstructors && (d.kind === 200 /* FunctionDeclaration */ || d.kind === 134 /* MethodDeclaration */ || d.kind === 133 /* MethodSignature */))) { - declarations.push(d); - if (d.body) - definition = d; + if (type.flags & 16384 /* Union */) { + var result = []; + ts.forEach(type.types, function (t) { + if (t.symbol) { + result.push.apply(result, getDefinitionFromSymbol(t.symbol, node)); } }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(createDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; + return result; } + if (!type.symbol) { + return undefined; + } + return getDefinitionFromSymbol(type.symbol, node); } function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); @@ -37831,74 +38745,74 @@ var ts; switch (node.kind) { case 84 /* IfKeyword */: case 76 /* ElseKeyword */: - if (hasKind(node.parent, 183 /* IfStatement */)) { + if (hasKind(node.parent, 184 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 90 /* ReturnKeyword */: - if (hasKind(node.parent, 191 /* ReturnStatement */)) { + if (hasKind(node.parent, 192 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 94 /* ThrowKeyword */: - if (hasKind(node.parent, 195 /* ThrowStatement */)) { + if (hasKind(node.parent, 196 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 68 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 196 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 197 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 96 /* TryKeyword */: case 81 /* FinallyKeyword */: - if (hasKind(parent(node), 196 /* TryStatement */)) { + if (hasKind(parent(node), 197 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 92 /* SwitchKeyword */: - if (hasKind(node.parent, 193 /* SwitchStatement */)) { + if (hasKind(node.parent, 194 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 67 /* CaseKeyword */: case 73 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 193 /* SwitchStatement */)) { + if (hasKind(parent(parent(parent(node))), 194 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 66 /* BreakKeyword */: case 71 /* ContinueKeyword */: - if (hasKind(node.parent, 190 /* BreakStatement */) || hasKind(node.parent, 189 /* ContinueStatement */)) { + if (hasKind(node.parent, 191 /* BreakStatement */) || hasKind(node.parent, 190 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurences(node.parent); } break; case 82 /* ForKeyword */: - if (hasKind(node.parent, 186 /* ForStatement */) || - hasKind(node.parent, 187 /* ForInStatement */) || - hasKind(node.parent, 188 /* ForOfStatement */)) { + if (hasKind(node.parent, 187 /* ForStatement */) || + hasKind(node.parent, 188 /* ForInStatement */) || + hasKind(node.parent, 189 /* ForOfStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 100 /* WhileKeyword */: case 75 /* DoKeyword */: - if (hasKind(node.parent, 185 /* WhileStatement */) || hasKind(node.parent, 184 /* DoStatement */)) { + if (hasKind(node.parent, 186 /* WhileStatement */) || hasKind(node.parent, 185 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 114 /* ConstructorKeyword */: - if (hasKind(node.parent, 135 /* Constructor */)) { + if (hasKind(node.parent, 136 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; case 116 /* GetKeyword */: - case 120 /* SetKeyword */: - if (hasKind(node.parent, 136 /* GetAccessor */) || hasKind(node.parent, 137 /* SetAccessor */)) { + case 121 /* SetKeyword */: + if (hasKind(node.parent, 137 /* GetAccessor */) || hasKind(node.parent, 138 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } default: if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 180 /* VariableStatement */)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 181 /* VariableStatement */)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -37914,10 +38828,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 195 /* ThrowStatement */) { + if (node.kind === 196 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 196 /* TryStatement */) { + else if (node.kind === 197 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -37946,12 +38860,12 @@ var ts; var child = throwStatement; while (child.parent) { var parent_9 = child.parent; - if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227 /* SourceFile */) { + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 228 /* SourceFile */) { return parent_9; } // 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_9.kind === 196 /* TryStatement */) { + if (parent_9.kind === 197 /* TryStatement */) { var tryStatement = parent_9; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; @@ -37966,7 +38880,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 190 /* BreakStatement */ || node.kind === 189 /* ContinueStatement */) { + if (node.kind === 191 /* BreakStatement */ || node.kind === 190 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -37982,16 +38896,16 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { switch (node_1.kind) { - case 193 /* SwitchStatement */: - if (statement.kind === 189 /* ContinueStatement */) { + case 194 /* SwitchStatement */: + if (statement.kind === 190 /* ContinueStatement */) { continue; } // Fall through. - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 185 /* WhileStatement */: - case 184 /* DoStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 186 /* WhileStatement */: + case 185 /* DoStatement */: if (!statement.label || isLabeledBy(node_1, statement.label.text)) { return node_1; } @@ -38010,18 +38924,18 @@ 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 === 201 /* ClassDeclaration */ || - (declaration.kind === 129 /* Parameter */ && hasKind(container, 135 /* Constructor */)))) { + if (!(container.kind === 202 /* ClassDeclaration */ || + (declaration.kind === 130 /* Parameter */ && hasKind(container, 136 /* Constructor */)))) { return undefined; } } else if (modifier === 109 /* StaticKeyword */) { - if (container.kind !== 201 /* ClassDeclaration */) { + if (container.kind !== 202 /* ClassDeclaration */) { return undefined; } } else if (modifier === 78 /* ExportKeyword */ || modifier === 115 /* DeclareKeyword */) { - if (!(container.kind === 206 /* ModuleBlock */ || container.kind === 227 /* SourceFile */)) { + if (!(container.kind === 207 /* ModuleBlock */ || container.kind === 228 /* SourceFile */)) { return undefined; } } @@ -38033,20 +38947,20 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 206 /* ModuleBlock */: - case 227 /* SourceFile */: + case 207 /* ModuleBlock */: + case 228 /* SourceFile */: nodes = container.statements; break; - case 135 /* Constructor */: + case 136 /* Constructor */: nodes = container.parameters.concat(container.parent.members); break; - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: 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 & 112 /* AccessibilityModifier */) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 135 /* Constructor */ && member; + return member.kind === 136 /* Constructor */ && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -38094,13 +39008,13 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 136 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 137 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 138 /* SetAccessor */); return ts.map(keywords, getHighlightSpanForNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 120 /* SetKeyword */); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 121 /* SetKeyword */); }); } } } @@ -38118,7 +39032,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82 /* ForKeyword */, 100 /* WhileKeyword */, 75 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 184 /* DoStatement */) { + if (loopNode.kind === 185 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 100 /* WhileKeyword */)) { @@ -38139,13 +39053,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -38199,7 +39113,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, 179 /* Block */))) { + if (!(func && hasKind(func.body, 180 /* Block */))) { return undefined; } var keywords = []; @@ -38215,7 +39129,7 @@ var ts; function getIfElseOccurrences(ifStatement) { var keywords = []; // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 183 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 184 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. @@ -38228,7 +39142,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 183 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 184 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -38407,17 +39321,17 @@ var ts; } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 213 /* ImportSpecifier */ || location.parent.kind === 217 /* ExportSpecifier */) && + (location.parent.kind === 214 /* ImportSpecifier */ || location.parent.kind === 218 /* ExportSpecifier */) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 217 /* ExportSpecifier */; + return declaration.kind === 214 /* ImportSpecifier */ || declaration.kind === 218 /* ExportSpecifier */; }); } function getDeclaredName(symbol, location) { // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 163 /* FunctionExpression */ ? d : undefined; }); // When a name gets interned into a SourceFile's 'identifiers' Map, // its name is escaped and stored in the same way its symbol name/identifier // name should be stored. Function expressions, however, are a special case, @@ -38444,7 +39358,7 @@ var ts; return location.getText(); } // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 163 /* FunctionExpression */ ? d : undefined; }); // When a name gets interned into a SourceFile's 'identifiers' Map, // its name is escaped and stored in the same way its symbol name/identifier // name should be stored. Function expressions, however, are a special case, @@ -38468,7 +39382,7 @@ var ts; if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 201 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 202 /* ClassDeclaration */); } } // If the symbol is an import we would like to find it if we are looking for what it imports. @@ -38494,7 +39408,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 228 /* 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; @@ -38682,13 +39596,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -38720,27 +39634,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // fall through - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // Fall through - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 163 /* 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. @@ -38749,7 +39663,7 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 227 /* SourceFile */) { + if (searchSpaceNode.kind === 228 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -38780,27 +39694,27 @@ var ts; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 201 /* ClassDeclaration */: + case 202 /* 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 & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 227 /* SourceFile */: - if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { + case 228 /* SourceFile */: + if (container.kind === 228 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -38854,11 +39768,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 201 /* ClassDeclaration */) { + if (declaration.kind === 202 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 202 /* InterfaceDeclaration */) { + else if (declaration.kind === 203 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -38919,19 +39833,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_25 = node.text; + var name_26 = 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_25); + var unionProperty = contextualType.getProperty(name_26); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_25); + var symbol = t.getProperty(name_26); if (symbol) { result_4.push(symbol); } @@ -38940,7 +39854,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_25); + var symbol_1 = contextualType.getProperty(name_26); if (symbol_1) { return [symbol_1]; } @@ -38998,10 +39912,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 168 /* PostfixUnaryExpression */ || parent.kind === 167 /* PrefixUnaryExpression */) { + if (parent.kind === 169 /* PostfixUnaryExpression */ || parent.kind === 168 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 169 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 170 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; return 53 /* FirstAssignment */ <= operator && operator <= 64 /* LastAssignment */; } @@ -39035,33 +39949,33 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: - case 226 /* EnumMember */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 223 /* CatchClause */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: + case 227 /* EnumMember */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 224 /* CatchClause */: return 1 /* Value */; - case 128 /* TypeParameter */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 145 /* TypeLiteral */: + case 129 /* TypeParameter */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 146 /* TypeLiteral */: return 2 /* Type */; - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (node.name.kind === 8 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } @@ -39071,15 +39985,15 @@ var ts; else { return 4 /* Namespace */; } - case 212 /* NamedImports */: - case 213 /* ImportSpecifier */: - case 208 /* ImportEqualsDeclaration */: - case 209 /* ImportDeclaration */: - case 214 /* ExportAssignment */: - case 215 /* ExportDeclaration */: + case 213 /* NamedImports */: + case 214 /* ImportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 210 /* ImportDeclaration */: + case 215 /* ExportAssignment */: + case 216 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 227 /* SourceFile */: + case 228 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; @@ -39089,7 +40003,7 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 141 /* TypeReference */ || node.parent.kind === 177 /* HeritageClauseElement */; + return node.parent.kind === 142 /* TypeReference */ || node.parent.kind === 177 /* ExpressionWithTypeArguments */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -39097,32 +40011,32 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 155 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 155 /* PropertyAccessExpression */) { + if (root.parent.kind === 156 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 156 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 177 /* HeritageClauseElement */ && root.parent.parent.kind === 222 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 177 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 223 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || - (decl.kind === 202 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); + return (decl.kind === 202 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || + (decl.kind === 203 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 126 /* QualifiedName */) { - while (root.parent && root.parent.kind === 126 /* QualifiedName */) { + if (root.parent.kind === 127 /* QualifiedName */) { + while (root.parent && root.parent.kind === 127 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 141 /* TypeReference */ && !isLastClause; + return root.parent.kind === 142 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 126 /* QualifiedName */) { + while (node.parent.kind === 127 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -39132,15 +40046,15 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 126 /* QualifiedName */ && + if (node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 208 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 209 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 214 /* ExportAssignment */) { + if (node.parent.kind === 215 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -39180,8 +40094,8 @@ var ts; return; } switch (node.kind) { - case 155 /* PropertyAccessExpression */: - case 126 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: case 8 /* StringLiteral */: case 80 /* FalseKeyword */: case 95 /* TrueKeyword */: @@ -39204,7 +40118,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 === 205 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 206 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -39231,29 +40145,37 @@ var ts; return ts.NavigationBar.getNavigationBarItems(sourceFile); } function getSemanticClassifications(fileName, span) { + return convertClassifications(getEncodedSemanticClassifications(fileName, span)); + } + function getEncodedSemanticClassifications(fileName, span) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var typeChecker = program.getTypeChecker(); var result = []; processNode(sourceFile); - return result; + return { spans: result, endOfLineState: 0 /* None */ }; + function pushClassification(start, length, type) { + result.push(start); + result.push(length); + result.push(type); + } function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) { - return ClassificationTypeNames.className; + return 11 /* className */; } else if (flags & 384 /* Enum */) { - return ClassificationTypeNames.enumName; + return 12 /* enumName */; } else if (flags & 524288 /* TypeAlias */) { - return ClassificationTypeNames.typeAlias; + return 16 /* typeAliasName */; } else if (meaningAtPosition & 2 /* Type */) { if (flags & 64 /* Interface */) { - return ClassificationTypeNames.interfaceName; + return 13 /* interfaceName */; } else if (flags & 262144 /* TypeParameter */) { - return ClassificationTypeNames.typeParameterName; + return 15 /* typeParameterName */; } } else if (flags & 1536 /* Module */) { @@ -39262,7 +40184,7 @@ var ts; // - There exists a module declaration which actually impacts the value side. if (meaningAtPosition & 4 /* Namespace */ || (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { - return ClassificationTypeNames.moduleName; + return 14 /* moduleName */; } } return undefined; @@ -39271,7 +40193,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; + return declaration.kind === 206 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } @@ -39283,10 +40205,7 @@ var ts; if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { - result.push({ - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - classificationType: type - }); + pushClassification(node.getStart(), node.getWidth(), type); } } } @@ -39294,7 +40213,42 @@ var ts; } } } + function getClassificationTypeName(type) { + switch (type) { + case 1 /* comment */: return ClassificationTypeNames.comment; + case 2 /* identifier */: return ClassificationTypeNames.identifier; + case 3 /* keyword */: return ClassificationTypeNames.keyword; + case 4 /* numericLiteral */: return ClassificationTypeNames.numericLiteral; + case 5 /* operator */: return ClassificationTypeNames.operator; + case 6 /* stringLiteral */: return ClassificationTypeNames.stringLiteral; + case 8 /* whiteSpace */: return ClassificationTypeNames.whiteSpace; + case 9 /* text */: return ClassificationTypeNames.text; + case 10 /* punctuation */: return ClassificationTypeNames.punctuation; + case 11 /* className */: return ClassificationTypeNames.className; + case 12 /* enumName */: return ClassificationTypeNames.enumName; + case 13 /* interfaceName */: return ClassificationTypeNames.interfaceName; + case 14 /* moduleName */: return ClassificationTypeNames.moduleName; + case 15 /* typeParameterName */: return ClassificationTypeNames.typeParameterName; + case 16 /* typeAliasName */: return ClassificationTypeNames.typeAliasName; + case 17 /* parameterName */: return ClassificationTypeNames.parameterName; + } + } + function convertClassifications(classifications) { + ts.Debug.assert(classifications.spans.length % 3 === 0); + var dense = classifications.spans; + var result = []; + for (var i = 0, n = dense.length; i < n; i += 3) { + result.push({ + textSpan: ts.createTextSpan(dense[i], dense[i + 1]), + classificationType: getClassificationTypeName(dense[i + 2]) + }); + } + return result; + } function getSyntacticClassifications(fileName, span) { + return convertClassifications(getEncodedSyntacticClassifications(fileName, span)); + } + function getEncodedSyntacticClassifications(fileName, span) { // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); // Make a scanner we can get trivia from. @@ -39302,7 +40256,12 @@ var ts; var mergeConflictScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); var result = []; processElement(sourceFile); - return result; + return { spans: result, endOfLineState: 0 /* None */ }; + function pushClassification(start, length, type) { + result.push(start); + result.push(length); + result.push(type); + } function classifyLeadingTrivia(token) { var tokenStart = ts.skipTrivia(sourceFile.text, token.pos, false); if (tokenStart === token.pos) { @@ -39321,10 +40280,7 @@ var ts; } if (ts.isComment(kind)) { // Simple comment. Just add as is. - result.push({ - textSpan: ts.createTextSpan(start, width), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, width, 1 /* comment */); continue; } if (kind === 6 /* ConflictMarkerTrivia */) { @@ -39333,10 +40289,7 @@ var ts; // for the <<<<<<< and >>>>>>> markers, we just add them in as comments // in the classification stream. if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - result.push({ - textSpan: ts.createTextSpan(start, width), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, width, 1 /* comment */); continue; } // for the ======== add a comment for the first line, and then lex all @@ -39355,10 +40308,7 @@ var ts; break; } } - result.push({ - textSpan: ts.createTextSpanFromBounds(start, i), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, i - start, 1 /* comment */); mergeConflictScanner.setTextPos(i); while (mergeConflictScanner.getTextPos() < end) { classifyDisabledCodeToken(); @@ -39370,10 +40320,7 @@ var ts; var end = mergeConflictScanner.getTextPos(); var type = classifyTokenType(tokenKind); if (type) { - result.push({ - textSpan: ts.createTextSpanFromBounds(start, end), - classificationType: type - }); + pushClassification(start, end - start, type); } } function classifyToken(token) { @@ -39381,10 +40328,7 @@ var ts; if (token.getWidth() > 0) { var type = classifyTokenType(token.kind, token); if (type) { - result.push({ - textSpan: ts.createTextSpan(token.getStart(), token.getWidth()), - classificationType: type - }); + pushClassification(token.getStart(), token.getWidth(), type); } } } @@ -39393,7 +40337,7 @@ var ts; // classify based on that instead. function classifyTokenType(tokenKind, token) { if (ts.isKeyword(tokenKind)) { - return ClassificationTypeNames.keyword; + return 3 /* keyword */; } // Special case < and > If they appear in a generic context they are punctuation, // not operators. @@ -39401,73 +40345,78 @@ var ts; // If the node owning the token has a type argument list or type parameter list, then // we can effectively assume that a '<' and '>' belong to those lists. if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { - return ClassificationTypeNames.punctuation; + return 10 /* punctuation */; } } if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 53 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 198 /* VariableDeclaration */ || - token.parent.kind === 132 /* PropertyDeclaration */ || - token.parent.kind === 129 /* Parameter */) { - return ClassificationTypeNames.operator; + if (token.parent.kind === 199 /* VariableDeclaration */ || + token.parent.kind === 133 /* PropertyDeclaration */ || + token.parent.kind === 130 /* Parameter */) { + return 5 /* operator */; } } - if (token.parent.kind === 169 /* BinaryExpression */ || - token.parent.kind === 167 /* PrefixUnaryExpression */ || - token.parent.kind === 168 /* PostfixUnaryExpression */ || - token.parent.kind === 170 /* ConditionalExpression */) { - return ClassificationTypeNames.operator; + if (token.parent.kind === 170 /* BinaryExpression */ || + token.parent.kind === 168 /* PrefixUnaryExpression */ || + token.parent.kind === 169 /* PostfixUnaryExpression */ || + token.parent.kind === 171 /* ConditionalExpression */) { + return 5 /* operator */; } } - return ClassificationTypeNames.punctuation; + return 10 /* punctuation */; } else if (tokenKind === 7 /* NumericLiteral */) { - return ClassificationTypeNames.numericLiteral; + return 4 /* numericLiteral */; } else if (tokenKind === 8 /* StringLiteral */) { - return ClassificationTypeNames.stringLiteral; + return 6 /* stringLiteral */; } else if (tokenKind === 9 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. - return ClassificationTypeNames.stringLiteral; + return 6 /* stringLiteral */; } else if (ts.isTemplateLiteralKind(tokenKind)) { // TODO (drosen): we should *also* get another classification type for these literals. - return ClassificationTypeNames.stringLiteral; + return 6 /* stringLiteral */; } else if (tokenKind === 65 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.className; + return 11 /* className */; } return; - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: if (token.parent.name === token) { - return ClassificationTypeNames.typeParameterName; + return 15 /* typeParameterName */; } return; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.interfaceName; + return 13 /* interfaceName */; } return; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.enumName; + return 12 /* enumName */; } return; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.moduleName; + return 14 /* moduleName */; + } + return; + case 130 /* Parameter */: + if (token.parent.name === token) { + return 17 /* parameterName */; } return; } } - return ClassificationTypeNames.text; + return 9 /* text */; } } function processElement(element) { @@ -39747,11 +40696,14 @@ var ts; getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, getSyntacticClassifications: getSyntacticClassifications, getSemanticClassifications: getSemanticClassifications, + getEncodedSyntacticClassifications: getEncodedSyntacticClassifications, + getEncodedSemanticClassifications: getEncodedSemanticClassifications, getCompletionsAtPosition: getCompletionsAtPosition, getCompletionEntryDetails: getCompletionEntryDetails, getSignatureHelpItems: getSignatureHelpItems, getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, + getTypeDefinitionAtPosition: getTypeDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, @@ -39799,7 +40751,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 === 219 /* ExternalModuleReference */ || + node.parent.kind === 220 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -39812,7 +40764,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 156 /* ElementAccessExpression */ && + node.parent.kind === 157 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /// Classifier @@ -39860,7 +40812,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 116 /* GetKeyword */ || - keyword2 === 120 /* SetKeyword */ || + keyword2 === 121 /* SetKeyword */ || keyword2 === 114 /* ConstructorKeyword */ || keyword2 === 109 /* StaticKeyword */) { // Allow things like "public get", "public constructor" and "public static". @@ -39875,9 +40827,58 @@ var ts; // if there are more cases we want the classifier to be better at. return true; } + function convertClassifications(classifications, text) { + var entries = []; + var dense = classifications.spans; + var lastEnd = 0; + for (var i = 0, n = dense.length; i < n; i += 3) { + var start = dense[i]; + var length_1 = dense[i + 1]; + var type = dense[i + 2]; + // Make a whitespace entry between the last item and this one. + if (lastEnd >= 0) { + var whitespaceLength_1 = start - lastEnd; + if (whitespaceLength_1 > 0) { + entries.push({ length: whitespaceLength_1, classification: TokenClass.Whitespace }); + } + } + entries.push({ length: length_1, classification: convertClassification(type) }); + lastEnd = start + length_1; + } + var whitespaceLength = text.length - lastEnd; + if (whitespaceLength > 0) { + entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); + } + return { entries: entries, finalLexState: classifications.endOfLineState }; + } + function convertClassification(type) { + switch (type) { + case 1 /* comment */: return TokenClass.Comment; + case 3 /* keyword */: return TokenClass.Keyword; + case 4 /* numericLiteral */: return TokenClass.NumberLiteral; + case 5 /* operator */: return TokenClass.Operator; + case 6 /* stringLiteral */: return TokenClass.StringLiteral; + case 8 /* whiteSpace */: return TokenClass.Whitespace; + case 10 /* punctuation */: return TokenClass.Punctuation; + case 2 /* identifier */: + case 11 /* className */: + case 12 /* enumName */: + case 13 /* interfaceName */: + case 14 /* moduleName */: + case 15 /* typeParameterName */: + case 16 /* typeAliasName */: + case 9 /* text */: + case 17 /* parameterName */: + default: + return TokenClass.Identifier; + } + } + function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); + } // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), // we will be more conservative in order to avoid conflicting with the syntactic classifier. - function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { var offset = 0; var token = 0 /* Unknown */; var lastNonTriviaToken = 0 /* Unknown */; @@ -39917,8 +40918,8 @@ var ts; } scanner.setText(text); var result = { - finalLexState: 0 /* Start */, - entries: [] + endOfLineState: 0 /* None */, + spans: [] }; // We can run into an unfortunate interaction between the lexical and syntactic classifier // when the user is typing something generic. Consider the case where the user types: @@ -39970,10 +40971,10 @@ var ts; angleBracketStack--; } else if (token === 112 /* AnyKeyword */ || - token === 121 /* StringKeyword */ || - token === 119 /* NumberKeyword */ || + token === 122 /* StringKeyword */ || + token === 120 /* NumberKeyword */ || token === 113 /* BooleanKeyword */ || - token === 122 /* SymbolKeyword */) { + token === 123 /* SymbolKeyword */) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -40020,7 +41021,7 @@ var ts; function processToken() { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); - addResult(end - start, classFromKind(token)); + addResult(start, end, classFromKind(token)); if (end >= text.length) { if (token === 8 /* StringLiteral */) { // Check to see if we finished up on a multiline string literal. @@ -40034,7 +41035,7 @@ var ts; // If we have an odd number of backslashes, then the multiline string is unclosed if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 /* doubleQuote */ + result.endOfLineState = quoteChar === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; } @@ -40043,16 +41044,16 @@ var ts; else if (token === 3 /* MultiLineCommentTrivia */) { // Check to see if the multiline comment was unclosed. if (scanner.isUnterminated()) { - result.finalLexState = 1 /* InMultiLineCommentTrivia */; + result.endOfLineState = 1 /* InMultiLineCommentTrivia */; } } else if (ts.isTemplateLiteralKind(token)) { if (scanner.isUnterminated()) { if (token === 13 /* TemplateTail */) { - result.finalLexState = 5 /* InTemplateMiddleOrTail */; + result.endOfLineState = 5 /* InTemplateMiddleOrTail */; } else if (token === 10 /* NoSubstitutionTemplateLiteral */) { - result.finalLexState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; + result.endOfLineState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; } else { ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); @@ -40060,18 +41061,30 @@ var ts; } } else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11 /* TemplateHead */) { - result.finalLexState = 6 /* InTemplateSubstitutionPosition */; + result.endOfLineState = 6 /* InTemplateSubstitutionPosition */; } } } - function addResult(length, classification) { + function addResult(start, end, classification) { + if (classification === 8 /* whiteSpace */) { + // Don't bother with whitespace classifications. They're not needed. + return; + } + if (start === 0 && offset > 0) { + // We're classifying the first token, and this was a case where we prepended + // text. We should consider the start of this token to be at the start of + // the original text. + start += offset; + } + // All our tokens are in relation to the augmented text. Move them back to be + // relative to the original text. + start -= offset; + end -= offset; + var length = end - start; if (length > 0) { - // If this is the first classification we're adding to the list, then remove any - // offset we have if we were continuing a construct from the previous line. - if (result.entries.length === 0) { - length -= offset; - } - result.entries.push({ length: length, classification: classification }); + result.spans.push(start); + result.spans.push(length); + result.spans.push(classification); } } } @@ -40132,41 +41145,44 @@ var ts; } } function isKeyword(token) { - return token >= 66 /* FirstKeyword */ && token <= 125 /* LastKeyword */; + return token >= 66 /* FirstKeyword */ && token <= 126 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { - return TokenClass.Keyword; + return 3 /* keyword */; } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return TokenClass.Operator; + return 5 /* operator */; } else if (token >= 14 /* FirstPunctuation */ && token <= 64 /* LastPunctuation */) { - return TokenClass.Punctuation; + return 10 /* punctuation */; } switch (token) { case 7 /* NumericLiteral */: - return TokenClass.NumberLiteral; + return 4 /* numericLiteral */; case 8 /* StringLiteral */: - return TokenClass.StringLiteral; + return 6 /* stringLiteral */; case 9 /* RegularExpressionLiteral */: - return TokenClass.RegExpLiteral; + return 7 /* regularExpressionLiteral */; case 6 /* ConflictMarkerTrivia */: case 3 /* MultiLineCommentTrivia */: case 2 /* SingleLineCommentTrivia */: - return TokenClass.Comment; + return 1 /* comment */; case 5 /* WhitespaceTrivia */: case 4 /* NewLineTrivia */: - return TokenClass.Whitespace; + return 8 /* whiteSpace */; case 65 /* Identifier */: default: if (ts.isTemplateLiteralKind(token)) { - return TokenClass.StringLiteral; + return 6 /* stringLiteral */; } - return TokenClass.Identifier; + return 2 /* identifier */; } } - return { getClassificationsForLine: getClassificationsForLine }; + return { + getClassificationsForLine: getClassificationsForLine, + getEncodedLexicalClassifications: getEncodedLexicalClassifications + }; } ts.createClassifier = createClassifier; /** @@ -40187,7 +41203,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 227 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 228 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -40257,125 +41273,125 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 184 /* DoStatement */) { + if (node.parent.kind === 185 /* DoStatement */) { // Set span as if on while keyword return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ForStatement */) { + if (node.parent.kind === 187 /* ForStatement */) { // For now lets set the span on this expression, fix it later return textSpan(node); } - if (node.parent.kind === 169 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { + if (node.parent.kind === 170 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { // if this is comma expression, the breakpoint is possible in this expression return textSpan(node); } - if (node.parent.kind == 163 /* ArrowFunction */ && node.parent.body == node) { + if (node.parent.kind == 164 /* 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 180 /* VariableStatement */: + case 181 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 198 /* VariableDeclaration */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 199 /* VariableDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return spanInVariableDeclaration(node); - case 129 /* Parameter */: + case 130 /* Parameter */: return spanInParameterDeclaration(node); - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 179 /* Block */: + case 180 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // Fall through - case 206 /* ModuleBlock */: + case 207 /* ModuleBlock */: return spanInBlock(node); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return spanInBlock(node.block); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: // Span on while(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 184 /* DoStatement */: + case 185 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 197 /* DebuggerStatement */: + case 198 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 183 /* IfStatement */: + case 184 /* IfStatement */: // set on if(..) span return textSpan(node, ts.findNextToken(node.expression, node)); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return spanInForStatement(node); - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: // span on for (a in ...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: // span on switch(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 196 /* TryStatement */: + case 197 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: // span on complete node return textSpan(node); - case 192 /* WithStatement */: + case 193 /* WithStatement */: // span in statement return spanInNode(node.statement); // No breakpoint in interface, type alias - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: return undefined; // Tokens: case 22 /* SemicolonToken */: @@ -40405,11 +41421,11 @@ var ts; return spanInNextNode(node); default: // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 224 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 225 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 160 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 161 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNode(node.parent.expression); } // return type of function go to previous token @@ -40422,12 +41438,12 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 187 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */) { + if (variableDeclaration.parent.parent.kind === 188 /* ForInStatement */ || + variableDeclaration.parent.parent.kind === 189 /* ForOfStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 181 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 187 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -40481,7 +41497,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 1 /* Export */) || - (functionDeclaration.parent.kind === 201 /* ClassDeclaration */ && functionDeclaration.kind !== 135 /* Constructor */); + (functionDeclaration.parent.kind === 202 /* ClassDeclaration */ && functionDeclaration.kind !== 136 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -40504,18 +41520,18 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement - case 185 /* WhileStatement */: - case 183 /* IfStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 186 /* WhileStatement */: + case 184 /* IfStatement */: + case 188 /* ForInStatement */: + case 189 /* 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 186 /* ForStatement */: + case 187 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement @@ -40523,7 +41539,7 @@ var ts; } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 199 /* VariableDeclarationList */) { + if (forStatement.initializer.kind === 200 /* VariableDeclarationList */) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -40536,20 +41552,20 @@ var ts; if (forStatement.condition) { return textSpan(forStatement.condition); } - if (forStatement.iterator) { - return textSpan(forStatement.iterator); + if (forStatement.incrementor) { + return textSpan(forStatement.incrementor); } } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 207 /* CaseBlock */: + case 208 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -40557,30 +41573,30 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 206 /* ModuleBlock */: + case 207 /* ModuleBlock */: // If this is not instantiated module block no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 204 /* EnumDeclaration */: - case 201 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 179 /* Block */: + case 180 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // fall through. - case 223 /* CatchClause */: - return spanInNode(node.parent.statements[node.parent.statements.length - 1]); + case 224 /* CatchClause */: + return spanInNode(ts.lastOrUndefined(node.parent.statements)); ; - case 207 /* CaseBlock */: + case 208 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; - var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; + var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { - return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; // Default to parent node @@ -40589,7 +41605,7 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 184 /* DoStatement */) { + if (node.parent.kind === 185 /* DoStatement */) { // Go to while keyword and do action instead return spanInPreviousNode(node); } @@ -40599,17 +41615,17 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: - case 185 /* WhileStatement */: - case 184 /* DoStatement */: - case 186 /* ForStatement */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: + case 186 /* WhileStatement */: + case 185 /* DoStatement */: + case 187 /* ForStatement */: return spanInPreviousNode(node); // Default to parent node default: @@ -40620,19 +41636,19 @@ var ts; } function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 224 /* PropertyAssignment */) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 225 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 160 /* TypeAssertionExpression */) { + if (node.parent.kind === 161 /* TypeAssertionExpression */) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 184 /* DoStatement */) { + if (node.parent.kind === 185 /* DoStatement */) { // Set span on while expression return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } @@ -40646,7 +41662,7 @@ var ts; })(ts || (ts = {})); // // Copyright (c) Microsoft Corporation. All rights reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -40665,7 +41681,9 @@ var debugObjectHost = this; var ts; (function (ts) { function logInternalError(logger, err) { - logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); + if (logger) { + logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); + } } var ScriptSnapshotShimAdapter = (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { @@ -40758,24 +41776,39 @@ var ts; return LanguageServiceShimHostAdapter; })(); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - function simpleForwardCall(logger, actionDescription, action) { - logger.log(actionDescription); - var start = Date.now(); + var CoreServicesShimHostAdapter = (function () { + function CoreServicesShimHostAdapter(shimHost) { + this.shimHost = shimHost; + } + CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extension) { + var encoded = this.shimHost.readDirectory(rootDir, extension); + return JSON.parse(encoded); + }; + return CoreServicesShimHostAdapter; + })(); + ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; + function simpleForwardCall(logger, actionDescription, action, noPerfLogging) { + if (!noPerfLogging) { + logger.log(actionDescription); + var start = Date.now(); + } var result = action(); - var end = Date.now(); - logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { - var str = result; - if (str.length > 128) { - str = str.substring(0, 128) + "..."; + if (!noPerfLogging) { + var end = Date.now(); + logger.log(actionDescription + " completed in " + (end - start) + " msec"); + if (typeof (result) === "string") { + var str = result; + if (str.length > 128) { + str = str.substring(0, 128) + "..."; + } + logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); } - logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); } return result; } - function forwardJSONCall(logger, actionDescription, action) { + function forwardJSONCall(logger, actionDescription, action, noPerfLogging) { try { - var result = simpleForwardCall(logger, actionDescription, action); + var result = simpleForwardCall(logger, actionDescription, action, noPerfLogging); return JSON.stringify({ result: result }); } catch (err) { @@ -40820,7 +41853,7 @@ var ts; this.logger = this.host; } LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action); + return forwardJSONCall(this.logger, actionDescription, action, false); }; /// DISPOSE /** @@ -40873,6 +41906,22 @@ var ts; return classifications; }); }; + LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); + }); + }; + LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); + }); + }; LanguageServiceShimObject.prototype.getNewLine = function () { return this.host.getNewLine ? this.host.getNewLine() : "\r\n"; }; @@ -40951,6 +42000,17 @@ var ts; return _this.languageService.getDefinitionAtPosition(fileName, position); }); }; + /// GOTO Type + /** + * Computes the definition location of the type of the symbol + * at the requested position. + */ + LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) { + var _this = this; + return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { + return _this.languageService.getTypeDefinitionAtPosition(fileName, position); + }); + }; LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { var _this = this; return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { @@ -41092,12 +42152,21 @@ var ts; }; return LanguageServiceShimObject; })(ShimBase); + function convertClassifications(classifications) { + return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; + } var ClassifierShimObject = (function (_super) { __extends(ClassifierShimObject, _super); - function ClassifierShimObject(factory) { + function ClassifierShimObject(factory, logger) { _super.call(this, factory); + this.logger = logger; this.classifier = ts.createClassifier(); } + ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) { + var _this = this; + return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, + /*noPerfLogging:*/ true); + }; /// COLORIZATION ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); @@ -41114,12 +42183,13 @@ var ts; })(ShimBase); var CoreServicesShimObject = (function (_super) { __extends(CoreServicesShimObject, _super); - function CoreServicesShimObject(factory, logger) { + function CoreServicesShimObject(factory, logger, host) { _super.call(this, factory); this.logger = logger; + this.host = host; } CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action); + return forwardJSONCall(this.logger, actionDescription, action, false); }; CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { @@ -41146,6 +42216,26 @@ var ts; return convertResult; }); }; + CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { + var _this = this; + return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { + var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); + var result = ts.parseConfigFileText(fileName, text); + if (result.error) { + return { + options: {}, + files: [], + errors: [realizeDiagnostic(result.error, '\r\n')] + }; + } + var configFile = ts.parseConfigFile(result.config, _this.host, ts.getDirectoryPath(ts.normalizeSlashes(fileName))); + return { + options: configFile.options, + files: configFile.fileNames, + errors: [realizeDiagnostics(configFile.errors, '\r\n')] + }; + }); + }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); @@ -41177,19 +42267,20 @@ var ts; }; TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) { try { - return new ClassifierShimObject(this); + return new ClassifierShimObject(this, logger); } catch (err) { logInternalError(logger, err); throw err; } }; - TypeScriptServicesFactory.prototype.createCoreServicesShim = function (logger) { + TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) { try { - return new CoreServicesShimObject(this, logger); + var adapter = new CoreServicesShimHostAdapter(host); + return new CoreServicesShimObject(this, host, adapter); } catch (err) { - logInternalError(logger, err); + logInternalError(host, err); throw err; } }; @@ -41227,4 +42318,4 @@ var TypeScript; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); /* @internal */ -var toolsVersion = "1.5"; +var toolsVersion = "1.4"; diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts index cd8ee05add4..3114c56b789 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -140,132 +140,133 @@ declare module ts { DeclareKeyword = 115, GetKeyword = 116, ModuleKeyword = 117, - RequireKeyword = 118, - NumberKeyword = 119, - SetKeyword = 120, - StringKeyword = 121, - SymbolKeyword = 122, - TypeKeyword = 123, - FromKeyword = 124, - OfKeyword = 125, - QualifiedName = 126, - ComputedPropertyName = 127, - TypeParameter = 128, - Parameter = 129, - Decorator = 130, - PropertySignature = 131, - PropertyDeclaration = 132, - MethodSignature = 133, - MethodDeclaration = 134, - Constructor = 135, - GetAccessor = 136, - SetAccessor = 137, - CallSignature = 138, - ConstructSignature = 139, - IndexSignature = 140, - TypeReference = 141, - FunctionType = 142, - ConstructorType = 143, - TypeQuery = 144, - TypeLiteral = 145, - ArrayType = 146, - TupleType = 147, - UnionType = 148, - ParenthesizedType = 149, - ObjectBindingPattern = 150, - ArrayBindingPattern = 151, - BindingElement = 152, - ArrayLiteralExpression = 153, - ObjectLiteralExpression = 154, - PropertyAccessExpression = 155, - ElementAccessExpression = 156, - CallExpression = 157, - NewExpression = 158, - TaggedTemplateExpression = 159, - TypeAssertionExpression = 160, - ParenthesizedExpression = 161, - FunctionExpression = 162, - ArrowFunction = 163, - DeleteExpression = 164, - TypeOfExpression = 165, - VoidExpression = 166, - PrefixUnaryExpression = 167, - PostfixUnaryExpression = 168, - BinaryExpression = 169, - ConditionalExpression = 170, - TemplateExpression = 171, - YieldExpression = 172, - SpreadElementExpression = 173, - ClassExpression = 174, - OmittedExpression = 175, - TemplateSpan = 176, - HeritageClauseElement = 177, - SemicolonClassElement = 178, - Block = 179, - VariableStatement = 180, - EmptyStatement = 181, - ExpressionStatement = 182, - IfStatement = 183, - DoStatement = 184, - WhileStatement = 185, - ForStatement = 186, - ForInStatement = 187, - ForOfStatement = 188, - ContinueStatement = 189, - BreakStatement = 190, - ReturnStatement = 191, - WithStatement = 192, - SwitchStatement = 193, - LabeledStatement = 194, - ThrowStatement = 195, - TryStatement = 196, - DebuggerStatement = 197, - VariableDeclaration = 198, - VariableDeclarationList = 199, - FunctionDeclaration = 200, - ClassDeclaration = 201, - InterfaceDeclaration = 202, - TypeAliasDeclaration = 203, - EnumDeclaration = 204, - ModuleDeclaration = 205, - ModuleBlock = 206, - CaseBlock = 207, - ImportEqualsDeclaration = 208, - ImportDeclaration = 209, - ImportClause = 210, - NamespaceImport = 211, - NamedImports = 212, - ImportSpecifier = 213, - ExportAssignment = 214, - ExportDeclaration = 215, - NamedExports = 216, - ExportSpecifier = 217, - MissingDeclaration = 218, - ExternalModuleReference = 219, - CaseClause = 220, - DefaultClause = 221, - HeritageClause = 222, - CatchClause = 223, - PropertyAssignment = 224, - ShorthandPropertyAssignment = 225, - EnumMember = 226, - SourceFile = 227, - SyntaxList = 228, - Count = 229, + NamespaceKeyword = 118, + RequireKeyword = 119, + NumberKeyword = 120, + SetKeyword = 121, + StringKeyword = 122, + SymbolKeyword = 123, + TypeKeyword = 124, + FromKeyword = 125, + OfKeyword = 126, + QualifiedName = 127, + ComputedPropertyName = 128, + TypeParameter = 129, + Parameter = 130, + Decorator = 131, + PropertySignature = 132, + PropertyDeclaration = 133, + MethodSignature = 134, + MethodDeclaration = 135, + Constructor = 136, + GetAccessor = 137, + SetAccessor = 138, + CallSignature = 139, + ConstructSignature = 140, + IndexSignature = 141, + TypeReference = 142, + FunctionType = 143, + ConstructorType = 144, + TypeQuery = 145, + TypeLiteral = 146, + ArrayType = 147, + TupleType = 148, + UnionType = 149, + ParenthesizedType = 150, + ObjectBindingPattern = 151, + ArrayBindingPattern = 152, + BindingElement = 153, + ArrayLiteralExpression = 154, + ObjectLiteralExpression = 155, + PropertyAccessExpression = 156, + ElementAccessExpression = 157, + CallExpression = 158, + NewExpression = 159, + TaggedTemplateExpression = 160, + TypeAssertionExpression = 161, + ParenthesizedExpression = 162, + FunctionExpression = 163, + ArrowFunction = 164, + DeleteExpression = 165, + TypeOfExpression = 166, + VoidExpression = 167, + PrefixUnaryExpression = 168, + PostfixUnaryExpression = 169, + BinaryExpression = 170, + ConditionalExpression = 171, + TemplateExpression = 172, + YieldExpression = 173, + SpreadElementExpression = 174, + ClassExpression = 175, + OmittedExpression = 176, + ExpressionWithTypeArguments = 177, + TemplateSpan = 178, + SemicolonClassElement = 179, + Block = 180, + VariableStatement = 181, + EmptyStatement = 182, + ExpressionStatement = 183, + IfStatement = 184, + DoStatement = 185, + WhileStatement = 186, + ForStatement = 187, + ForInStatement = 188, + ForOfStatement = 189, + ContinueStatement = 190, + BreakStatement = 191, + ReturnStatement = 192, + WithStatement = 193, + SwitchStatement = 194, + LabeledStatement = 195, + ThrowStatement = 196, + TryStatement = 197, + DebuggerStatement = 198, + VariableDeclaration = 199, + VariableDeclarationList = 200, + FunctionDeclaration = 201, + ClassDeclaration = 202, + InterfaceDeclaration = 203, + TypeAliasDeclaration = 204, + EnumDeclaration = 205, + ModuleDeclaration = 206, + ModuleBlock = 207, + CaseBlock = 208, + ImportEqualsDeclaration = 209, + ImportDeclaration = 210, + ImportClause = 211, + NamespaceImport = 212, + NamedImports = 213, + ImportSpecifier = 214, + ExportAssignment = 215, + ExportDeclaration = 216, + NamedExports = 217, + ExportSpecifier = 218, + MissingDeclaration = 219, + ExternalModuleReference = 220, + CaseClause = 221, + DefaultClause = 222, + HeritageClause = 223, + CatchClause = 224, + PropertyAssignment = 225, + ShorthandPropertyAssignment = 226, + EnumMember = 227, + SourceFile = 228, + SyntaxList = 229, + Count = 230, FirstAssignment = 53, LastAssignment = 64, FirstReservedWord = 66, LastReservedWord = 101, FirstKeyword = 66, - LastKeyword = 125, + LastKeyword = 126, FirstFutureReservedWord = 102, LastFutureReservedWord = 110, - FirstTypeNode = 141, - LastTypeNode = 149, + FirstTypeNode = 142, + LastTypeNode = 150, FirstPunctuation = 14, LastPunctuation = 64, FirstToken = 0, - LastToken = 125, + LastToken = 126, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -274,7 +275,7 @@ declare module ts { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 64, - FirstNode = 126, + FirstNode = 127, } const enum NodeFlags { Export = 1, @@ -290,7 +291,8 @@ declare module ts { Let = 4096, Const = 8192, OctalLiteral = 16384, - ExportContext = 32768, + Namespace = 32768, + ExportContext = 65536, Modifier = 499, AccessibilityModifier = 112, BlockScoped = 12288, @@ -553,7 +555,7 @@ declare module ts { typeArguments?: NodeArray; arguments: NodeArray; } - interface HeritageClauseElement extends TypeNode { + interface ExpressionWithTypeArguments extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -597,7 +599,7 @@ declare module ts { interface ForStatement extends IterationStatement { initializer?: VariableDeclarationList | Expression; condition?: Expression; - iterator?: Expression; + incrementor?: Expression; } interface ForInStatement extends IterationStatement { initializer: VariableDeclarationList | Expression; @@ -672,7 +674,7 @@ declare module ts { } interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } interface TypeAliasDeclaration extends Declaration, ModuleElement { name: Identifier; @@ -756,6 +758,9 @@ declare module ts { getSourceFile(fileName: string): SourceFile; getCurrentDirectory(): string; } + interface ParseConfigHost { + readDirectory(rootDir: string, extension: string): string[]; + } interface WriteFileCallback { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; } @@ -804,6 +809,7 @@ declare module ts { sourceMapFile: string; sourceMapSourceRoot: string; sourceMapSources: string[]; + sourceMapSourcesContent?: string[]; inputSourceFileNames: string[]; sourceMapNames?: string[]; sourceMapMappings: string; @@ -1005,15 +1011,17 @@ declare module ts { } interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; + } + interface InterfaceTypeWithBaseTypes extends InterfaceType { + baseTypes: ObjectType[]; + } + interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; declaredConstructSignatures: Signature[]; declaredStringIndexType: Type; declaredNumberIndexType: Type; } - interface InterfaceTypeWithBaseTypes extends InterfaceType { - baseTypes: ObjectType[]; - } interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; @@ -1080,11 +1088,15 @@ declare module ts { diagnostics?: boolean; emitBOM?: boolean; help?: boolean; + inlineSourceMap?: boolean; + inlineSources?: boolean; listFiles?: boolean; locale?: string; mapRoot?: string; module?: ModuleKind; + newLine?: NewLineKind; noEmit?: boolean; + noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; noImplicitAny?: boolean; @@ -1110,6 +1122,12 @@ declare module ts { None = 0, CommonJS = 1, AMD = 2, + UMD = 3, + System = 4, + } + const enum NewLineKind { + CarriageReturnLineFeed = 0, + LineFeed = 1, } interface LineAndCharacter { line: number; @@ -1173,6 +1191,32 @@ declare module ts { var sys: System; } declare module ts { + interface ErrorCallback { + (message: DiagnosticMessage, length: number): void; + } + interface Scanner { + getStartPos(): number; + getToken(): SyntaxKind; + getTextPos(): number; + getTokenPos(): number; + getTokenText(): string; + getTokenValue(): string; + hasExtendedUnicodeEscape(): boolean; + hasPrecedingLineBreak(): boolean; + isIdentifier(): boolean; + isReservedWord(): boolean; + isUnterminated(): boolean; + reScanGreaterToken(): SyntaxKind; + reScanSlashToken(): SyntaxKind; + reScanTemplateToken(): SyntaxKind; + scan(): SyntaxKind; + setText(text: string, start?: number, length?: number): void; + setOnError(onError: ErrorCallback): void; + setScriptTarget(scriptTarget: ScriptTarget): void; + setTextPos(textPos: number): void; + lookAhead(callback: () => T): T; + tryScan(callback: () => T): T; + } function tokenToString(t: SyntaxKind): string; function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; @@ -1182,6 +1226,8 @@ declare module ts { function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; + /** Creates a scanner over a (possibly unspecified) range of a piece of text. */ + function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } declare module ts { function getDefaultLibFileName(options: CompilerOptions): string; @@ -1223,7 +1269,7 @@ declare module ts { const version: string; function findConfigFile(searchPath: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program): Diagnostic[]; + function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } @@ -1233,14 +1279,26 @@ declare module ts { * Read tsconfig.json file * @param fileName The path to the config file */ - function readConfigFile(fileName: string): any; + function readConfigFile(fileName: string): { + config?: any; + error?: Diagnostic; + }; + /** + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ + function parseConfigFileText(fileName: string, jsonText: string): { + config?: any; + error?: Diagnostic; + }; /** * Parse the contents of a config file (tsconfig.json). * @param json The contents of the config file to parse * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseConfigFile(json: any, basePath?: string): ParsedCommandLine; + function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine; } declare module ts { /** The version of the language service API */ @@ -1337,8 +1395,16 @@ declare module ts { getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; + /** + * @deprecated Use getEncodedSyntacticClassifications instead. + */ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + /** + * @deprecated Use getEncodedSemanticClassifications instead. + */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; + getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; @@ -1348,6 +1414,7 @@ declare module ts { getRenameInfo(fileName: string, position: number): RenameInfo; findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; findReferences(fileName: string, position: number): ReferencedSymbol[]; getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; @@ -1367,6 +1434,10 @@ declare module ts { getSourceFile(fileName: string): SourceFile; dispose(): void; } + interface Classifications { + spans: number[]; + endOfLineState: EndOfLineState; + } interface ClassifiedSpan { textSpan: TextSpan; classificationType: string; @@ -1578,7 +1649,7 @@ declare module ts { text: string; } const enum EndOfLineState { - Start = 0, + None = 0, InMultiLineCommentTrivia = 1, InSingleQuoteStringLiteral = 2, InDoubleQuoteStringLiteral = 3, @@ -1624,8 +1695,10 @@ declare module ts { * classifications which may be incorrectly categorized will be given * back as Identifiers in order to allow the syntactic classifier to * subsume the classification. + * @deprecated Use getLexicalClassifications instead. */ getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; + getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; } /** * The document registry represents a store of SourceFile objects that can be shared between @@ -1736,7 +1809,27 @@ declare module ts { static interfaceName: string; static moduleName: string; static typeParameterName: string; - static typeAlias: string; + static typeAliasName: string; + static parameterName: string; + } + const enum ClassificationType { + comment = 1, + identifier = 2, + keyword = 3, + numericLiteral = 4, + operator = 5, + stringLiteral = 6, + regularExpressionLiteral = 7, + whiteSpace = 8, + text = 9, + punctuation = 10, + className = 11, + enumName = 12, + interfaceName = 13, + moduleName = 14, + typeParameterName = 15, + typeAliasName = 16, + parameterName = 17, } interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 4d2f3d10827..ba375bc4096 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -145,149 +145,150 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 115] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 116] = "GetKeyword"; SyntaxKind[SyntaxKind["ModuleKeyword"] = 117] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 118] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 119] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 120] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 121] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 122] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 123] = "TypeKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 124] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 125] = "OfKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 118] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 119] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 120] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 121] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 122] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 123] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 124] = "TypeKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 125] = "FromKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 126] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 126] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 127] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 127] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 128] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 128] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 129] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 130] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 129] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 130] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 131] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 131] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 132] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 133] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 134] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 135] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 136] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 137] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 138] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 139] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 140] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 132] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 133] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 134] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 135] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 136] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 137] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 138] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 139] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 140] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 141] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypeReference"] = 141] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 142] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 143] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 144] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 145] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 146] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 147] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 148] = "UnionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 149] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["TypeReference"] = 142] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 143] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 144] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 145] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 146] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 147] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 148] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 149] = "UnionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 150] = "ParenthesizedType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 150] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 151] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 152] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 151] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 152] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 153] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 153] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 154] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 155] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 156] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 157] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 158] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 159] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 160] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 161] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 162] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 163] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 164] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 165] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 166] = "VoidExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 167] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 168] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 169] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 170] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 171] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 172] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 173] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 174] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 175] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 154] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 155] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 156] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 157] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 158] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 159] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 160] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 161] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 162] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 163] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 164] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 165] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 166] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 167] = "VoidExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 168] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 169] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 170] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 171] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 172] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 173] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElementExpression"] = 174] = "SpreadElementExpression"; + SyntaxKind[SyntaxKind["ClassExpression"] = 175] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 176] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 177] = "ExpressionWithTypeArguments"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 176] = "TemplateSpan"; - SyntaxKind[SyntaxKind["HeritageClauseElement"] = 177] = "HeritageClauseElement"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 178] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 178] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 179] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 179] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 180] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 181] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 182] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 183] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 184] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 185] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 186] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 187] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 188] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 189] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 190] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 191] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 192] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 193] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 194] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 195] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 196] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 197] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 198] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 199] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 200] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 201] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 202] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 203] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 204] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 205] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 206] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 207] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 208] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 209] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 210] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 211] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 212] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 213] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 214] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 215] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 216] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 217] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 218] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 180] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 181] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 182] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 183] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 184] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 185] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 186] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 187] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 188] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 189] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 190] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 191] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 192] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 193] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 194] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 195] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 196] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 197] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 198] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 199] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 200] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 201] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 202] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 203] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 204] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 205] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 206] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 207] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 208] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 209] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 210] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 211] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 212] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 213] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 214] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 215] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 216] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 217] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 218] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 219] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 219] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 220] = "ExternalModuleReference"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 220] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 221] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 222] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 223] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 221] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 222] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 223] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 224] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 224] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 225] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 225] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 226] = "ShorthandPropertyAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 226] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 227] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 227] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 228] = "SourceFile"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 228] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 229] = "SyntaxList"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 229] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 230] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 53] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 64] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 66] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 125] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 126] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 142] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 150] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 64] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 125] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 126] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 6] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 7] = "FirstLiteralToken"; @@ -296,7 +297,7 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 13] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 24] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 64] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 126] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 127] = "FirstNode"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -313,7 +314,8 @@ var ts; NodeFlags[NodeFlags["Let"] = 4096] = "Let"; NodeFlags[NodeFlags["Const"] = 8192] = "Const"; NodeFlags[NodeFlags["OctalLiteral"] = 16384] = "OctalLiteral"; - NodeFlags[NodeFlags["ExportContext"] = 32768] = "ExportContext"; + NodeFlags[NodeFlags["Namespace"] = 32768] = "Namespace"; + NodeFlags[NodeFlags["ExportContext"] = 65536] = "ExportContext"; NodeFlags[NodeFlags["Modifier"] = 499] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = 112] = "AccessibilityModifier"; NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; @@ -541,8 +543,15 @@ var ts; ModuleKind[ModuleKind["None"] = 0] = "None"; ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; + ModuleKind[ModuleKind["UMD"] = 3] = "UMD"; + ModuleKind[ModuleKind["System"] = 4] = "System"; })(ts.ModuleKind || (ts.ModuleKind = {})); var ModuleKind = ts.ModuleKind; + (function (NewLineKind) { + NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; + })(ts.NewLineKind || (ts.NewLineKind = {})); + var NewLineKind = ts.NewLineKind; (function (ScriptTarget) { ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; @@ -1133,7 +1142,7 @@ var ts; for (var _i = 0; _i < parts.length; _i++) { var part = parts[_i]; if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + if (part === ".." && normalized.length > 0 && lastOrUndefined(normalized) !== "..") { normalized.pop(); } else { @@ -1240,7 +1249,7 @@ var ts; function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.length--; @@ -1694,7 +1703,7 @@ var ts; A_get_accessor_cannot_have_parameters: { code: 1054, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, + An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: ts.DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: ts.DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, @@ -1755,8 +1764,8 @@ var ts; or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "'{' or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in a namespace cannot reference a module." }, + Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules unless the '--module' flag is provided." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, var_let_or_const_expected: { code: 1152, category: ts.DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, @@ -1798,9 +1807,9 @@ var ts; The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, An_import_declaration_cannot_have_modifiers: { code: 1191, category: ts.DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "External module '{0}' has no default export." }, + Module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no default export." }, An_export_declaration_cannot_have_modifiers: { code: 1193, category: ts.DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." }, + Export_declarations_are_not_permitted_in_a_namespace: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in a namespace." }, Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: ts.DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." }, Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." }, Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, @@ -1809,28 +1818,27 @@ var ts; Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, - Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, + Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." }, Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." }, Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, - Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." }, + Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, + Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." }, Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, Circular_definition_of_import_alias_0: { code: 2303, category: ts.DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, Cannot_find_name_0: { code: 2304, category: ts.DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not a module." }, + Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find module '{0}'." }, A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: ts.DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, @@ -1853,7 +1861,7 @@ var ts; Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: ts.DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: ts.DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible: { code: 2330, category: ts.DiagnosticCategory.Error, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_module_or_namespace_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module or namespace body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, @@ -1945,15 +1953,15 @@ var ts; Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient modules cannot be nested in other modules." }, + Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient module declaration cannot specify relative module name." }, Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, @@ -2007,11 +2015,13 @@ var ts; Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, - External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, - External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, + Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "Module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "Module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." }, + Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "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}'." }, 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}'." }, @@ -2087,6 +2097,7 @@ var ts; Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported file encoding." }, + Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." }, Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, @@ -2100,6 +2111,10 @@ var ts; Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." }, Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." }, Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, + Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." }, + Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -2111,7 +2126,7 @@ var ts; Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" }, Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." }, Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." }, @@ -2132,8 +2147,8 @@ var ts; Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." }, + Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, @@ -2146,6 +2161,9 @@ var ts; Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, + Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." }, + NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" }, + Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -2158,7 +2176,6 @@ var ts; 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." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: ts.DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: ts.DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, _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: { code: 7023, category: ts.DiagnosticCategory.Error, key: "'{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." }, Function_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: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function 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." }, @@ -2214,7 +2231,7 @@ var ts; "false": 80 /* FalseKeyword */, "finally": 81 /* FinallyKeyword */, "for": 82 /* ForKeyword */, - "from": 124 /* FromKeyword */, + "from": 125 /* FromKeyword */, "function": 83 /* FunctionKeyword */, "get": 116 /* GetKeyword */, "if": 84 /* IfKeyword */, @@ -2225,33 +2242,34 @@ var ts; "interface": 103 /* InterfaceKeyword */, "let": 104 /* LetKeyword */, "module": 117 /* ModuleKeyword */, + "namespace": 118 /* NamespaceKeyword */, "new": 88 /* NewKeyword */, "null": 89 /* NullKeyword */, - "number": 119 /* NumberKeyword */, + "number": 120 /* NumberKeyword */, "package": 105 /* PackageKeyword */, "private": 106 /* PrivateKeyword */, "protected": 107 /* ProtectedKeyword */, "public": 108 /* PublicKeyword */, - "require": 118 /* RequireKeyword */, + "require": 119 /* RequireKeyword */, "return": 90 /* ReturnKeyword */, - "set": 120 /* SetKeyword */, + "set": 121 /* SetKeyword */, "static": 109 /* StaticKeyword */, - "string": 121 /* StringKeyword */, + "string": 122 /* StringKeyword */, "super": 91 /* SuperKeyword */, "switch": 92 /* SwitchKeyword */, - "symbol": 122 /* SymbolKeyword */, + "symbol": 123 /* SymbolKeyword */, "this": 93 /* ThisKeyword */, "throw": 94 /* ThrowKeyword */, "true": 95 /* TrueKeyword */, "try": 96 /* TryKeyword */, - "type": 123 /* TypeKeyword */, + "type": 124 /* TypeKeyword */, "typeof": 97 /* TypeOfKeyword */, "var": 98 /* VarKeyword */, "void": 99 /* VoidKeyword */, "while": 100 /* WhileKeyword */, "with": 101 /* WithKeyword */, "yield": 110 /* YieldKeyword */, - "of": 125 /* OfKeyword */, + "of": 126 /* OfKeyword */, "{": 14 /* OpenBraceToken */, "}": 15 /* CloseBraceToken */, "(": 16 /* OpenParenToken */, @@ -2489,7 +2507,7 @@ var ts; function isLineBreak(ch) { // ES5 7.3: // The ECMAScript line terminator characters are listed in Table 3. - // Table 3 � Line Terminator Characters + // Table 3: Line Terminator Characters // Code Unit Value Name Formal Name // \u000A Line Feed // \u000D Carriage Return @@ -2643,7 +2661,7 @@ var ts; } collecting = true; if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } continue; case 9 /* tab */: @@ -2689,7 +2707,7 @@ var ts; default: if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; + ts.lastOrUndefined(result).hasTrailingNewLine = true; } pos++; continue; @@ -2719,8 +2737,7 @@ var ts; ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; - // Creates a scanner over a (possibly unspecified) range of a piece of text. - /* @internal */ + /** Creates a scanner over a (possibly unspecified) range of a piece of text. */ function createScanner(languageVersion, skipTrivia, text, onError, start, length) { var pos; // Current position (end position of text of current token) var end; // end of text @@ -3569,16 +3586,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 203 /* TypeAliasDeclaration */) { + if (node.kind === 203 /* InterfaceDeclaration */ || node.kind === 204 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { + else if ((node.kind === 210 /* ImportDeclaration */ || node.kind === 209 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 206 /* ModuleBlock */) { + else if (node.kind === 207 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -3597,7 +3614,7 @@ var ts; }); return state; } - else if (node.kind === 205 /* ModuleDeclaration */) { + else if (node.kind === 206 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -3652,10 +3669,10 @@ var ts; // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { + if (node.kind === 206 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { return '"' + node.name.text + '"'; } - if (node.name.kind === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -3663,22 +3680,22 @@ var ts; return node.name.text; } switch (node.kind) { - case 143 /* ConstructorType */: - case 135 /* Constructor */: + case 144 /* ConstructorType */: + case 136 /* Constructor */: return "__constructor"; - case 142 /* FunctionType */: - case 138 /* CallSignature */: + case 143 /* FunctionType */: + case 139 /* CallSignature */: return "__call"; - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: return "__new"; - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: return "__index"; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return "__export"; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 200 /* FunctionDeclaration */: - case 201 /* ClassDeclaration */: + case 201 /* FunctionDeclaration */: + case 202 /* ClassDeclaration */: return node.flags & 256 /* Default */ ? "default" : undefined; } } @@ -3713,7 +3730,7 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if ((node.kind === 201 /* ClassDeclaration */ || node.kind === 174 /* ClassExpression */) && symbol.exports) { + if ((node.kind === 202 /* ClassDeclaration */ || node.kind === 175 /* ClassExpression */) && symbol.exports) { // 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. @@ -3733,7 +3750,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1 /* Export */; if (symbolKind & 8388608 /* Alias */) { - if (node.kind === 217 /* ExportSpecifier */ || (node.kind === 208 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 218 /* ExportSpecifier */ || (node.kind === 209 /* ImportEqualsDeclaration */ && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -3752,7 +3769,7 @@ 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 & 32768 /* ExportContext */) { + if (hasExportModifier || container.flags & 65536 /* ExportContext */) { var exportKind = (symbolKind & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | (symbolKind & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolKind & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); @@ -3777,10 +3794,7 @@ var ts; parent = node; if (symbolKind & 262128 /* IsContainer */) { container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; + addToContainerChain(container); } if (isBlockScopeContainer) { // in incremental scenarios we might reuse nodes that already have locals being allocated @@ -3789,50 +3803,56 @@ var ts; // these cases are: // - node has locals (symbolKind & HasLocals) !== 0 // - node is a source file - setBlockScopeContainer(node, (symbolKind & 255504 /* HasLocals */) === 0 && node.kind !== 227 /* SourceFile */); + setBlockScopeContainer(node, (symbolKind & 255504 /* HasLocals */) === 0 && node.kind !== 228 /* SourceFile */); } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } + function addToContainerChain(node) { + if (lastContainer) { + lastContainer.nextContainer = node; + } + lastContainer = node; + } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 174 /* ClassExpression */: - case 201 /* ClassDeclaration */: + case 175 /* ClassExpression */: + case 202 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 145 /* TypeLiteral */: - case 154 /* ObjectLiteralExpression */: - case 202 /* InterfaceDeclaration */: + case 146 /* TypeLiteral */: + case 155 /* ObjectLiteralExpression */: + case 203 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -3847,11 +3867,11 @@ var ts; return false; } function hasExportDeclarations(node) { - var body = node.kind === 227 /* SourceFile */ ? node : node.body; - if (body.kind === 227 /* SourceFile */ || body.kind === 206 /* ModuleBlock */) { + var body = node.kind === 228 /* SourceFile */ ? node : node.body; + if (body.kind === 228 /* SourceFile */ || body.kind === 207 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 215 /* ExportDeclaration */ || stat.kind === 214 /* ExportAssignment */) { + if (stat.kind === 216 /* ExportDeclaration */ || stat.kind === 215 /* ExportAssignment */) { return true; } } @@ -3862,10 +3882,10 @@ var ts; // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular // declarations with export modifiers) is an export context in which declarations are implicitly exported. if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 32768 /* ExportContext */; + node.flags |= 65536 /* ExportContext */; } else { - node.flags &= ~32768 /* ExportContext */; + node.flags &= ~65536 /* ExportContext */; } } function bindModuleDeclaration(node) { @@ -3905,7 +3925,7 @@ var ts; var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 142 /* FunctionType */ ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 143 /* FunctionType */ ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -3917,10 +3937,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -3929,6 +3949,7 @@ var ts; default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); } declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } @@ -3943,14 +3964,14 @@ var ts; function bind(node) { node.parent = parent; switch (node.kind) { - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: bindDeclaration(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */, false); break; - case 129 /* Parameter */: + case 130 /* Parameter */: bindParameter(node); break; - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -3961,72 +3982,72 @@ var ts; bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); } break; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0), 107455 /* PropertyExcludes */, false); break; - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 226 /* EnumMember */: + case 227 /* EnumMember */: bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: bindDeclaration(node, 131072 /* Signature */, 0, false); break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* 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. bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */, true); break; - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 135 /* Constructor */: + case 136 /* Constructor */: bindDeclaration(node, 16384 /* Constructor */, 0, true); break; - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 137 /* SetAccessor */: + case 138 /* SetAccessor */: bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: bindFunctionOrConstructorType(node); break; - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: bindAnonymousDeclaration(node, 32 /* Class */, "__class", false); break; - case 223 /* CatchClause */: + case 224 /* CatchClause */: bindCatchVariableDeclaration(node); break; - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: bindBlockScopedDeclaration(node, 32 /* Class */, 899583 /* ClassExcludes */); break; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: bindDeclaration(node, 64 /* Interface */, 792992 /* InterfaceExcludes */, false); break; - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: bindDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */, false); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: if (ts.isConst(node)) { bindDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */, false); } @@ -4034,16 +4055,16 @@ var ts; bindDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */, false); } break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 208 /* ImportEqualsDeclaration */: - case 211 /* NamespaceImport */: - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 212 /* NamespaceImport */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); break; - case 210 /* ImportClause */: + case 211 /* ImportClause */: if (node.name) { bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); } @@ -4051,14 +4072,14 @@ var ts; bindChildren(node, 0, false); } break; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: if (!node.exportClause) { // All export * declarations are collected in an __export symbol declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0); } bindChildren(node, 0, false); break; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: if (node.expression.kind === 65 /* Identifier */) { // An export default clause with an identifier exports all meanings of that identifier declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); @@ -4069,13 +4090,13 @@ var ts; } bindChildren(node, 0, false); break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: setExportContextFlag(node); if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 179 /* Block */: + case 180 /* Block */: // do not treat function block a block-scope container // all block-scope locals that reside in this block should go to the function locals. // Otherwise this won't be considered as redeclaration of a block scoped local: @@ -4086,11 +4107,11 @@ var ts; // 'let x' will be placed into the function locals and 'let x' - into the locals of the block bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 223 /* CatchClause */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 207 /* CaseBlock */: + case 224 /* CatchClause */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 208 /* CaseBlock */: bindChildren(node, 0, true); break; default: @@ -4110,8 +4131,8 @@ var ts; // If this is a property-parameter, then also declare the property symbol into the // containing class. if (node.flags & 112 /* AccessibilityModifier */ && - node.parent.kind === 135 /* Constructor */ && - (node.parent.parent.kind === 201 /* ClassDeclaration */ || node.parent.parent.kind === 174 /* ClassExpression */)) { + node.parent.kind === 136 /* Constructor */ && + (node.parent.parent.kind === 202 /* ClassDeclaration */ || node.parent.parent.kind === 175 /* ClassExpression */)) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } @@ -4201,7 +4222,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 227 /* SourceFile */) { + while (node && node.kind !== 228 /* SourceFile */) { node = node.parent; } return node; @@ -4311,15 +4332,15 @@ var ts; return current; } switch (current.kind) { - case 227 /* SourceFile */: - case 207 /* CaseBlock */: - case 223 /* CatchClause */: - case 205 /* ModuleDeclaration */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 228 /* SourceFile */: + case 208 /* CaseBlock */: + case 224 /* CatchClause */: + case 206 /* ModuleDeclaration */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: return current; - case 179 /* Block */: + case 180 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { @@ -4332,9 +4353,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 198 /* VariableDeclaration */ && + declaration.kind === 199 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 223 /* CatchClause */; + declaration.parent.kind === 224 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; // Return display name of an identifier @@ -4373,7 +4394,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -4382,16 +4403,16 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: - case 201 /* ClassDeclaration */: - case 174 /* ClassExpression */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 202 /* ClassDeclaration */: + case 175 /* ClassExpression */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: errorNode = node.name; break; } @@ -4415,11 +4436,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 204 /* EnumDeclaration */ && isConst(node); + return node.kind === 205 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 152 /* BindingElement */ || isBindingPattern(node))) { + while (node && (node.kind === 153 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; @@ -4434,14 +4455,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 198 /* VariableDeclaration */) { + if (node.kind === 199 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 199 /* VariableDeclarationList */) { + if (node && node.kind === 200 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 180 /* VariableStatement */) { + if (node && node.kind === 181 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -4456,12 +4477,12 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 182 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; + return node.kind === 183 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { // If parameter/type parameter, the prev token trailing comments are part of this node too - if (node.kind === 129 /* Parameter */ || node.kind === 128 /* TypeParameter */) { + if (node.kind === 130 /* Parameter */ || node.kind === 129 /* TypeParameter */) { // e.g. (/** blah */ a, /** blah */ b); // e.g.: ( // /** blah */ a, @@ -4490,23 +4511,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return visitor(node); - case 207 /* CaseBlock */: - case 179 /* Block */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 192 /* WithStatement */: - case 193 /* SwitchStatement */: - case 220 /* CaseClause */: - case 221 /* DefaultClause */: - case 194 /* LabeledStatement */: - case 196 /* TryStatement */: - case 223 /* CatchClause */: + case 208 /* CaseBlock */: + case 180 /* Block */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 193 /* WithStatement */: + case 194 /* SwitchStatement */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: + case 195 /* LabeledStatement */: + case 197 /* TryStatement */: + case 224 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4515,14 +4536,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 152 /* BindingElement */: - case 226 /* EnumMember */: - case 129 /* Parameter */: - case 224 /* PropertyAssignment */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 225 /* ShorthandPropertyAssignment */: - case 198 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 227 /* EnumMember */: + case 130 /* Parameter */: + case 225 /* PropertyAssignment */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 226 /* ShorthandPropertyAssignment */: + case 199 /* VariableDeclaration */: return true; } } @@ -4532,8 +4553,8 @@ var ts; function isAccessor(node) { if (node) { switch (node.kind) { - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return true; } } @@ -4543,22 +4564,22 @@ var ts; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 135 /* Constructor */: - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 200 /* FunctionDeclaration */: + case 136 /* Constructor */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: return true; } } @@ -4566,11 +4587,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 179 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 180 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 134 /* MethodDeclaration */ && node.parent.kind === 154 /* ObjectLiteralExpression */; + return node && node.kind === 135 /* MethodDeclaration */ && node.parent.kind === 155 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -4589,12 +4610,12 @@ var ts; return undefined; } switch (node.kind) { - case 127 /* ComputedPropertyName */: + case 128 /* 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 // so that we can error on it. - if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.parent.kind === 202 /* ClassDeclaration */) { return node; } // If this is a computed property, then the parent should not @@ -4604,9 +4625,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 130 /* Decorator */: + case 131 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 130 /* 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; @@ -4617,23 +4638,23 @@ var ts; node = node.parent; } break; - case 163 /* ArrowFunction */: + case 164 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // Fall through - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 205 /* ModuleDeclaration */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 204 /* EnumDeclaration */: - case 227 /* SourceFile */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 206 /* ModuleDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 205 /* EnumDeclaration */: + case 228 /* SourceFile */: return node; } } @@ -4645,12 +4666,12 @@ var ts; if (!node) return node; switch (node.kind) { - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'super' container. // A computed property name in a class needs to be a super container // so that we can error on it. - if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.parent.kind === 202 /* ClassDeclaration */) { return node; } // If this is a computed property, then the parent should not @@ -4660,9 +4681,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 130 /* Decorator */: + case 131 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 130 /* 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; @@ -4673,26 +4694,26 @@ var ts; node = node.parent; } break; - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: if (!includeFunctions) { continue; } - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* TaggedTemplateExpression */) { return node.tag; } // Will either be a CallExpression or NewExpression. @@ -4701,44 +4722,44 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: // classes are valid targets return true; - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 201 /* ClassDeclaration */; - case 129 /* Parameter */: + return node.parent.kind === 202 /* ClassDeclaration */; + case 130 /* 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 === 201 /* ClassDeclaration */; - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 134 /* MethodDeclaration */: + return node.parent.body && node.parent.parent.kind === 202 /* ClassDeclaration */; + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 135 /* 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 === 201 /* ClassDeclaration */; + return node.body && node.parent.kind === 202 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: if (node.decorators) { return true; } return false; - case 132 /* PropertyDeclaration */: - case 129 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 130 /* Parameter */: if (node.decorators) { return true; } return false; - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: if (node.body && node.decorators) { return true; } return false; - case 134 /* MethodDeclaration */: - case 137 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 138 /* SetAccessor */: if (node.body && node.decorators) { return true; } @@ -4749,10 +4770,10 @@ var ts; ts.nodeIsDecorated = nodeIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 134 /* MethodDeclaration */: - case 137 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 138 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } return false; @@ -4770,37 +4791,37 @@ var ts; case 95 /* TrueKeyword */: case 80 /* FalseKeyword */: case 9 /* RegularExpressionLiteral */: - case 153 /* ArrayLiteralExpression */: - case 154 /* ObjectLiteralExpression */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 159 /* TaggedTemplateExpression */: - case 160 /* TypeAssertionExpression */: - case 161 /* ParenthesizedExpression */: - case 162 /* FunctionExpression */: - case 174 /* ClassExpression */: - case 163 /* ArrowFunction */: - case 166 /* VoidExpression */: - case 164 /* DeleteExpression */: - case 165 /* TypeOfExpression */: - case 167 /* PrefixUnaryExpression */: - case 168 /* PostfixUnaryExpression */: - case 169 /* BinaryExpression */: - case 170 /* ConditionalExpression */: - case 173 /* SpreadElementExpression */: - case 171 /* TemplateExpression */: + case 154 /* ArrayLiteralExpression */: + case 155 /* ObjectLiteralExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 160 /* TaggedTemplateExpression */: + case 161 /* TypeAssertionExpression */: + case 162 /* ParenthesizedExpression */: + case 163 /* FunctionExpression */: + case 175 /* ClassExpression */: + case 164 /* ArrowFunction */: + case 167 /* VoidExpression */: + case 165 /* DeleteExpression */: + case 166 /* TypeOfExpression */: + case 168 /* PrefixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: + case 170 /* BinaryExpression */: + case 171 /* ConditionalExpression */: + case 174 /* SpreadElementExpression */: + case 172 /* TemplateExpression */: case 10 /* NoSubstitutionTemplateLiteral */: - case 175 /* OmittedExpression */: + case 176 /* OmittedExpression */: return true; - case 126 /* QualifiedName */: - while (node.parent.kind === 126 /* QualifiedName */) { + case 127 /* QualifiedName */: + while (node.parent.kind === 127 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 144 /* TypeQuery */; + return node.parent.kind === 145 /* TypeQuery */; case 65 /* Identifier */: - if (node.parent.kind === 144 /* TypeQuery */) { + if (node.parent.kind === 145 /* TypeQuery */) { return true; } // fall through @@ -4808,42 +4829,42 @@ var ts; case 8 /* StringLiteral */: var parent_1 = node.parent; switch (parent_1.kind) { - case 198 /* VariableDeclaration */: - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 226 /* EnumMember */: - case 224 /* PropertyAssignment */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 227 /* EnumMember */: + case 225 /* PropertyAssignment */: + case 153 /* BindingElement */: return parent_1.initializer === node; - case 182 /* ExpressionStatement */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 191 /* ReturnStatement */: - case 192 /* WithStatement */: - case 193 /* SwitchStatement */: - case 220 /* CaseClause */: - case 195 /* ThrowStatement */: - case 193 /* SwitchStatement */: + case 183 /* ExpressionStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 192 /* ReturnStatement */: + case 193 /* WithStatement */: + case 194 /* SwitchStatement */: + case 221 /* CaseClause */: + case 196 /* ThrowStatement */: + case 194 /* SwitchStatement */: return parent_1.expression === node; - case 186 /* ForStatement */: + case 187 /* ForStatement */: var forStatement = parent_1; - return (forStatement.initializer === node && forStatement.initializer.kind !== 199 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 200 /* VariableDeclarationList */) || forStatement.condition === node || - forStatement.iterator === node; - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + forStatement.incrementor === node; + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: var forInStatement = parent_1; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 200 /* VariableDeclarationList */) || forInStatement.expression === node; - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return node === parent_1.expression; - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return node === parent_1.expression; - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: return node === parent_1.expression; - case 130 /* Decorator */: + case 131 /* Decorator */: return true; default: if (isExpression(parent_1)) { @@ -4861,7 +4882,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */; + return node.kind === 209 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 220 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4870,40 +4891,40 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 219 /* ExternalModuleReference */; + return node.kind === 209 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 220 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 209 /* ImportDeclaration */) { + if (node.kind === 210 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 208 /* ImportEqualsDeclaration */) { + if (node.kind === 209 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 219 /* ExternalModuleReference */) { + if (reference.kind === 220 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 215 /* ExportDeclaration */) { + if (node.kind === 216 /* ExportDeclaration */) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 129 /* Parameter */ && node.dotDotDotToken !== undefined; + return node && node.kind === 130 /* Parameter */ && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 129 /* Parameter */: + case 130 /* Parameter */: return node.questionToken !== undefined; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return node.questionToken !== undefined; - case 225 /* ShorthandPropertyAssignment */: - case 224 /* PropertyAssignment */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 226 /* ShorthandPropertyAssignment */: + case 225 /* PropertyAssignment */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -4911,7 +4932,7 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function hasRestParameters(s) { - return s.parameters.length > 0 && s.parameters[s.parameters.length - 1].dotDotDotToken !== undefined; + return s.parameters.length > 0 && ts.lastOrUndefined(s.parameters).dotDotDotToken !== undefined; } ts.hasRestParameters = hasRestParameters; function isLiteralKind(kind) { @@ -4927,7 +4948,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 151 /* ArrayBindingPattern */ || node.kind === 150 /* ObjectBindingPattern */); + return !!node && (node.kind === 152 /* ArrayBindingPattern */ || node.kind === 151 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { @@ -4942,33 +4963,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 163 /* ArrowFunction */: - case 152 /* BindingElement */: - case 201 /* ClassDeclaration */: - case 135 /* Constructor */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 217 /* ExportSpecifier */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 136 /* GetAccessor */: - case 210 /* ImportClause */: - case 208 /* ImportEqualsDeclaration */: - case 213 /* ImportSpecifier */: - case 202 /* InterfaceDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 205 /* ModuleDeclaration */: - case 211 /* NamespaceImport */: - case 129 /* Parameter */: - case 224 /* PropertyAssignment */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 137 /* SetAccessor */: - case 225 /* ShorthandPropertyAssignment */: - case 203 /* TypeAliasDeclaration */: - case 128 /* TypeParameter */: - case 198 /* VariableDeclaration */: + case 164 /* ArrowFunction */: + case 153 /* BindingElement */: + case 202 /* ClassDeclaration */: + case 136 /* Constructor */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 218 /* ExportSpecifier */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 137 /* GetAccessor */: + case 211 /* ImportClause */: + case 209 /* ImportEqualsDeclaration */: + case 214 /* ImportSpecifier */: + case 203 /* InterfaceDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 206 /* ModuleDeclaration */: + case 212 /* NamespaceImport */: + case 130 /* Parameter */: + case 225 /* PropertyAssignment */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 138 /* SetAccessor */: + case 226 /* ShorthandPropertyAssignment */: + case 204 /* TypeAliasDeclaration */: + case 129 /* TypeParameter */: + case 199 /* VariableDeclaration */: return true; } return false; @@ -4976,25 +4997,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: - case 197 /* DebuggerStatement */: - case 184 /* DoStatement */: - case 182 /* ExpressionStatement */: - case 181 /* EmptyStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 186 /* ForStatement */: - case 183 /* IfStatement */: - case 194 /* LabeledStatement */: - case 191 /* ReturnStatement */: - case 193 /* SwitchStatement */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 198 /* DebuggerStatement */: + case 185 /* DoStatement */: + case 183 /* ExpressionStatement */: + case 182 /* EmptyStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 187 /* ForStatement */: + case 184 /* IfStatement */: + case 195 /* LabeledStatement */: + case 192 /* ReturnStatement */: + case 194 /* SwitchStatement */: case 94 /* ThrowKeyword */: - case 196 /* TryStatement */: - case 180 /* VariableStatement */: - case 185 /* WhileStatement */: - case 192 /* WithStatement */: - case 214 /* ExportAssignment */: + case 197 /* TryStatement */: + case 181 /* VariableStatement */: + case 186 /* WhileStatement */: + case 193 /* WithStatement */: + case 215 /* ExportAssignment */: return true; default: return false; @@ -5003,13 +5024,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 135 /* Constructor */: - case 132 /* PropertyDeclaration */: - case 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 133 /* MethodSignature */: - case 140 /* IndexSignature */: + case 136 /* Constructor */: + case 133 /* PropertyDeclaration */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 134 /* MethodSignature */: + case 141 /* IndexSignature */: return true; default: return false; @@ -5022,7 +5043,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 213 /* ImportSpecifier */ || parent.kind === 217 /* ExportSpecifier */) { + if (parent.kind === 214 /* ImportSpecifier */ || parent.kind === 218 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -5042,12 +5063,12 @@ var ts; // export = ... // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 208 /* ImportEqualsDeclaration */ || - node.kind === 210 /* ImportClause */ && !!node.name || - node.kind === 211 /* NamespaceImport */ || - node.kind === 213 /* ImportSpecifier */ || - node.kind === 217 /* ExportSpecifier */ || - node.kind === 214 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; + return node.kind === 209 /* ImportEqualsDeclaration */ || + node.kind === 211 /* ImportClause */ && !!node.name || + node.kind === 212 /* NamespaceImport */ || + node.kind === 214 /* ImportSpecifier */ || + node.kind === 218 /* ExportSpecifier */ || + node.kind === 215 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -5130,7 +5151,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 66 /* FirstKeyword */ <= token && token <= 125 /* LastKeyword */; + return 66 /* FirstKeyword */ <= token && token <= 126 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -5146,7 +5167,7 @@ var ts; */ function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 127 /* ComputedPropertyName */ && + declaration.name.kind === 128 /* ComputedPropertyName */ && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; @@ -5156,14 +5177,14 @@ var ts; * where Symbol is literally the word "Symbol", and name is any identifierName */ function isWellKnownSymbolSyntactically(node) { - return node.kind === 155 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); + return node.kind === 156 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { if (name.kind === 65 /* Identifier */ || name.kind === 8 /* StringLiteral */ || name.kind === 7 /* NumericLiteral */) { return name.text; } - if (name.kind === 127 /* ComputedPropertyName */) { + if (name.kind === 128 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -5200,7 +5221,7 @@ var ts; } ts.isModifier = isModifier; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 205 /* ModuleDeclaration */ || n.kind === 227 /* SourceFile */; + return isFunctionLike(n) || n.kind === 206 /* ModuleDeclaration */ || n.kind === 228 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -5375,7 +5396,7 @@ var ts; var lineStartsOfS = ts.computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); } } } @@ -5436,7 +5457,7 @@ var ts; ts.getLineOfLocalPosition = getLineOfLocalPosition; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 135 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 136 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -5444,8 +5465,10 @@ var ts; ts.getFirstConstructorWithBody = getFirstConstructorWithBody; function shouldEmitToOwnFile(sourceFile, compilerOptions) { if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - return true; + if ((isExternalModule(sourceFile) || !compilerOptions.out)) { + // 1. in-browser single file compilation scenario + // 2. non .js file + return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js"); } return false; } @@ -5459,10 +5482,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 136 /* GetAccessor */) { + if (accessor.kind === 137 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 137 /* SetAccessor */) { + else if (accessor.kind === 138 /* SetAccessor */) { setAccessor = accessor; } else { @@ -5471,7 +5494,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) + if ((member.kind === 137 /* GetAccessor */ || member.kind === 138 /* SetAccessor */) && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -5482,10 +5505,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 136 /* GetAccessor */ && !getAccessor) { + if (member.kind === 137 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 137 /* SetAccessor */ && !setAccessor) { + if (member.kind === 138 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -5633,22 +5656,22 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 158 /* NewExpression */: - case 157 /* CallExpression */: - case 159 /* TaggedTemplateExpression */: - case 153 /* ArrayLiteralExpression */: - case 161 /* ParenthesizedExpression */: - case 154 /* ObjectLiteralExpression */: - case 174 /* ClassExpression */: - case 162 /* FunctionExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 159 /* NewExpression */: + case 158 /* CallExpression */: + case 160 /* TaggedTemplateExpression */: + case 154 /* ArrayLiteralExpression */: + case 162 /* ParenthesizedExpression */: + case 155 /* ObjectLiteralExpression */: + case 175 /* ClassExpression */: + case 163 /* FunctionExpression */: case 65 /* Identifier */: case 9 /* RegularExpressionLiteral */: case 7 /* NumericLiteral */: case 8 /* StringLiteral */: case 10 /* NoSubstitutionTemplateLiteral */: - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: case 80 /* FalseKeyword */: case 89 /* NullKeyword */: case 93 /* ThisKeyword */: @@ -5666,30 +5689,97 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; // Returns false if this heritage clause element's expression contains something unsupported // (i.e. not a name or dotted name). - function isSupportedHeritageClauseElement(node) { - return isSupportedHeritageClauseElementExpression(node.expression); + function isSupportedExpressionWithTypeArguments(node) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } - ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; - function isSupportedHeritageClauseElementExpression(node) { + ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; + function isSupportedExpressionWithTypeArgumentsRest(node) { if (node.kind === 65 /* Identifier */) { return true; } - else if (node.kind === 155 /* PropertyAccessExpression */) { - return isSupportedHeritageClauseElementExpression(node.expression); + else if (node.kind === 156 /* PropertyAccessExpression */) { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } else { return false; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function getLocalSymbolForExportDefault(symbol) { return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + /** + * Replace each instance of non-ascii characters by one, two, three, or four escape sequences + * representing the UTF-8 encoding of the character, and return the expanded char code list. + */ + function getExpandedCharCodes(input) { + var output = []; + var length = input.length; + var leadSurrogate = undefined; + for (var i = 0; i < length; i++) { + var charCode = input.charCodeAt(i); + // handel utf8 + if (charCode < 0x80) { + output.push(charCode); + } + else if (charCode < 0x800) { + output.push((charCode >> 6) | 192); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x10000) { + output.push((charCode >> 12) | 224); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else if (charCode < 0x20000) { + output.push((charCode >> 18) | 240); + output.push(((charCode >> 12) & 63) | 128); + output.push(((charCode >> 6) & 63) | 128); + output.push((charCode & 63) | 128); + } + else { + ts.Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + /** + * Converts a string to a base-64 encoded ASCII string. + */ + function convertToBase64(input) { + var result = ""; + var charCodes = getExpandedCharCodes(input); + var i = 0; + var length = charCodes.length; + var byte1, byte2, byte3, byte4; + while (i < length) { + // Convert every 6-bits in the input 3 character points + // into a base64 digit + byte1 = charCodes[i] >> 2; + byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; + byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; + byte4 = charCodes[i + 2] & 63; + // We are out of characters in the input, set the extra + // digits to 64 (padding character). + if (i + 1 >= length) { + byte3 = byte4 = 64; + } + else if (i + 2 >= length) { + byte4 = 64; + } + // Write to the ouput + result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i += 3; + } + return result; + } + ts.convertToBase64 = convertToBase64; })(ts || (ts = {})); var ts; (function (ts) { @@ -5901,7 +5991,7 @@ var ts; /// var ts; (function (ts) { - var nodeConstructors = new Array(229 /* Count */); + var nodeConstructors = new Array(230 /* Count */); /* @internal */ ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -5946,20 +6036,20 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5968,24 +6058,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5996,220 +6086,220 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 141 /* TypeReference */: + case 142 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 147 /* TupleType */: + case 148 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 148 /* UnionType */: + case 149 /* UnionType */: return visitNodes(cbNodes, node.types); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 155 /* PropertyAccessExpression */: + case 156 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 164 /* DeleteExpression */: + case 165 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 165 /* TypeOfExpression */: + case 166 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 166 /* VoidExpression */: + case 167 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 172 /* YieldExpression */: + case 173 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 168 /* PostfixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 173 /* SpreadElementExpression */: + case 174 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 227 /* SourceFile */: + case 228 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 199 /* VariableDeclarationList */: + case 200 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 183 /* IfStatement */: + case 184 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 184 /* DoStatement */: + case 185 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || + visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 187 /* ForInStatement */: + case 188 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 188 /* ForOfStatement */: + case 189 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: return visitNode(cbNode, node.label); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 192 /* WithStatement */: + case 193 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 207 /* CaseBlock */: + case 208 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 220 /* CaseClause */: + case 221 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 221 /* DefaultClause */: + case 222 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 196 /* TryStatement */: + case 197 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 130 /* Decorator */: + case 131 /* Decorator */: return visitNode(cbNode, node.expression); - case 201 /* ClassDeclaration */: - case 174 /* ClassExpression */: + case 202 /* ClassDeclaration */: + case 175 /* 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 202 /* InterfaceDeclaration */: + case 203 /* 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 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 210 /* ImportClause */: + case 211 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 211 /* NamespaceImport */: + case 212 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 212 /* NamedImports */: - case 216 /* NamedExports */: + case 213 /* NamedImports */: + case 217 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 222 /* HeritageClause */: + case 223 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 177 /* HeritageClauseElement */: + case 177 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 219 /* ExternalModuleReference */: + case 220 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 218 /* MissingDeclaration */: + case 219 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); } } @@ -6388,7 +6478,7 @@ var ts; } } function createSourceFile(fileName, languageVersion) { - sourceFile = createNode(227 /* SourceFile */, 0); + sourceFile = createNode(228 /* SourceFile */, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -6730,7 +6820,7 @@ var ts; // ComputedPropertyName[Yield] : // [ AssignmentExpression[In, ?Yield] ] // - var node = createNode(127 /* ComputedPropertyName */); + var node = createNode(128 /* ComputedPropertyName */); parseExpected(18 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -7122,14 +7212,14 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 209 /* ImportDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 215 /* ExportDeclaration */: - case 214 /* ExportAssignment */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 216 /* ExportDeclaration */: + case 215 /* ExportAssignment */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: return true; } return isReusableStatement(node); @@ -7139,13 +7229,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 135 /* Constructor */: - case 140 /* IndexSignature */: - case 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 132 /* PropertyDeclaration */: - case 178 /* SemicolonClassElement */: + case 136 /* Constructor */: + case 141 /* IndexSignature */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 179 /* SemicolonClassElement */: return true; } } @@ -7154,8 +7244,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: return true; } } @@ -7164,49 +7254,49 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 180 /* VariableStatement */: - case 179 /* Block */: - case 183 /* IfStatement */: - case 182 /* ExpressionStatement */: - case 195 /* ThrowStatement */: - case 191 /* ReturnStatement */: - case 193 /* SwitchStatement */: - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 186 /* ForStatement */: - case 185 /* WhileStatement */: - case 192 /* WithStatement */: - case 181 /* EmptyStatement */: - case 196 /* TryStatement */: - case 194 /* LabeledStatement */: - case 184 /* DoStatement */: - case 197 /* DebuggerStatement */: + case 201 /* FunctionDeclaration */: + case 181 /* VariableStatement */: + case 180 /* Block */: + case 184 /* IfStatement */: + case 183 /* ExpressionStatement */: + case 196 /* ThrowStatement */: + case 192 /* ReturnStatement */: + case 194 /* SwitchStatement */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 187 /* ForStatement */: + case 186 /* WhileStatement */: + case 193 /* WithStatement */: + case 182 /* EmptyStatement */: + case 197 /* TryStatement */: + case 195 /* LabeledStatement */: + case 185 /* DoStatement */: + case 198 /* DebuggerStatement */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 226 /* EnumMember */; + return node.kind === 227 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 139 /* ConstructSignature */: - case 133 /* MethodSignature */: - case 140 /* IndexSignature */: - case 131 /* PropertySignature */: - case 138 /* CallSignature */: + case 140 /* ConstructSignature */: + case 134 /* MethodSignature */: + case 141 /* IndexSignature */: + case 132 /* PropertySignature */: + case 139 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 198 /* VariableDeclaration */) { + if (node.kind !== 199 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -7227,7 +7317,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 129 /* Parameter */) { + if (node.kind !== 130 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -7339,7 +7429,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(20 /* DotToken */)) { - var node = createNode(126 /* QualifiedName */, entity.pos); + var node = createNode(127 /* QualifiedName */, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -7378,20 +7468,20 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(171 /* TemplateExpression */); + var template = createNode(172 /* TemplateExpression */); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 11 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); do { templateSpans.push(parseTemplateSpan()); - } while (templateSpans[templateSpans.length - 1].literal.kind === 12 /* TemplateMiddle */); + } while (ts.lastOrUndefined(templateSpans).literal.kind === 12 /* TemplateMiddle */); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(176 /* TemplateSpan */); + var span = createNode(178 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token === 15 /* CloseBraceToken */) { @@ -7432,7 +7522,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(141 /* TypeReference */); + var node = createNode(142 /* TypeReference */); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token === 24 /* LessThanToken */) { node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); @@ -7440,13 +7530,13 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(144 /* TypeQuery */); + var node = createNode(145 /* TypeQuery */); parseExpected(97 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(128 /* TypeParameter */); + var node = createNode(129 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(79 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -7492,7 +7582,7 @@ var ts; } } function parseParameter() { - var node = createNode(129 /* Parameter */); + var node = createNode(130 /* Parameter */); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); @@ -7589,7 +7679,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 139 /* ConstructSignature */) { + if (kind === 140 /* ConstructSignature */) { parseExpected(88 /* NewKeyword */); } fillSignature(51 /* ColonToken */, false, false, node); @@ -7653,7 +7743,7 @@ var ts; return token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || token === 19 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(140 /* IndexSignature */, fullStart); + var node = createNode(141 /* IndexSignature */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(15 /* Parameters */, parseParameter, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); @@ -7666,7 +7756,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(50 /* QuestionToken */); if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { - var method = createNode(133 /* MethodSignature */, fullStart); + var method = createNode(134 /* MethodSignature */, fullStart); method.name = name; method.questionToken = questionToken; // Method signatues don't exist in expression contexts. So they have neither @@ -7676,7 +7766,7 @@ var ts; return finishNode(method); } else { - var property = createNode(131 /* PropertySignature */, fullStart); + var property = createNode(132 /* PropertySignature */, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -7718,7 +7808,7 @@ var ts; switch (token) { case 16 /* OpenParenToken */: case 24 /* LessThanToken */: - return parseSignatureMember(138 /* CallSignature */); + return parseSignatureMember(139 /* CallSignature */); case 18 /* OpenBracketToken */: // Indexer or computed property return isIndexSignature() @@ -7726,7 +7816,7 @@ var ts; : parsePropertyOrMethodSignature(); case 88 /* NewKeyword */: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(139 /* ConstructSignature */); + return parseSignatureMember(140 /* ConstructSignature */); } // fall through. case 8 /* StringLiteral */: @@ -7763,7 +7853,7 @@ var ts; return token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(145 /* TypeLiteral */); + var node = createNode(146 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -7779,12 +7869,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(147 /* TupleType */); + var node = createNode(148 /* TupleType */); node.elementTypes = parseBracketedList(18 /* TupleElementTypes */, parseType, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(149 /* ParenthesizedType */); + var node = createNode(150 /* ParenthesizedType */); parseExpected(16 /* OpenParenToken */); node.type = parseType(); parseExpected(17 /* CloseParenToken */); @@ -7792,7 +7882,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 143 /* ConstructorType */) { + if (kind === 144 /* ConstructorType */) { parseExpected(88 /* NewKeyword */); } fillSignature(32 /* EqualsGreaterThanToken */, false, false, node); @@ -7805,10 +7895,10 @@ var ts; function parseNonArrayType() { switch (token) { case 112 /* AnyKeyword */: - case 121 /* StringKeyword */: - case 119 /* NumberKeyword */: + case 122 /* StringKeyword */: + case 120 /* NumberKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); @@ -7829,10 +7919,10 @@ var ts; function isStartOfType() { switch (token) { case 112 /* AnyKeyword */: - case 121 /* StringKeyword */: - case 119 /* NumberKeyword */: + case 122 /* StringKeyword */: + case 120 /* NumberKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: case 99 /* VoidKeyword */: case 97 /* TypeOfKeyword */: case 14 /* OpenBraceToken */: @@ -7856,7 +7946,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(18 /* OpenBracketToken */)) { parseExpected(19 /* CloseBracketToken */); - var node = createNode(146 /* ArrayType */, type.pos); + var node = createNode(147 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -7871,7 +7961,7 @@ var ts; types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(148 /* UnionType */, type.pos); + var node = createNode(149 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } @@ -7926,10 +8016,10 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(142 /* FunctionType */); + return parseFunctionOrConstructorType(143 /* FunctionType */); } if (token === 88 /* NewKeyword */) { - return parseFunctionOrConstructorType(143 /* ConstructorType */); + return parseFunctionOrConstructorType(144 /* ConstructorType */); } return parseUnionTypeOrHigher(); } @@ -8131,7 +8221,7 @@ var ts; (isIdentifier() || token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */); } function parseYieldExpression() { - var node = createNode(172 /* YieldExpression */); + var node = createNode(173 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -8151,8 +8241,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 32 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(163 /* ArrowFunction */, identifier.pos); - var parameter = createNode(129 /* Parameter */, identifier.pos); + var node = createNode(164 /* ArrowFunction */, identifier.pos); + var parameter = createNode(130 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -8270,7 +8360,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(163 /* ArrowFunction */); + var node = createNode(164 /* ArrowFunction */); // Arrow functions are never generators. // // If we're speculatively parsing a signature for a parenthesized arrow function, then @@ -8331,7 +8421,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(170 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(171 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -8344,7 +8434,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 86 /* InKeyword */ || t === 125 /* OfKeyword */; + return t === 86 /* InKeyword */ || t === 126 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -8410,33 +8500,33 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(169 /* BinaryExpression */, left.pos); + var node = createNode(170 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(167 /* PrefixUnaryExpression */); + var node = createNode(168 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(164 /* DeleteExpression */); + var node = createNode(165 /* DeleteExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(165 /* TypeOfExpression */); + var node = createNode(166 /* TypeOfExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(166 /* VoidExpression */); + var node = createNode(167 /* VoidExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); @@ -8466,7 +8556,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 38 /* PlusPlusToken */ || token === 39 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(168 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(169 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -8570,14 +8660,14 @@ 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(155 /* PropertyAccessExpression */, expression.pos); + var node = createNode(156 /* PropertyAccessExpression */, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(20 /* DotToken */, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } function parseTypeAssertion() { - var node = createNode(160 /* TypeAssertionExpression */); + var node = createNode(161 /* TypeAssertionExpression */); parseExpected(24 /* LessThanToken */); node.type = parseType(); parseExpected(25 /* GreaterThanToken */); @@ -8588,7 +8678,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(20 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(155 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(156 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -8597,7 +8687,7 @@ var ts; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(18 /* OpenBracketToken */)) { - var indexedAccess = createNode(156 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(157 /* 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. @@ -8613,7 +8703,7 @@ var ts; continue; } if (token === 10 /* NoSubstitutionTemplateLiteral */ || token === 11 /* TemplateHead */) { - var tagExpression = createNode(159 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(160 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 10 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -8636,7 +8726,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(157 /* CallExpression */, expression.pos); + var callExpr = createNode(158 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -8644,7 +8734,7 @@ var ts; continue; } else if (token === 16 /* OpenParenToken */) { - var callExpr = createNode(157 /* CallExpression */, expression.pos); + var callExpr = createNode(158 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -8746,28 +8836,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(161 /* ParenthesizedExpression */); + var node = createNode(162 /* ParenthesizedExpression */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(173 /* SpreadElementExpression */); + var node = createNode(174 /* SpreadElementExpression */); parseExpected(21 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 21 /* DotDotDotToken */ ? parseSpreadElement() : - token === 23 /* CommaToken */ ? createNode(175 /* OmittedExpression */) : + token === 23 /* CommaToken */ ? createNode(176 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(153 /* ArrayLiteralExpression */); + var node = createNode(154 /* ArrayLiteralExpression */); parseExpected(18 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 512 /* MultiLine */; @@ -8777,10 +8867,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(116 /* GetKeyword */)) { - return parseAccessorDeclaration(136 /* GetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(137 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(120 /* SetKeyword */)) { - return parseAccessorDeclaration(137 /* SetAccessor */, fullStart, decorators, modifiers); + else if (parseContextualModifier(121 /* SetKeyword */)) { + return parseAccessorDeclaration(138 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -8803,13 +8893,13 @@ var ts; } // Parse to check if it is short-hand property assignment or normal property assignment if ((token === 23 /* CommaToken */ || token === 15 /* CloseBraceToken */) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(225 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(226 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(224 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(225 /* PropertyAssignment */, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51 /* ColonToken */); @@ -8818,7 +8908,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(154 /* ObjectLiteralExpression */); + var node = createNode(155 /* ObjectLiteralExpression */); parseExpected(14 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 512 /* MultiLine */; @@ -8836,7 +8926,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(162 /* FunctionExpression */); + var node = createNode(163 /* FunctionExpression */); parseExpected(83 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); @@ -8851,7 +8941,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(158 /* NewExpression */); + var node = createNode(159 /* NewExpression */); parseExpected(88 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -8862,7 +8952,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(179 /* Block */); + var node = createNode(180 /* Block */); if (parseExpected(14 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); parseExpected(15 /* CloseBraceToken */); @@ -8889,12 +8979,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(181 /* EmptyStatement */); + var node = createNode(182 /* EmptyStatement */); parseExpected(22 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(183 /* IfStatement */); + var node = createNode(184 /* IfStatement */); parseExpected(84 /* IfKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -8904,7 +8994,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(184 /* DoStatement */); + var node = createNode(185 /* DoStatement */); parseExpected(75 /* DoKeyword */); node.statement = parseStatement(); parseExpected(100 /* WhileKeyword */); @@ -8919,7 +9009,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(185 /* WhileStatement */); + var node = createNode(186 /* WhileStatement */); parseExpected(100 /* WhileKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -8942,21 +9032,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(86 /* InKeyword */)) { - var forInStatement = createNode(187 /* ForInStatement */, pos); + var forInStatement = createNode(188 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(125 /* OfKeyword */)) { - var forOfStatement = createNode(188 /* ForOfStatement */, pos); + else if (parseOptional(126 /* OfKeyword */)) { + var forOfStatement = createNode(189 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(186 /* ForStatement */, pos); + var forStatement = createNode(187 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(22 /* SemicolonToken */); if (token !== 22 /* SemicolonToken */ && token !== 17 /* CloseParenToken */) { @@ -8964,7 +9054,7 @@ var ts; } parseExpected(22 /* SemicolonToken */); if (token !== 17 /* CloseParenToken */) { - forStatement.iterator = allowInAnd(parseExpression); + forStatement.incrementor = allowInAnd(parseExpression); } parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forStatement; @@ -8974,7 +9064,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); + parseExpected(kind === 191 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -8982,7 +9072,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(191 /* ReturnStatement */); + var node = createNode(192 /* ReturnStatement */); parseExpected(90 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -8991,7 +9081,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(192 /* WithStatement */); + var node = createNode(193 /* WithStatement */); parseExpected(101 /* WithKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -9000,7 +9090,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(220 /* CaseClause */); + var node = createNode(221 /* CaseClause */); parseExpected(67 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(51 /* ColonToken */); @@ -9008,7 +9098,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(221 /* DefaultClause */); + var node = createNode(222 /* DefaultClause */); parseExpected(73 /* DefaultKeyword */); parseExpected(51 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); @@ -9018,12 +9108,12 @@ var ts; return token === 67 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(193 /* SwitchStatement */); + var node = createNode(194 /* SwitchStatement */); parseExpected(92 /* SwitchKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(17 /* CloseParenToken */); - var caseBlock = createNode(207 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(208 /* CaseBlock */, scanner.getStartPos()); parseExpected(14 /* OpenBraceToken */); caseBlock.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); parseExpected(15 /* CloseBraceToken */); @@ -9038,7 +9128,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(195 /* ThrowStatement */); + var node = createNode(196 /* ThrowStatement */); parseExpected(94 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -9046,7 +9136,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(196 /* TryStatement */); + var node = createNode(197 /* TryStatement */); parseExpected(96 /* TryKeyword */); node.tryBlock = parseBlock(false, false); node.catchClause = token === 68 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -9059,7 +9149,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(223 /* CatchClause */); + var result = createNode(224 /* CatchClause */); parseExpected(68 /* CatchKeyword */); if (parseExpected(16 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -9069,7 +9159,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(197 /* DebuggerStatement */); + var node = createNode(198 /* DebuggerStatement */); parseExpected(72 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -9081,13 +9171,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 65 /* Identifier */ && parseOptional(51 /* ColonToken */)) { - var labeledStatement = createNode(194 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(195 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(182 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(183 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -9145,8 +9235,9 @@ var ts; return !isConstEnum; case 103 /* InterfaceKeyword */: case 117 /* ModuleKeyword */: + case 118 /* NamespaceKeyword */: case 77 /* EnumKeyword */: - case 123 /* TypeKeyword */: + case 124 /* TypeKeyword */: // When followed by an identifier, these do not start a statement but might // instead be following declarations if (isDeclarationStart()) { @@ -9196,9 +9287,9 @@ var ts; case 82 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 71 /* ContinueKeyword */: - return parseBreakOrContinueStatement(189 /* ContinueStatement */); + return parseBreakOrContinueStatement(190 /* ContinueStatement */); case 66 /* BreakKeyword */: - return parseBreakOrContinueStatement(190 /* BreakStatement */); + return parseBreakOrContinueStatement(191 /* BreakStatement */); case 90 /* ReturnKeyword */: return parseReturnStatement(); case 101 /* WithKeyword */: @@ -9273,16 +9364,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token === 23 /* CommaToken */) { - return createNode(175 /* OmittedExpression */); + return createNode(176 /* OmittedExpression */); } - var node = createNode(152 /* BindingElement */); + var node = createNode(153 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(152 /* BindingElement */); + var node = createNode(153 /* BindingElement */); // TODO(andersh): Handle computed properties var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -9298,14 +9389,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(150 /* ObjectBindingPattern */); + var node = createNode(151 /* ObjectBindingPattern */); parseExpected(14 /* OpenBraceToken */); node.elements = parseDelimitedList(10 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(15 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(151 /* ArrayBindingPattern */); + var node = createNode(152 /* ArrayBindingPattern */); parseExpected(18 /* OpenBracketToken */); node.elements = parseDelimitedList(11 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(19 /* CloseBracketToken */); @@ -9324,7 +9415,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(198 /* VariableDeclaration */); + var node = createNode(199 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -9333,7 +9424,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(199 /* VariableDeclarationList */); + var node = createNode(200 /* VariableDeclarationList */); switch (token) { case 98 /* VarKeyword */: break; @@ -9356,7 +9447,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 === 125 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token === 126 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -9371,7 +9462,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 17 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(180 /* VariableStatement */, fullStart); + var node = createNode(181 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -9379,7 +9470,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(200 /* FunctionDeclaration */, fullStart); + var node = createNode(201 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(83 /* FunctionKeyword */); @@ -9390,7 +9481,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(135 /* Constructor */, pos); + var node = createNode(136 /* Constructor */, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(114 /* ConstructorKeyword */); @@ -9399,7 +9490,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(134 /* MethodDeclaration */, fullStart); + var method = createNode(135 /* MethodDeclaration */, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -9410,7 +9501,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(132 /* PropertyDeclaration */, fullStart); + var property = createNode(133 /* PropertyDeclaration */, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -9491,7 +9582,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 120 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 121 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -9525,7 +9616,7 @@ var ts; decorators = []; decorators.pos = scanner.getStartPos(); } - var decorator = createNode(130 /* Decorator */, decoratorStart); + var decorator = createNode(131 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -9558,7 +9649,7 @@ var ts; } function parseClassElement() { if (token === 22 /* SemicolonToken */) { - var result = createNode(178 /* SemicolonClassElement */); + var result = createNode(179 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -9596,10 +9687,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart:*/ scanner.getStartPos(), /*decorators:*/ undefined, - /*modifiers:*/ undefined, 174 /* ClassExpression */); + /*modifiers:*/ undefined, 175 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 202 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code @@ -9644,16 +9735,16 @@ var ts; } function parseHeritageClause() { if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) { - var node = createNode(222 /* HeritageClause */); + var node = createNode(223 /* HeritageClause */); node.token = token; nextToken(); - node.types = parseDelimitedList(8 /* HeritageClauseElement */, parseHeritageClauseElement); + node.types = parseDelimitedList(8 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } return undefined; } - function parseHeritageClauseElement() { - var node = createNode(177 /* HeritageClauseElement */); + function parseExpressionWithTypeArguments() { + var node = createNode(177 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 24 /* LessThanToken */) { node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); @@ -9667,7 +9758,7 @@ var ts; return parseList(6 /* ClassMembers */, false, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(202 /* InterfaceDeclaration */, fullStart); + var node = createNode(203 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(103 /* InterfaceKeyword */); @@ -9678,10 +9769,10 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203 /* TypeAliasDeclaration */, fullStart); + var node = createNode(204 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(123 /* TypeKeyword */); + parseExpected(124 /* TypeKeyword */); node.name = parseIdentifier(); parseExpected(53 /* EqualsToken */); node.type = parseType(); @@ -9693,13 +9784,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(226 /* EnumMember */, scanner.getStartPos()); + var node = createNode(227 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(204 /* EnumDeclaration */, fullStart); + var node = createNode(205 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(77 /* EnumKeyword */); @@ -9714,7 +9805,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(206 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(207 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(14 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); parseExpected(15 /* CloseBraceToken */); @@ -9724,19 +9815,19 @@ var ts; } return finishNode(node); } - function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { - var node = createNode(205 /* ModuleDeclaration */, fullStart); + function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { + var node = createNode(206 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(20 /* DotToken */) - ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1 /* Export */) + ? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 1 /* Export */) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205 /* ModuleDeclaration */, fullStart); + var node = createNode(206 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -9744,13 +9835,20 @@ var ts; return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { - parseExpected(117 /* ModuleKeyword */); - return token === 8 /* StringLiteral */ - ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) - : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); + var flags = modifiers ? modifiers.flags : 0; + if (parseOptional(118 /* NamespaceKeyword */)) { + flags |= 32768 /* Namespace */; + } + else { + parseExpected(117 /* ModuleKeyword */); + if (token === 8 /* StringLiteral */) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + } + return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); } function isExternalModuleReference() { - return token === 118 /* RequireKeyword */ && + return token === 119 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -9759,7 +9857,7 @@ var ts; function nextTokenIsCommaOrFromKeyword() { nextToken(); return token === 23 /* CommaToken */ || - token === 124 /* FromKeyword */; + token === 125 /* FromKeyword */; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { parseExpected(85 /* ImportKeyword */); @@ -9767,11 +9865,11 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 /* CommaToken */ && token !== 124 /* FromKeyword */) { + if (token !== 23 /* CommaToken */ && token !== 125 /* FromKeyword */) { // ImportEquals declaration of type: // import x = require("mod"); or // import x = M.x; - var importEqualsDeclaration = createNode(208 /* ImportEqualsDeclaration */, fullStart); + var importEqualsDeclaration = createNode(209 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -9782,7 +9880,7 @@ var ts; } } // Import statement - var importDeclaration = createNode(209 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(210 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); // ImportDeclaration: @@ -9792,7 +9890,7 @@ var ts; token === 35 /* AsteriskToken */ || token === 14 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(124 /* FromKeyword */); + parseExpected(125 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -9805,7 +9903,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(210 /* ImportClause */, fullStart); + var importClause = createNode(211 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -9815,7 +9913,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(23 /* CommaToken */)) { - importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(212 /* NamedImports */); + importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(213 /* NamedImports */); } return finishNode(importClause); } @@ -9825,8 +9923,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(219 /* ExternalModuleReference */); - parseExpected(118 /* RequireKeyword */); + var node = createNode(220 /* ExternalModuleReference */); + parseExpected(119 /* RequireKeyword */); parseExpected(16 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(17 /* CloseParenToken */); @@ -9847,7 +9945,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(211 /* NamespaceImport */); + var namespaceImport = createNode(212 /* NamespaceImport */); parseExpected(35 /* AsteriskToken */); parseExpected(111 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -9862,14 +9960,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(20 /* ImportOrExportSpecifiers */, kind === 212 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); + node.elements = parseBracketedList(20 /* ImportOrExportSpecifiers */, kind === 213 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(217 /* ExportSpecifier */); + return parseImportOrExportSpecifier(218 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(213 /* ImportSpecifier */); + return parseImportOrExportSpecifier(214 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -9894,23 +9992,23 @@ var ts; else { node.name = identifierName; } - if (kind === 213 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 214 /* 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(215 /* ExportDeclaration */, fullStart); + var node = createNode(216 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(35 /* AsteriskToken */)) { - parseExpected(124 /* FromKeyword */); + parseExpected(125 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(216 /* NamedExports */); - if (parseOptional(124 /* FromKeyword */)) { + node.exportClause = parseNamedImportsOrExports(217 /* NamedExports */); + if (parseOptional(125 /* FromKeyword */)) { node.moduleSpecifier = parseModuleSpecifier(); } } @@ -9918,7 +10016,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(214 /* ExportAssignment */, fullStart); + var node = createNode(215 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(53 /* EqualsToken */)) { @@ -9947,13 +10045,14 @@ var ts; case 69 /* ClassKeyword */: case 103 /* InterfaceKeyword */: case 77 /* EnumKeyword */: - case 123 /* TypeKeyword */: + case 124 /* TypeKeyword */: // Not true keywords so ensure an identifier follows return lookAhead(nextTokenIsIdentifierOrKeyword); case 85 /* ImportKeyword */: // Not true keywords so ensure an identifier follows or is string literal or asterisk or open brace return lookAhead(nextTokenCanFollowImportKeyword); case 117 /* ModuleKeyword */: + case 118 /* NamespaceKeyword */: // Not a true keyword so ensure an identifier or string literal follows return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); case 78 /* ExportKeyword */: @@ -10024,11 +10123,12 @@ var ts; return parseClassDeclaration(fullStart, decorators, modifiers); case 103 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 123 /* TypeKeyword */: + case 124 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 77 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); case 117 /* ModuleKeyword */: + case 118 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); case 85 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); @@ -10036,7 +10136,7 @@ var ts; if (decorators) { // We reached this point because we encountered an AtToken and assumed a declaration would // follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(218 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(219 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -10119,10 +10219,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 /* Export */ - || node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */ - || node.kind === 209 /* ImportDeclaration */ - || node.kind === 214 /* ExportAssignment */ - || node.kind === 215 /* ExportDeclaration */ + || node.kind === 209 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 220 /* ExternalModuleReference */ + || node.kind === 210 /* ImportDeclaration */ + || node.kind === 215 /* ExportAssignment */ + || node.kind === 216 /* ExportDeclaration */ ? node : undefined; }); @@ -10705,7 +10805,6 @@ var ts; var undefinedType = createIntrinsicType(32 /* Undefined */ | 262144 /* ContainsUndefinedOrNull */, "undefined"); var nullType = createIntrinsicType(64 /* Null */ | 262144 /* ContainsUndefinedOrNull */, "null"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -10735,6 +10834,8 @@ var ts; var emitExtends = false; var emitDecorate = false; var emitParam = false; + var resolutionTargets = []; + var resolutionResults = []; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -10900,10 +11001,10 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 227 /* SourceFile */); + return ts.getAncestor(node, 228 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 227 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 228 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -10952,40 +11053,40 @@ var ts; } } switch (location.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931 /* ModuleMember */)) { - if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 217 /* ExportSpecifier */)) { + if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 218 /* ExportSpecifier */)) { break loop; } result = undefined; } - else if (location.kind === 227 /* SourceFile */ || - (location.kind === 205 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931 /* ModuleMember */); + else if (location.kind === 228 /* SourceFile */ || + (location.kind === 206 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { + result = getSymbolOfNode(location).exports["default"]; var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { + if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; } break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* 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 // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. - if (location.parent.kind === 201 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + if (location.parent.kind === 202 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { @@ -10995,8 +11096,8 @@ var ts; } } break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 @@ -11016,9 +11117,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (grandparent.kind === 201 /* ClassDeclaration */ || grandparent.kind === 202 /* InterfaceDeclaration */) { + if (grandparent.kind === 202 /* ClassDeclaration */ || grandparent.kind === 203 /* 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); @@ -11026,19 +11127,19 @@ var ts; } } break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 162 /* FunctionExpression */: + case 163 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -11049,14 +11150,14 @@ var ts; break loop; } break; - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: var className = location.name; if (className && name === className.text) { result = location.symbol; break loop; } break; - case 130 /* Decorator */: + case 131 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -11065,7 +11166,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 === 129 /* Parameter */) { + if (location.parent && location.parent.kind === 130 /* Parameter */) { location = location.parent; } // @@ -11121,16 +11222,16 @@ var ts; // for (let x in x) // for (let x of x) // climb up to the variable declaration skipping binding patterns - var variableDeclaration = ts.getAncestor(declaration, 198 /* VariableDeclaration */); + var variableDeclaration = ts.getAncestor(declaration, 199 /* VariableDeclaration */); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 180 /* VariableStatement */ || - variableDeclaration.parent.parent.kind === 186 /* ForStatement */) { + if (variableDeclaration.parent.parent.kind === 181 /* VariableStatement */ || + variableDeclaration.parent.parent.kind === 187 /* ForStatement */) { // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */ || - variableDeclaration.parent.parent.kind === 187 /* ForInStatement */) { + else if (variableDeclaration.parent.parent.kind === 189 /* ForOfStatement */ || + variableDeclaration.parent.parent.kind === 188 /* ForInStatement */) { // ForIn/ForOf case - use site should not be used in expression part var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); @@ -11157,10 +11258,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 208 /* ImportEqualsDeclaration */) { + if (node.kind === 209 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 209 /* ImportDeclaration */) { + while (node && node.kind !== 210 /* ImportDeclaration */) { node = node.parent; } return node; @@ -11170,7 +11271,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 219 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 220 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -11180,7 +11281,7 @@ var ts; if (moduleSymbol) { var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); if (!exportDefaultSymbol) { - error(node.name, ts.Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); + error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } return exportDefaultSymbol; } @@ -11277,17 +11378,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 210 /* ImportClause */: + case 211 /* ImportClause */: return getTargetOfImportClause(node); - case 211 /* NamespaceImport */: + case 212 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 213 /* ImportSpecifier */: + case 214 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 217 /* ExportSpecifier */: + case 218 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } @@ -11332,11 +11433,11 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214 /* ExportAssignment */) { + if (node.kind === 215 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 217 /* ExportSpecifier */) { + else if (node.kind === 218 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -11349,7 +11450,7 @@ var ts; // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 208 /* ImportEqualsDeclaration */); + importDeclaration = ts.getAncestor(entityName, 209 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -11362,13 +11463,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 126 /* QualifiedName */) { + if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 127 /* 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 === 208 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 209 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } @@ -11382,14 +11483,15 @@ var ts; } var symbol; if (name.kind === 65 /* Identifier */) { - symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + var message = meaning === 1536 /* Namespace */ ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; + symbol = resolveName(name, name.text, meaning, message, name); if (!symbol) { return undefined; } } - else if (name.kind === 126 /* QualifiedName */ || name.kind === 155 /* PropertyAccessExpression */) { - var left = name.kind === 126 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 126 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 127 /* QualifiedName */ || name.kind === 156 /* PropertyAccessExpression */) { + var left = name.kind === 127 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 127 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1536 /* Namespace */); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -11446,10 +11548,10 @@ var ts; if (sourceFile.symbol) { return sourceFile.symbol; } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.fileName); + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); return; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); + error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); } // 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. @@ -11462,7 +11564,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { var symbol = resolveExternalModuleSymbol(moduleSymbol); if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error(moduleReferenceExpression, ts.Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; @@ -11549,7 +11651,7 @@ var ts; var members = node.members; for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 135 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 136 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -11619,17 +11721,17 @@ var ts; } } switch (location_1.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location_1)) { break; } - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -11778,8 +11880,8 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 205 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || - (declaration.kind === 227 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 206 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || + (declaration.kind === 228 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -11815,12 +11917,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 144 /* TypeQuery */) { + if (entityName.parent.kind === 145 /* TypeQuery */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 126 /* QualifiedName */ || entityName.kind === 155 /* PropertyAccessExpression */ || - entityName.parent.kind === 208 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 127 /* QualifiedName */ || entityName.kind === 156 /* PropertyAccessExpression */ || + entityName.parent.kind === 209 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1536 /* Namespace */; @@ -11868,10 +11970,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 149 /* ParenthesizedType */) { + while (node.kind === 150 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 203 /* TypeAliasDeclaration */) { + if (node.kind === 204 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -12075,7 +12177,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 227 /* SourceFile */ || declaration.parent.kind === 206 /* ModuleBlock */; + return declaration.parent.kind === 228 /* SourceFile */ || declaration.parent.kind === 207 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -12154,7 +12256,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 0 /* String */, "x")); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 121 /* StringKeyword */); + writeKeyword(writer, 122 /* StringKeyword */); writePunctuation(writer, 19 /* CloseBracketToken */); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); @@ -12168,7 +12270,7 @@ var ts; writer.writeParameter(getIndexerParameterName(resolved, 1 /* Number */, "x")); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 119 /* NumberKeyword */); + writeKeyword(writer, 120 /* NumberKeyword */); writePunctuation(writer, 19 /* CloseBracketToken */); writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); @@ -12314,12 +12416,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 205 /* ModuleDeclaration */) { + if (node.kind === 206 /* ModuleDeclaration */) { if (node.name.kind === 8 /* StringLiteral */) { return node; } } - else if (node.kind === 227 /* SourceFile */) { + else if (node.kind === 228 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -12368,69 +12470,69 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 152 /* BindingElement */: + case 153 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 198 /* VariableDeclaration */: + case 199 /* 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 205 /* ModuleDeclaration */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 200 /* FunctionDeclaration */: - case 204 /* EnumDeclaration */: - case 208 /* ImportEqualsDeclaration */: + case 206 /* ModuleDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 201 /* FunctionDeclaration */: + case 205 /* EnumDeclaration */: + case 209 /* ImportEqualsDeclaration */: var parent_2 = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedNodeFlags(node) & 1 /* Export */) && - !(node.kind !== 208 /* ImportEqualsDeclaration */ && parent_2.kind !== 227 /* SourceFile */ && ts.isInAmbientContext(parent_2))) { + !(node.kind !== 209 /* ImportEqualsDeclaration */ && parent_2.kind !== 228 /* SourceFile */ && ts.isInAmbientContext(parent_2))) { return isGlobalSourceFile(parent_2); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent_2); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so let it fall into next case statement - case 135 /* Constructor */: - case 139 /* ConstructSignature */: - case 138 /* CallSignature */: - case 140 /* IndexSignature */: - case 129 /* Parameter */: - case 206 /* ModuleBlock */: - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 145 /* TypeLiteral */: - case 141 /* TypeReference */: - case 146 /* ArrayType */: - case 147 /* TupleType */: - case 148 /* UnionType */: - case 149 /* ParenthesizedType */: + case 136 /* Constructor */: + case 140 /* ConstructSignature */: + case 139 /* CallSignature */: + case 141 /* IndexSignature */: + case 130 /* Parameter */: + case 207 /* ModuleBlock */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 146 /* TypeLiteral */: + case 142 /* TypeReference */: + case 147 /* ArrayType */: + case 148 /* TupleType */: + case 149 /* UnionType */: + case 150 /* 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 210 /* ImportClause */: - case 211 /* NamespaceImport */: - case 213 /* ImportSpecifier */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: + case 214 /* ImportSpecifier */: return false; // Type parameters are always visible - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: // Source file is always visible - case 227 /* SourceFile */: + case 228 /* SourceFile */: return true; // Export assignements do not create name bindings outside the module - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -12446,10 +12548,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 214 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 215 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 217 /* ExportSpecifier */) { + else if (node.parent.kind === 218 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent); } var result = []; @@ -12474,8 +12576,37 @@ var ts; }); } } + // Push an entry on the type resolution stack. If an entry with the given target is not already on the stack, + // a new entry with that target and an associated result value of true is pushed on the stack, and the value + // true is returned. Otherwise, a circularity has occurred and the result values of the existing entry and + // all entries pushed after it are changed to false, and the value false is returned. The target object provides + // a unique identity for a particular type resolution result: Symbol instances are used to track resolution of + // SymbolLinks.type, SymbolLinks instances are used to track resolution of SymbolLinks.declaredType, and + // Signature instances are used to track resolution of Signature.resolvedReturnType. + function pushTypeResolution(target) { + var i = 0; + var count = resolutionTargets.length; + while (i < count && resolutionTargets[i] !== target) { + i++; + } + if (i < count) { + do { + resolutionResults[i++] = false; + } while (i < count); + return false; + } + resolutionTargets.push(target); + resolutionResults.push(true); + return true; + } + // Pop an entry from the type resolution stack and return its associated result value. The result value will + // be true if no circularities were detected, or false if a circularity was found. + function popTypeResolution() { + resolutionTargets.pop(); + return resolutionResults.pop(); + } function getRootDeclaration(node) { - while (node.kind === 152 /* BindingElement */) { + while (node.kind === 153 /* BindingElement */) { node = node.parent.parent; } return node; @@ -12484,7 +12615,7 @@ var ts; node = getRootDeclaration(node); // Parent chain: // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 198 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; + return node.kind === 199 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 @@ -12517,7 +12648,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 150 /* ObjectBindingPattern */) { + if (pattern.kind === 151 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_5 = declaration.propertyName || declaration.name; // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, @@ -12564,10 +12695,10 @@ 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 === 187 /* ForInStatement */) { + if (declaration.parent.parent.kind === 188 /* ForInStatement */) { return anyType; } - if (declaration.parent.parent.kind === 188 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 189 /* 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, @@ -12581,11 +12712,11 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129 /* Parameter */) { + if (declaration.kind === 130 /* 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 === 137 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136 /* GetAccessor */); + if (func.kind === 138 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 137 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -12601,7 +12732,7 @@ var ts; return checkExpressionCached(declaration.initializer); } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 225 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 226 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // No type specified and nothing can be inferred @@ -12636,7 +12767,7 @@ var ts; var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 175 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 176 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } @@ -12659,7 +12790,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) { - return pattern.kind === 150 /* ObjectBindingPattern */ + return pattern.kind === 151 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } @@ -12681,7 +12812,7 @@ 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. - return declaration.kind !== 224 /* PropertyAssignment */ ? getWidenedType(type) : type; + return declaration.kind !== 225 /* PropertyAssignment */ ? getWidenedType(type) : type; } // If no type was specified and nothing could be inferred, and if the declaration specifies a binding pattern, use // the type implied by the binding pattern @@ -12693,7 +12824,7 @@ var ts; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 129 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 130 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -12708,28 +12839,33 @@ var ts; } // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 223 /* CatchClause */) { + if (declaration.parent.kind === 224 /* CatchClause */) { return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 214 /* ExportAssignment */) { + if (declaration.kind === 215 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } // Handle variable, parameter or property - links.type = resolvingType; + if (!pushTypeResolution(symbol)) { + return unknownType; + } var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + if (!popTypeResolution()) { + if (symbol.valueDeclaration.type) { + // Variable has type annotation that circularly references the variable itself + type = unknownType; + error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + } + else { + // Variable has initializer that circularly references the variable itself + type = anyType; + if (compilerOptions.noImplicitAny) { + error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + } } + links.type = type; } return links.type; } @@ -12738,7 +12874,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 136 /* GetAccessor */) { + if (accessor.kind === 137 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -12750,15 +12886,12 @@ var ts; } function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - function checkAndStoreTypeOfAccessors(symbol, links) { - links = links || getSymbolLinks(symbol); if (!links.type) { - links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 137 /* SetAccessor */); + if (!pushTypeResolution(symbol)) { + return unknownType; + } + var getter = ts.getDeclarationOfKind(symbol, 137 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 138 /* SetAccessor */); var type; // First try to see if the user specified a return type on the get-accessor. var getterReturnType = getAnnotatedAccessorType(getter); @@ -12784,17 +12917,16 @@ var ts; } } } - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); - error(getter, 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)); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var getter_1 = ts.getDeclarationOfKind(symbol, 137 /* 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)); + } } + links.type = type; } + return links.type; } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); @@ -12861,7 +12993,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 203 /* InterfaceDeclaration */ || node.kind === 202 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -12895,10 +13027,10 @@ var ts; } function resolveBaseTypesOfClass(type) { type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(type.symbol, 201 /* ClassDeclaration */); + var declaration = ts.getDeclarationOfKind(type.symbol, 202 /* ClassDeclaration */); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + var baseType = getTypeFromTypeNode(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & 1024 /* Class */) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -12918,10 +13050,10 @@ var ts; type.baseTypes = []; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 202 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 203 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; - var baseType = getTypeFromHeritageClauseElement(node); + var baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -12939,10 +13071,11 @@ var ts; } } } - function getDeclaredTypeOfClass(symbol) { + function getDeclaredTypeOfClassOrInterface(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024 /* Class */, symbol); + var kind = symbol.flags & 32 /* Class */ ? 1024 /* Class */ : 2048 /* Interface */; + var type = links.declaredType = createObjectType(kind, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { type.flags |= 4096 /* Reference */; @@ -12952,49 +13085,24 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return links.declaredType; - } - function getDeclaredTypeOfInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } return links.declaredType; } function getDeclaredTypeOfTypeAlias(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); - var type = getTypeFromTypeNode(declaration.type); - if (links.declaredType === resolvingType) { - links.declaredType = type; + // Note that we use the links object as the target here because the symbol object is used as the unique + // identity for resolution of the 'type' property in SymbolLinks. + if (!pushTypeResolution(links)) { + return unknownType; } - } - else if (links.declaredType === resolvingType) { - links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var declaration = ts.getDeclarationOfKind(symbol, 204 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (!popTypeResolution()) { + type = unknownType; + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + links.declaredType = type; } return links.declaredType; } @@ -13012,7 +13120,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).constraint) { + if (!ts.getDeclarationOfKind(symbol, 129 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -13028,11 +13136,8 @@ var ts; } function getDeclaredTypeOfSymbol(symbol) { ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); - if (symbol.flags & 32 /* Class */) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & 64 /* Interface */) { - return getDeclaredTypeOfInterface(symbol); + if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { + return getDeclaredTypeOfClassOrInterface(symbol); } if (symbol.flags & 524288 /* TypeAlias */) { return getDeclaredTypeOfTypeAlias(symbol); @@ -13080,15 +13185,27 @@ var ts; } } } + function resolveDeclaredMembers(type) { + if (!type.declaredProperties) { + var symbol = type.symbol; + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + return type; + } function resolveClassOrInterfaceMembers(type) { - var members = type.symbol.members; - var callSignatures = type.declaredCallSignatures; - var constructSignatures = type.declaredConstructSignatures; - var stringIndexType = type.declaredStringIndexType; - var numberIndexType = type.declaredNumberIndexType; - var baseTypes = getBaseTypes(type); + var target = resolveDeclaredMembers(type); + var members = target.symbol.members; + var callSignatures = target.declaredCallSignatures; + var constructSignatures = target.declaredConstructSignatures; + var stringIndexType = target.declaredStringIndexType; + var numberIndexType = target.declaredNumberIndexType; + var baseTypes = getBaseTypes(target); if (baseTypes.length) { - members = createSymbolTable(type.declaredProperties); + members = createSymbolTable(target.declaredProperties); for (var _i = 0; _i < baseTypes.length; _i++) { var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); @@ -13101,7 +13218,7 @@ var ts; setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveTypeReferenceMembers(type) { - var target = type.target; + var target = resolveDeclaredMembers(type.target); var mapper = createTypeMapper(target.typeParameters, type.typeArguments); var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); @@ -13246,7 +13363,7 @@ var ts; callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { - var classType = getDeclaredTypeOfClass(symbol); + var classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); @@ -13353,7 +13470,7 @@ var ts; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); - if (!prop) { + if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 /* Private */ | 64 /* Protected */)) { return undefined; } if (!props) { @@ -13472,7 +13589,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 136 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -13503,8 +13620,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 === 136 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 137 /* SetAccessor */); + if (declaration.kind === 137 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 138 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -13522,19 +13639,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 164 /* 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). @@ -13551,7 +13668,9 @@ var ts; } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; + if (!pushTypeResolution(signature)) { + return unknownType; + } var type; if (signature.target) { type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); @@ -13562,27 +13681,25 @@ var ts; else { type = getReturnTypeFromBody(signature.declaration); } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, 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, ts.declarationNameToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_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); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, 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, ts.declarationNameToString(declaration.name)); + } + else { + error(declaration, ts.Diagnostics.Function_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); + } } } + signature.resolvedReturnType = type; } return signature.resolvedReturnType; } function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { - var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { return type.typeArguments[0]; } @@ -13611,7 +13728,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 === 135 /* Constructor */ || signature.declaration.kind === 139 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 136 /* Constructor */ || signature.declaration.kind === 140 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -13625,7 +13742,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 119 /* NumberKeyword */ : 121 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 120 /* NumberKeyword */ : 122 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -13655,7 +13772,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 129 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -13711,13 +13828,13 @@ var ts; currentNode = currentNode.parent; } // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 129 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 141 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { + if (n.kind === 142 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, undefined, undefined); @@ -13743,20 +13860,14 @@ var ts; check(typeParameter.constraint); } } - function getTypeFromTypeReference(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromHeritageClauseElement(node) { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - function getTypeFromTypeReferenceOrHeritageClauseElement(node) { + function getTypeFromTypeReferenceOrExpressionWithTypeArguments(node) { var links = getNodeLinks(node); if (!links.resolvedType) { var type; // We don't currently support heritage clauses with complex expressions in them. // For these cases, we just set the type to be the unknownType. - if (node.kind !== 177 /* HeritageClauseElement */ || ts.isSupportedHeritageClauseElement(node)) { - var typeNameOrExpression = node.kind === 141 /* TypeReference */ + if (node.kind !== 177 /* ExpressionWithTypeArguments */ || ts.isSupportedExpressionWithTypeArguments(node)) { + var typeNameOrExpression = node.kind === 142 /* TypeReference */ ? node.typeName : node.expression; var symbol = resolveEntityName(typeNameOrExpression, 793056 /* Type */); @@ -13810,9 +13921,9 @@ var ts; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: return declaration; } } @@ -14010,40 +14121,40 @@ var ts; switch (node.kind) { case 112 /* AnyKeyword */: return anyType; - case 121 /* StringKeyword */: + case 122 /* StringKeyword */: return stringType; - case 119 /* NumberKeyword */: + case 120 /* NumberKeyword */: return numberType; case 113 /* BooleanKeyword */: return booleanType; - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: return esSymbolType; case 99 /* VoidKeyword */: return voidType; case 8 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 141 /* TypeReference */: - return getTypeFromTypeReference(node); - case 177 /* HeritageClauseElement */: - return getTypeFromHeritageClauseElement(node); - case 144 /* TypeQuery */: + case 142 /* TypeReference */: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case 177 /* ExpressionWithTypeArguments */: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case 145 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 147 /* TupleType */: + case 148 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 148 /* UnionType */: + case 149 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return getTypeFromTypeNode(node.type); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 145 /* TypeLiteral */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 146 /* 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 65 /* Identifier */: - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -14201,27 +14312,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 !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return node.operatorToken.kind === 49 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 224 /* PropertyAssignment */: + case 225 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -15057,22 +15168,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 129 /* Parameter */: + case 130 /* 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 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -15341,10 +15452,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 144 /* TypeQuery */: + case 145 /* TypeQuery */: return true; case 65 /* Identifier */: - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: node = node.parent; continue; default: @@ -15392,7 +15503,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operatorToken.kind >= 53 /* FirstAssignment */ && node.operatorToken.kind <= 64 /* LastAssignment */) { var n = node.left; - while (n.kind === 161 /* ParenthesizedExpression */) { + while (n.kind === 162 /* ParenthesizedExpression */) { n = n.expression; } if (n.kind === 65 /* Identifier */ && getResolvedSymbol(n) === symbol) { @@ -15409,46 +15520,46 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: - case 153 /* ArrayLiteralExpression */: - case 154 /* ObjectLiteralExpression */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 160 /* TypeAssertionExpression */: - case 161 /* ParenthesizedExpression */: - case 167 /* PrefixUnaryExpression */: - case 164 /* DeleteExpression */: - case 165 /* TypeOfExpression */: - case 166 /* VoidExpression */: - case 168 /* PostfixUnaryExpression */: - case 170 /* ConditionalExpression */: - case 173 /* SpreadElementExpression */: - case 179 /* Block */: - case 180 /* VariableStatement */: - case 182 /* ExpressionStatement */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 191 /* ReturnStatement */: - case 192 /* WithStatement */: - case 193 /* SwitchStatement */: - case 220 /* CaseClause */: - case 221 /* DefaultClause */: - case 194 /* LabeledStatement */: - case 195 /* ThrowStatement */: - case 196 /* TryStatement */: - case 223 /* CatchClause */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: + case 154 /* ArrayLiteralExpression */: + case 155 /* ObjectLiteralExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 161 /* TypeAssertionExpression */: + case 162 /* ParenthesizedExpression */: + case 168 /* PrefixUnaryExpression */: + case 165 /* DeleteExpression */: + case 166 /* TypeOfExpression */: + case 167 /* VoidExpression */: + case 169 /* PostfixUnaryExpression */: + case 171 /* ConditionalExpression */: + case 174 /* SpreadElementExpression */: + case 180 /* Block */: + case 181 /* VariableStatement */: + case 183 /* ExpressionStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 192 /* ReturnStatement */: + case 193 /* WithStatement */: + case 194 /* SwitchStatement */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: + case 195 /* LabeledStatement */: + case 196 /* ThrowStatement */: + case 197 /* TryStatement */: + case 224 /* CatchClause */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -15500,19 +15611,19 @@ var ts; node = node.parent; var narrowedType = type; switch (node.kind) { - case 183 /* IfStatement */: + case 184 /* IfStatement */: // In a branch of an if statement, narrow based on controlling expression if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: // In a branch of a conditional expression, narrow based on controlling condition if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: // In the right operand of an && or ||, narrow based on left operand if (child === node.right) { if (node.operatorToken.kind === 48 /* AmpersandAmpersandToken */) { @@ -15523,14 +15634,14 @@ var ts; } } break; - case 227 /* SourceFile */: - case 205 /* ModuleDeclaration */: - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: + case 228 /* SourceFile */: + case 206 /* ModuleDeclaration */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: // Stop at the first containing function or module declaration break loop; } @@ -15546,7 +15657,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 !== 165 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { + if (expr.left.kind !== 166 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { return type; } var left = expr.left; @@ -15621,17 +15732,34 @@ var ts; } // Target type is type of prototype property var prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (!prototypeProperty) { - return type; + if (prototypeProperty) { + var targetType = getTypeOfSymbol(prototypeProperty); + if (targetType !== anyType) { + // Narrow to the target type if it's a subtype of the current type + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + // If the current type is a union type, remove all constituents that aren't subtypes of the target. + if (type.flags & 16384 /* Union */) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + } + } } - var targetType = getTypeOfSymbol(prototypeProperty); - // Narrow to target type if it is a subtype of current type - if (isTypeSubtypeOf(targetType, type)) { - return targetType; + // Target type is type of construct signature + var constructSignatures; + if (rightType.flags & 2048 /* Interface */) { + constructSignatures = resolveDeclaredMembers(rightType).declaredConstructSignatures; } - // If current type is a union type, remove all constituents that aren't subtypes of target type - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + else if (rightType.flags & 32768 /* Anonymous */) { + constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); + } + if (constructSignatures && constructSignatures.length !== 0) { + var instanceType = getUnionType(ts.map(constructSignatures, function (signature) { return getReturnTypeOfSignature(getErasedSignature(signature)); })); + // Pickup type from union types + if (type.flags & 16384 /* Union */) { + return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, instanceType); })); + } + return instanceType; } return type; } @@ -15639,9 +15767,9 @@ var ts; // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: var operator = expr.operatorToken.kind; if (operator === 30 /* EqualsEqualsEqualsToken */ || operator === 31 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -15656,7 +15784,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: if (expr.operator === 46 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -15673,7 +15801,7 @@ var ts; // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. // To avoid that we will give an error to users if they use arguments objects in arrow function so that they // can explicitly bound arguments objects - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163 /* ArrowFunction */ && languageVersion < 2 /* ES6 */) { + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 164 /* ArrowFunction */ && 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); } if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -15697,7 +15825,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 /* ES6 */ || (symbol.flags & 2 /* BlockScopedVariable */) === 0 || - symbol.valueDeclaration.parent.kind === 223 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 224 /* CatchClause */) { return; } // - check if binding is used in some function @@ -15706,12 +15834,12 @@ var ts; // nesting structure: // (variable declaration or binding element) -> variable declaration list -> container var container = symbol.valueDeclaration; - while (container.kind !== 199 /* VariableDeclarationList */) { + while (container.kind !== 200 /* VariableDeclarationList */) { container = container.parent; } // get the parent of variable declaration list container = container.parent; - if (container.kind === 180 /* VariableStatement */) { + if (container.kind === 181 /* VariableStatement */) { // if parent is variable statement - get its parent container = container.parent; } @@ -15730,9 +15858,9 @@ var ts; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 132 /* PropertyDeclaration */ || container.kind === 135 /* Constructor */) { + if (container.kind === 133 /* PropertyDeclaration */ || container.kind === 136 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -15745,39 +15873,39 @@ var ts; var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 163 /* ArrowFunction */) { + if (container.kind === 164 /* ArrowFunction */) { container = ts.getThisContainer(container, 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 205 /* ModuleDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + case 206 /* 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 204 /* EnumDeclaration */: + case 205 /* 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 135 /* Constructor */: + case 136 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 202 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -15786,15 +15914,15 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 129 /* Parameter */) { + if (n.kind === 130 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 158 /* CallExpression */ && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 202 /* ClassDeclaration */); var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -15812,7 +15940,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - canUseSuperExpression = container.kind === 135 /* Constructor */; + canUseSuperExpression = container.kind === 136 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -15821,28 +15949,28 @@ var ts; // - In a static member function or static member accessor // super property access might appear in arrow functions with arbitrary deep nesting needToCaptureLexicalThis = false; - while (container && container.kind === 163 /* ArrowFunction */) { + while (container && container.kind === 164 /* ArrowFunction */) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } // topmost container must be something that is directly nested in the class declaration - if (container && container.parent && container.parent.kind === 201 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 202 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { canUseSuperExpression = - container.kind === 134 /* MethodDeclaration */ || - container.kind === 133 /* MethodSignature */ || - container.kind === 136 /* GetAccessor */ || - container.kind === 137 /* SetAccessor */; + container.kind === 135 /* MethodDeclaration */ || + container.kind === 134 /* MethodSignature */ || + container.kind === 137 /* GetAccessor */ || + container.kind === 138 /* SetAccessor */; } else { canUseSuperExpression = - container.kind === 134 /* MethodDeclaration */ || - container.kind === 133 /* MethodSignature */ || - container.kind === 136 /* GetAccessor */ || - container.kind === 137 /* SetAccessor */ || - container.kind === 132 /* PropertyDeclaration */ || - container.kind === 131 /* PropertySignature */ || - container.kind === 135 /* Constructor */; + container.kind === 135 /* MethodDeclaration */ || + container.kind === 134 /* MethodSignature */ || + container.kind === 137 /* GetAccessor */ || + container.kind === 138 /* SetAccessor */ || + container.kind === 133 /* PropertyDeclaration */ || + container.kind === 132 /* PropertySignature */ || + container.kind === 136 /* Constructor */; } } } @@ -15856,7 +15984,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 135 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 136 /* 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); returnType = unknownType; @@ -15870,7 +15998,7 @@ var ts; return returnType; } } - if (container && container.kind === 127 /* ComputedPropertyName */) { + if (container && container.kind === 128 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -15897,7 +16025,7 @@ var ts; // If last parameter is contextually rest parameter get its type if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters)); } } } @@ -15915,7 +16043,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129 /* Parameter */) { + if (declaration.kind === 130 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -15932,7 +16060,7 @@ var ts; if (func) { // 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 (func.type || func.kind === 135 /* Constructor */ || func.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137 /* SetAccessor */))) { + if (func.type || func.kind === 136 /* Constructor */ || func.kind === 137 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 138 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -15955,7 +16083,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 159 /* TaggedTemplateExpression */) { + if (template.parent.kind === 160 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -16086,32 +16214,32 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 198 /* VariableDeclaration */: - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 153 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 163 /* ArrowFunction */: - case 191 /* ReturnStatement */: + case 164 /* ArrowFunction */: + case 192 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return getTypeFromTypeNode(parent.type); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 224 /* PropertyAssignment */: + case 225 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 176 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 171 /* TemplateExpression */); + case 178 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 172 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return getContextualType(parent); } return undefined; @@ -16128,7 +16256,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 162 /* FunctionExpression */ || node.kind === 163 /* ArrowFunction */; + return node.kind === 163 /* FunctionExpression */ || node.kind === 164 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions and arrow functions are contextually typed. @@ -16140,7 +16268,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 !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); @@ -16196,13 +16324,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 === 169 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { + if (parent.kind === 170 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 224 /* PropertyAssignment */) { + if (parent.kind === 225 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 153 /* ArrayLiteralExpression */) { + if (parent.kind === 154 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; @@ -16227,7 +16355,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0; _i < elements.length; _i++) { var e = elements[_i]; - if (inDestructuringPattern && e.kind === 173 /* SpreadElementExpression */) { + if (inDestructuringPattern && e.kind === 174 /* SpreadElementExpression */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -16251,7 +16379,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 173 /* SpreadElementExpression */; + hasSpreadElement = hasSpreadElement || e.kind === 174 /* SpreadElementExpression */; } if (!hasSpreadElement) { var contextualType = getContextualType(node); @@ -16262,7 +16390,7 @@ var ts; return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 127 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 128 /* 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, @@ -16318,18 +16446,18 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 224 /* PropertyAssignment */ || - memberDecl.kind === 225 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 225 /* PropertyAssignment */ || + memberDecl.kind === 226 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 224 /* PropertyAssignment */) { + if (memberDecl.kind === 225 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 134 /* MethodDeclaration */) { + else if (memberDecl.kind === 135 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 225 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 226 /* ShorthandPropertyAssignment */); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -16349,7 +16477,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 === 136 /* GetAccessor */ || memberDecl.kind === 137 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 137 /* GetAccessor */ || memberDecl.kind === 138 /* SetAccessor */); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -16388,7 +16516,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 : 132 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 133 /* PropertyDeclaration */; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; @@ -16401,7 +16529,7 @@ var ts; } // Property is known to be private or protected at this point // Get the declaring and enclosing class instance types - var enclosingClassDeclaration = ts.getAncestor(node, 201 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 202 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); // Private property is accessible if declaring and enclosing class are the same @@ -16462,7 +16590,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 (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 135 /* MethodDeclaration */) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -16474,14 +16602,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 155 /* PropertyAccessExpression */ + var left = node.kind === 156 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 135 /* MethodDeclaration */) { return false; } else { @@ -16497,7 +16625,7 @@ var ts; // Grammar checking if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 159 /* 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); @@ -16626,7 +16754,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* TaggedTemplateExpression */) { checkExpression(node.template); } else { @@ -16694,7 +16822,7 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 173 /* SpreadElementExpression */) { + if (args[i].kind === 174 /* SpreadElementExpression */) { return i; } } @@ -16704,13 +16832,13 @@ var ts; var adjustedArgCount; // Apparent number of arguments we will have in this call var typeArguments; // Type arguments (undefined if none) var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* 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 === 171 /* TemplateExpression */) { + if (tagExpression.template.kind === 172 /* 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; @@ -16731,7 +16859,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 === 158 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 159 /* NewExpression */); return signature.minArgumentCount === 0; } // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. @@ -16808,10 +16936,10 @@ var ts; // wildcards for all context sensitive function expressions. for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175 /* OmittedExpression */) { + if (arg.kind !== 176 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 159 /* TaggedTemplateExpression */) { + if (i === 0 && args[i].parent.kind === 160 /* TaggedTemplateExpression */) { argType = globalTemplateStringsArrayType; } else { @@ -16858,12 +16986,12 @@ var ts; function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175 /* OmittedExpression */) { + if (arg.kind !== 176 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // A tagged template expression provides a special first argument, and string literals get string literal types // unless we're reporting errors - var argType = i === 0 && node.kind === 159 /* TaggedTemplateExpression */ + var argType = i === 0 && node.kind === 160 /* TaggedTemplateExpression */ ? globalTemplateStringsArrayType : arg.kind === 8 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) @@ -16885,10 +17013,10 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 159 /* TaggedTemplateExpression */) { + if (node.kind === 160 /* TaggedTemplateExpression */) { var template = node.template; args = [template]; - if (template.kind === 171 /* TemplateExpression */) { + if (template.kind === 172 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -16911,7 +17039,7 @@ var ts; */ function getEffectiveTypeArguments(callExpression) { if (callExpression.expression.kind === 91 /* SuperKeyword */) { - var containingClass = ts.getAncestor(callExpression, 201 /* ClassDeclaration */); + var containingClass = ts.getAncestor(callExpression, 202 /* ClassDeclaration */); var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } @@ -16921,7 +17049,7 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 159 /* TaggedTemplateExpression */; + var isTaggedTemplate = node.kind === 160 /* TaggedTemplateExpression */; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); @@ -17234,13 +17362,13 @@ var ts; // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 157 /* CallExpression */) { + if (node.kind === 158 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 158 /* NewExpression */) { + else if (node.kind === 159 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 159 /* TaggedTemplateExpression */) { + else if (node.kind === 160 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -17256,12 +17384,12 @@ var ts; if (node.expression.kind === 91 /* SuperKeyword */) { return voidType; } - if (node.kind === 158 /* NewExpression */) { + if (node.kind === 159 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 135 /* Constructor */ && - declaration.kind !== 139 /* ConstructSignature */ && - declaration.kind !== 143 /* ConstructorType */) { + declaration.kind !== 136 /* Constructor */ && + declaration.kind !== 140 /* ConstructSignature */ && + declaration.kind !== 144 /* ConstructorType */) { // When resolved signature is a call signature (and not a construct signature) the result type is any if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); @@ -17298,9 +17426,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; + var parameter = ts.lastOrUndefined(signature.parameters); var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + links.type = instantiateType(getTypeOfSymbol(ts.lastOrUndefined(context.parameters)), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -17309,7 +17437,7 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 179 /* Block */) { + if (func.body.kind !== 180 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); } else { @@ -17351,7 +17479,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 195 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 196 /* ThrowStatement */); } // TypeScript Specification 1.0 (6.3) - July 2014 // An explicitly typed function whose return type isn't the Void or the Any type @@ -17366,7 +17494,7 @@ var ts; return; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - if (ts.nodeIsMissing(func.body) || func.body.kind !== 179 /* Block */) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 180 /* Block */) { return; } var bodyBlock = func.body; @@ -17384,10 +17512,10 @@ var ts; error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 162 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 163 /* FunctionExpression */) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards @@ -17409,10 +17537,9 @@ var ts; if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } - if (!node.type) { - signature.resolvedReturnType = resolvingType; + if (!node.type && !signature.resolvedReturnType) { var returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { + if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } } @@ -17420,19 +17547,19 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { + if (produceDiagnostics && node.kind !== 135 /* MethodDeclaration */ && node.kind !== 134 /* MethodSignature */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 135 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); if (node.type && !node.asteriskToken) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { - if (node.body.kind === 179 /* Block */) { + if (node.body.kind === 180 /* Block */) { checkSourceElement(node.body); } else { @@ -17474,17 +17601,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 155 /* PropertyAccessExpression */: { + case 156 /* 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 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: // old compiler doesn't check indexed assess return true; - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -17493,11 +17620,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 65 /* Identifier */: - case 155 /* PropertyAccessExpression */: { + case 156 /* PropertyAccessExpression */: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192 /* Const */) !== 0; } - case 156 /* ElementAccessExpression */: { + case 157 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 8 /* StringLiteral */) { @@ -17507,7 +17634,7 @@ var ts; } return false; } - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -17658,7 +17785,7 @@ var ts; var properties = node.properties; for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + if (p.kind === 225 /* PropertyAssignment */ || p.kind === 226 /* ShorthandPropertyAssignment */) { // TODO(andersh): Computed property support var name_8 = p.name; var type = sourceType.flags & 1 /* Any */ ? sourceType : @@ -17686,8 +17813,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175 /* OmittedExpression */) { - if (e.kind !== 173 /* SpreadElementExpression */) { + if (e.kind !== 176 /* OmittedExpression */) { + if (e.kind !== 174 /* SpreadElementExpression */) { var propName = "" + i; var type = sourceType.flags & 1 /* Any */ ? sourceType : isTupleLikeType(sourceType) @@ -17711,7 +17838,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 169 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { + if (restExpression.kind === 170 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -17724,14 +17851,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { + if (target.kind === 170 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 154 /* ObjectLiteralExpression */) { + if (target.kind === 155 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 153 /* ArrayLiteralExpression */) { + if (target.kind === 154 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -17751,7 +17878,7 @@ var ts; checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 53 /* EqualsToken */ && (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { + if (operator === 53 /* EqualsToken */ && (node.left.kind === 155 /* ObjectLiteralExpression */ || node.left.kind === 154 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); } var leftType = checkExpression(node.left, contextualMapper); @@ -17963,7 +18090,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); @@ -17974,7 +18101,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -18008,7 +18135,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 126 /* QualifiedName */) { + if (node.kind == 127 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -18020,9 +18147,9 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 156 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 157 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 65 /* Identifier */ || node.kind === 127 /* 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); } @@ -18049,54 +18176,54 @@ var ts; return booleanType; case 7 /* NumericLiteral */: return checkNumericLiteral(node); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: return checkTemplateExpression(node); case 8 /* StringLiteral */: case 10 /* NoSubstitutionTemplateLiteral */: return stringType; case 9 /* RegularExpressionLiteral */: return globalRegExpType; - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 155 /* PropertyAccessExpression */: + case 156 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return checkCallExpression(node); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return checkTypeAssertion(node); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: return checkClassExpression(node); - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 165 /* TypeOfExpression */: + case 166 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 164 /* DeleteExpression */: + case 165 /* DeleteExpression */: return checkDeleteExpression(node); - case 166 /* VoidExpression */: + case 167 /* VoidExpression */: return checkVoidExpression(node); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 168 /* PostfixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 173 /* SpreadElementExpression */: + case 174 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 175 /* OmittedExpression */: + case 176 /* OmittedExpression */: return undefinedType; - case 172 /* YieldExpression */: + case 173 /* YieldExpression */: checkYieldExpression(node); return unknownType; } @@ -18129,7 +18256,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 112 /* AccessibilityModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 135 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 136 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -18144,12 +18271,12 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 140 /* IndexSignature */) { + if (node.kind === 141 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 142 /* FunctionType */ || node.kind === 200 /* FunctionDeclaration */ || node.kind === 143 /* ConstructorType */ || - node.kind === 138 /* CallSignature */ || node.kind === 135 /* Constructor */ || - node.kind === 139 /* ConstructSignature */) { + else if (node.kind === 143 /* FunctionType */ || node.kind === 201 /* FunctionDeclaration */ || node.kind === 144 /* ConstructorType */ || + node.kind === 139 /* CallSignature */ || node.kind === 136 /* Constructor */ || + node.kind === 140 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -18161,10 +18288,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 138 /* CallSignature */: + case 139 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -18173,7 +18300,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 202 /* InterfaceDeclaration */) { + if (node.kind === 203 /* 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 @@ -18193,7 +18320,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 121 /* StringKeyword */: + case 122 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -18201,7 +18328,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 119 /* NumberKeyword */: + case 120 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -18245,17 +18372,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 157 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; + return n.kind === 158 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 154 /* ObjectLiteralExpression */: return false; + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 155 /* ObjectLiteralExpression */: return false; default: return ts.forEachChild(n, containsSuperCall); } } @@ -18263,12 +18390,12 @@ var ts; if (n.kind === 93 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 162 /* FunctionExpression */ && n.kind !== 200 /* FunctionDeclaration */) { + else if (n.kind !== 163 /* FunctionExpression */ && n.kind !== 201 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 132 /* PropertyDeclaration */ && + return n.kind === 133 /* PropertyDeclaration */ && !(n.flags & 128 /* Static */) && !!n.initializer; } @@ -18285,7 +18412,7 @@ var ts; ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 182 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 183 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -18303,7 +18430,7 @@ var ts; if (produceDiagnostics) { // Grammar checking accessors checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 136 /* GetAccessor */) { + if (node.kind === 137 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } @@ -18311,7 +18438,7 @@ var ts; 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 === 136 /* GetAccessor */ ? 137 /* SetAccessor */ : 136 /* GetAccessor */; + var otherKind = node.kind === 137 /* GetAccessor */ ? 138 /* SetAccessor */ : 137 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { @@ -18328,7 +18455,7 @@ var ts; } } } - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); + getTypeOfAccessors(getSymbolOfNode(node)); } checkFunctionLikeDeclaration(node); } @@ -18337,16 +18464,16 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeReferenceInStrictMode(node.typeName); - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkHeritageClauseElement(node) { - checkGrammarHeritageClauseElementInStrictMode(node.expression); - return checkTypeReferenceOrHeritageClauseElement(node); + function checkExpressionWithTypeArguments(node) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(node.expression); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkTypeReferenceOrHeritageClauseElement(node) { + function checkTypeReferenceOrExpressionWithTypeArguments(node) { // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); + var type = getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved var len = node.typeArguments.length; @@ -18408,9 +18535,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 === 202 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 138 /* CallSignature */ || signatureDeclarationNode.kind === 139 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 138 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 203 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 139 /* CallSignature */ || signatureDeclarationNode.kind === 140 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 139 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -18428,7 +18555,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 202 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 203 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported flags |= 1 /* Export */; @@ -18511,7 +18638,7 @@ var ts; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members - ts.Debug.assert(node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */); + ts.Debug.assert(node.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); @@ -18540,7 +18667,7 @@ var ts; var current = declarations[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 202 /* InterfaceDeclaration */ || node.parent.kind === 145 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 203 /* InterfaceDeclaration */ || node.parent.kind === 146 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -18551,7 +18678,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 === 200 /* FunctionDeclaration */ || node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */ || node.kind === 135 /* Constructor */) { + if (node.kind === 201 /* FunctionDeclaration */ || node.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */ || node.kind === 136 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -18674,16 +18801,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return d.name.kind === 8 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -18698,23 +18825,23 @@ var ts; var expression = node.expression; var exprType = checkExpression(expression); switch (node.parent.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]); checkTypeAssignableTo(exprType, classDecoratorType, node); break; - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node); break; - case 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]); checkTypeAssignableTo(exprType, methodDecoratorType, node); break; - case 129 /* Parameter */: + case 130 /* Parameter */: checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node); break; } @@ -18724,7 +18851,7 @@ 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 === 141 /* TypeReference */) { + if (node && node.kind === 142 /* TypeReference */) { var type = getTypeFromTypeNode(node); var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* StringLike */))) { @@ -18741,19 +18868,19 @@ var ts; */ function checkTypeAnnotationAsExpression(node) { switch (node.kind) { - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: checkTypeNodeAsExpression(node.type); break; - case 129 /* Parameter */: + case 130 /* Parameter */: checkTypeNodeAsExpression(node.type); break; - case 134 /* MethodDeclaration */: + case 135 /* MethodDeclaration */: checkTypeNodeAsExpression(node.type); break; - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: checkTypeNodeAsExpression(node.type); break; - case 137 /* SetAccessor */: + case 138 /* SetAccessor */: checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); break; } @@ -18779,25 +18906,25 @@ 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 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 134 /* MethodDeclaration */: + case 135 /* MethodDeclaration */: checkParameterTypeAnnotationsAsExpressions(node); // fall-through - case 137 /* SetAccessor */: - case 136 /* GetAccessor */: - case 132 /* PropertyDeclaration */: - case 129 /* Parameter */: + case 138 /* SetAccessor */: + case 137 /* GetAccessor */: + case 133 /* PropertyDeclaration */: + case 130 /* Parameter */: checkTypeAnnotationAsExpression(node); break; } } emitDecorate = true; - if (node.kind === 129 /* Parameter */) { + if (node.kind === 130 /* Parameter */) { emitParam = true; } ts.forEach(node.decorators, checkDecorator); @@ -18820,7 +18947,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 127 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 128 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -18856,11 +18983,11 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 179 /* Block */) { + if (node.kind === 180 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 206 /* ModuleBlock */) { + if (ts.isFunctionBlock(node) || node.kind === 207 /* ModuleBlock */) { checkFunctionExpressionBodies(node); } } @@ -18879,12 +19006,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 132 /* PropertyDeclaration */ || - node.kind === 131 /* PropertySignature */ || - node.kind === 134 /* MethodDeclaration */ || - node.kind === 133 /* MethodSignature */ || - node.kind === 136 /* GetAccessor */ || - node.kind === 137 /* SetAccessor */) { + if (node.kind === 133 /* PropertyDeclaration */ || + node.kind === 132 /* PropertySignature */ || + node.kind === 135 /* MethodDeclaration */ || + node.kind === 134 /* MethodSignature */ || + node.kind === 137 /* GetAccessor */ || + node.kind === 138 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -18893,7 +19020,7 @@ var ts; return false; } var root = getRootDeclaration(node); - if (root.kind === 129 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 130 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -18926,7 +19053,7 @@ var ts; return; } // bubble up and find containing type - var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 202 /* ClassDeclaration */); // if containing type was not found or it is ambient - exit (no codegen) if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; @@ -18946,14 +19073,14 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 206 /* 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 === 227 /* SourceFile */ && ts.isExternalModule(parent)) { + if (parent.kind === 228 /* SourceFile */ && ts.isExternalModule(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_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); + error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkVarDeclaredNamesNotShadowed(node) { @@ -18986,7 +19113,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 === 198 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 199 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -18996,17 +19123,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 199 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 180 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 200 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 181 /* 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 === 179 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 206 /* ModuleBlock */ || - container.kind === 205 /* ModuleDeclaration */ || - container.kind === 227 /* SourceFile */); + (container.kind === 180 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 207 /* ModuleBlock */ || + container.kind === 206 /* ModuleDeclaration */ || + container.kind === 228 /* 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 @@ -19020,14 +19147,14 @@ var ts; } } function isParameterDeclaration(node) { - while (node.kind === 152 /* BindingElement */) { + while (node.kind === 153 /* BindingElement */) { node = node.parent.parent; } - return node.kind === 129 /* Parameter */; + return node.kind === 130 /* Parameter */; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 129 /* Parameter */) { + if (getRootDeclaration(node).kind !== 130 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -19038,7 +19165,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 === 129 /* Parameter */) { + if (referencedSymbol.valueDeclaration.kind === 130 /* Parameter */) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -19065,7 +19192,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); @@ -19076,7 +19203,7 @@ 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 && getRootDeclaration(node).kind === 129 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && getRootDeclaration(node).kind === 130 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } @@ -19108,10 +19235,10 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 132 /* PropertyDeclaration */ && node.kind !== 131 /* PropertySignature */) { + if (node.kind !== 133 /* PropertyDeclaration */ && node.kind !== 132 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 198 /* VariableDeclaration */ || node.kind === 152 /* BindingElement */) { + if (node.kind === 199 /* VariableDeclaration */ || node.kind === 153 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -19141,7 +19268,7 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 179 /* Block */ || node.kind === 154 /* ObjectLiteralExpression */) { + if (node.kind === 180 /* Block */ || node.kind === 155 /* ObjectLiteralExpression */) { return true; } node = node.parent; @@ -19174,12 +19301,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 199 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind == 200 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -19188,8 +19315,8 @@ var ts; } if (node.condition) checkExpression(node.condition); - if (node.iterator) - checkExpression(node.iterator); + if (node.incrementor) + checkExpression(node.incrementor); checkSourceElement(node.statement); } function checkForOfStatement(node) { @@ -19199,14 +19326,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 === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* 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 === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { + if (varExpr.kind === 154 /* ArrayLiteralExpression */ || varExpr.kind === 155 /* 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. @@ -19235,7 +19362,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 === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* 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); @@ -19249,7 +19376,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 === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { + if (varExpr.kind === 154 /* ArrayLiteralExpression */ || varExpr.kind === 155 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!allConstituentTypesHaveKind(leftType, 1 /* Any */ | 258 /* StringLike */)) { @@ -19449,7 +19576,7 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137 /* SetAccessor */))); + return !!(node.kind === 137 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 138 /* SetAccessor */))); } function checkReturnStatement(node) { // Grammar checking @@ -19464,11 +19591,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 137 /* SetAccessor */) { + if (func.kind === 138 /* SetAccessor */) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 135 /* Constructor */) { + if (func.kind === 136 /* Constructor */) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -19498,7 +19625,7 @@ var ts; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 221 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 222 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -19510,7 +19637,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 220 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 221 /* 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. @@ -19531,7 +19658,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 194 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 195 /* 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; @@ -19601,7 +19728,7 @@ var ts; checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); }); - if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 201 /* ClassDeclaration */) { + if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 202 /* ClassDeclaration */) { var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; @@ -19639,7 +19766,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 === 127 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 128 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -19697,7 +19824,7 @@ var ts; function checkClassDeclaration(node) { checkGrammarDeclarationNameInStrictMode(node); // Grammar checking - if (node.parent.kind !== 206 /* ModuleBlock */ && node.parent.kind !== 227 /* SourceFile */) { + if (node.parent.kind !== 207 /* ModuleBlock */ && node.parent.kind !== 228 /* SourceFile */) { grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); } if (!node.name && !(node.flags & 256 /* Default */)) { @@ -19717,11 +19844,11 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - if (!ts.isSupportedHeritageClauseElement(baseTypeNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(baseTypeNode)) { error(baseTypeNode.expression, ts.Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); } emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkHeritageClauseElement(baseTypeNode); + checkExpressionWithTypeArguments(baseTypeNode); } var baseTypes = getBaseTypes(type); if (baseTypes.length) { @@ -19743,12 +19870,12 @@ var ts; var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { ts.forEach(implementedTypeNodes, function (typeRefNode) { - if (!ts.isSupportedHeritageClauseElement(typeRefNode)) { + if (!ts.isSupportedExpressionWithTypeArguments(typeRefNode)) { error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(typeRefNode); + checkExpressionWithTypeArguments(typeRefNode); if (produceDiagnostics) { - var t = getTypeFromHeritageClauseElement(typeRefNode); + var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { @@ -19834,7 +19961,7 @@ var ts; } } function isAccessor(kind) { - return kind === 136 /* GetAccessor */ || kind === 137 /* SetAccessor */; + return kind === 137 /* GetAccessor */ || kind === 138 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -19870,7 +19997,7 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); var ok = true; for (var _i = 0; _i < baseTypes.length; _i++) { var base = baseTypes[_i]; @@ -19904,7 +20031,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 203 /* 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); @@ -19923,10 +20050,10 @@ var ts; } } ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { - if (!ts.isSupportedHeritageClauseElement(heritageElement)) { + if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) { error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(heritageElement); + checkExpressionWithTypeArguments(heritageElement); }); ts.forEach(node.members, checkSourceElement); if (produceDiagnostics) { @@ -19948,7 +20075,7 @@ var ts; var ambient = ts.isInAmbientContext(node); var enumIsConst = ts.isConst(node); ts.forEach(node.members, function (member) { - if (member.name.kind !== 127 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 128 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; @@ -19988,7 +20115,7 @@ var ts; return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -19999,7 +20126,7 @@ var ts; case 47 /* TildeToken */: return ~value; } return undefined; - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -20024,11 +20151,11 @@ var ts; return undefined; case 7 /* NumericLiteral */: return +e.text; - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return evalConstant(e.expression); case 65 /* Identifier */: - case 156 /* ElementAccessExpression */: - case 155 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 156 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType; @@ -20041,7 +20168,7 @@ var ts; } else { var expression; - if (e.kind === 156 /* ElementAccessExpression */) { + if (e.kind === 157 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8 /* StringLiteral */) { return undefined; @@ -20059,7 +20186,7 @@ var ts; if (current.kind === 65 /* Identifier */) { break; } - else if (current.kind === 155 /* PropertyAccessExpression */) { + else if (current.kind === 156 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -20128,7 +20255,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 !== 204 /* EnumDeclaration */) { + if (declaration.kind !== 205 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -20151,8 +20278,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 /* ClassDeclaration */ || - (declaration.kind === 200 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 202 /* ClassDeclaration */ || + (declaration.kind === 201 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -20192,15 +20319,15 @@ var ts; var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } // 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, 201 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 202 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; @@ -20209,10 +20336,10 @@ var ts; // Checks for ambient external modules. if (node.name.kind === 8 /* StringLiteral */) { if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); } if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); } } } @@ -20220,10 +20347,10 @@ var ts; } function getFirstIdentifier(node) { while (true) { - if (node.kind === 126 /* QualifiedName */) { + if (node.kind === 127 /* QualifiedName */) { node = node.left; } - else if (node.kind === 155 /* PropertyAccessExpression */) { + else if (node.kind === 156 /* PropertyAccessExpression */) { node = node.expression; } else { @@ -20239,11 +20366,11 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; - if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 215 /* ExportDeclaration */ ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + var inAmbientExternalModule = node.parent.kind === 207 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 228 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 216 /* 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 && isExternalModuleNameRelative(moduleName.text)) { @@ -20251,7 +20378,7 @@ var ts; // 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_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); return false; } return true; @@ -20264,7 +20391,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 === 217 /* ExportSpecifier */ ? + var message = node.kind === 218 /* 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)); @@ -20287,7 +20414,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 212 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -20336,16 +20463,16 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; - if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { - error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); + var inAmbientExternalModule = node.parent.kind === 207 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 228 /* SourceFile */ && !inAmbientExternalModule) { + error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { // export * from "foo" var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { - error(node.moduleSpecifier, ts.Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); + error(node.moduleSpecifier, ts.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); } } } @@ -20357,9 +20484,9 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 227 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 205 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + var container = node.parent.kind === 228 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 206 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } // Grammar checking @@ -20373,16 +20500,22 @@ var ts; checkExpressionCached(node.expression); } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= 2 /* ES6 */) { - // export assignment is deprecated in es6 or above - grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + if (node.isExportEquals && !ts.isInAmbientContext(node)) { + if (languageVersion >= 2 /* ES6 */) { + // export assignment is deprecated in es6 or above + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + } + else if (compilerOptions.module === 4 /* System */) { + // system modules does not support export assignment + grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } } } function getModuleStatements(node) { - if (node.kind === 227 /* SourceFile */) { + if (node.kind === 228 /* SourceFile */) { return node.statements; } - if (node.kind === 205 /* ModuleDeclaration */ && node.body.kind === 206 /* ModuleBlock */) { + if (node.kind === 206 /* ModuleDeclaration */ && node.body.kind === 207 /* ModuleBlock */) { return node.body.statements; } return emptyArray; @@ -20411,107 +20544,107 @@ var ts; if (!node) return; switch (node.kind) { - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: return checkTypeParameter(node); - case 129 /* Parameter */: + case 130 /* Parameter */: return checkParameter(node); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return checkPropertyDeclaration(node); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: return checkSignatureDeclaration(node); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return checkMethodDeclaration(node); - case 135 /* Constructor */: + case 136 /* Constructor */: return checkConstructorDeclaration(node); - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return checkAccessorDeclaration(node); - case 141 /* TypeReference */: + case 142 /* TypeReference */: return checkTypeReferenceNode(node); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return checkTypeQuery(node); - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: return checkTypeLiteral(node); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return checkArrayType(node); - case 147 /* TupleType */: + case 148 /* TupleType */: return checkTupleType(node); - case 148 /* UnionType */: + case 149 /* UnionType */: return checkUnionType(node); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return checkSourceElement(node.type); - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return checkBlock(node); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return checkVariableStatement(node); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return checkExpressionStatement(node); - case 183 /* IfStatement */: + case 184 /* IfStatement */: return checkIfStatement(node); - case 184 /* DoStatement */: + case 185 /* DoStatement */: return checkDoStatement(node); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: return checkWhileStatement(node); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return checkForStatement(node); - case 187 /* ForInStatement */: + case 188 /* ForInStatement */: return checkForInStatement(node); - case 188 /* ForOfStatement */: + case 189 /* ForOfStatement */: return checkForOfStatement(node); - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return checkReturnStatement(node); - case 192 /* WithStatement */: + case 193 /* WithStatement */: return checkWithStatement(node); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return checkSwitchStatement(node); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return checkLabeledStatement(node); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: return checkThrowStatement(node); - case 196 /* TryStatement */: + case 197 /* TryStatement */: return checkTryStatement(node); - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 152 /* BindingElement */: + case 153 /* BindingElement */: return checkBindingElement(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return checkClassDeclaration(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return checkImportDeclaration(node); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return checkExportDeclaration(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return checkExportAssignment(node); - case 181 /* EmptyStatement */: + case 182 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 197 /* DebuggerStatement */: + case 198 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 218 /* MissingDeclaration */: + case 219 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -20526,81 +20659,81 @@ var ts; // Delaying the type check of the body ensures foo has been assigned a type. function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 192 /* WithStatement */: + case 193 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 129 /* Parameter */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: - case 152 /* BindingElement */: - case 153 /* ArrayLiteralExpression */: - case 154 /* ObjectLiteralExpression */: - case 224 /* PropertyAssignment */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 159 /* TaggedTemplateExpression */: - case 171 /* TemplateExpression */: - case 176 /* TemplateSpan */: - case 160 /* TypeAssertionExpression */: - case 161 /* ParenthesizedExpression */: - case 165 /* TypeOfExpression */: - case 166 /* VoidExpression */: - case 164 /* DeleteExpression */: - case 167 /* PrefixUnaryExpression */: - case 168 /* PostfixUnaryExpression */: - case 169 /* BinaryExpression */: - case 170 /* ConditionalExpression */: - case 173 /* SpreadElementExpression */: - case 179 /* Block */: - case 206 /* ModuleBlock */: - case 180 /* VariableStatement */: - case 182 /* ExpressionStatement */: - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: - case 191 /* ReturnStatement */: - case 193 /* SwitchStatement */: - case 207 /* CaseBlock */: - case 220 /* CaseClause */: - case 221 /* DefaultClause */: - case 194 /* LabeledStatement */: - case 195 /* ThrowStatement */: - case 196 /* TryStatement */: - case 223 /* CatchClause */: - case 198 /* VariableDeclaration */: - case 199 /* VariableDeclarationList */: - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 214 /* ExportAssignment */: - case 227 /* SourceFile */: + case 130 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: + case 153 /* BindingElement */: + case 154 /* ArrayLiteralExpression */: + case 155 /* ObjectLiteralExpression */: + case 225 /* PropertyAssignment */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 160 /* TaggedTemplateExpression */: + case 172 /* TemplateExpression */: + case 178 /* TemplateSpan */: + case 161 /* TypeAssertionExpression */: + case 162 /* ParenthesizedExpression */: + case 166 /* TypeOfExpression */: + case 167 /* VoidExpression */: + case 165 /* DeleteExpression */: + case 168 /* PrefixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: + case 170 /* BinaryExpression */: + case 171 /* ConditionalExpression */: + case 174 /* SpreadElementExpression */: + case 180 /* Block */: + case 207 /* ModuleBlock */: + case 181 /* VariableStatement */: + case 183 /* ExpressionStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: + case 192 /* ReturnStatement */: + case 194 /* SwitchStatement */: + case 208 /* CaseBlock */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: + case 195 /* LabeledStatement */: + case 196 /* ThrowStatement */: + case 197 /* TryStatement */: + case 224 /* CatchClause */: + case 199 /* VariableDeclaration */: + case 200 /* VariableDeclarationList */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 215 /* ExportAssignment */: + case 228 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -20663,7 +20796,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 192 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 193 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -20686,23 +20819,23 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162 /* FunctionExpression */: + case 163 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -20740,22 +20873,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162 /* FunctionExpression */: + case 163 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -20774,64 +20907,64 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 128 /* TypeParameter */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: + case 129 /* TypeParameter */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* 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 === 126 /* QualifiedName */) { + while (node.parent && node.parent.kind === 127 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 141 /* TypeReference */; + return node.parent && node.parent.kind === 142 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 155 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 156 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 177 /* HeritageClauseElement */; + return node.parent && node.parent.kind === 177 /* ExpressionWithTypeArguments */; } function isTypeNode(node) { - if (141 /* FirstTypeNode */ <= node.kind && node.kind <= 149 /* LastTypeNode */) { + if (142 /* FirstTypeNode */ <= node.kind && node.kind <= 150 /* LastTypeNode */) { return true; } switch (node.kind) { case 112 /* AnyKeyword */: - case 119 /* NumberKeyword */: - case 121 /* StringKeyword */: + case 120 /* NumberKeyword */: + case 122 /* StringKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: return true; case 99 /* VoidKeyword */: - return node.parent.kind !== 166 /* VoidExpression */; + return node.parent.kind !== 167 /* VoidExpression */; case 8 /* StringLiteral */: // Specialized signatures can have string literals as their parameters' type names - return node.parent.kind === 129 /* Parameter */; - case 177 /* HeritageClauseElement */: + return node.parent.kind === 130 /* Parameter */; + case 177 /* ExpressionWithTypeArguments */: return true; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 65 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // fall through - case 126 /* QualifiedName */: - case 155 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 127 /* QualifiedName */ || node.kind === 156 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); var parent_5 = node.parent; - if (parent_5.kind === 144 /* TypeQuery */) { + if (parent_5.kind === 145 /* TypeQuery */) { return false; } // Do not recursively call isTypeNode on the parent. In the example: @@ -20840,38 +20973,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 (141 /* FirstTypeNode */ <= parent_5.kind && parent_5.kind <= 149 /* LastTypeNode */) { + if (142 /* FirstTypeNode */ <= parent_5.kind && parent_5.kind <= 150 /* LastTypeNode */) { return true; } switch (parent_5.kind) { - case 177 /* HeritageClauseElement */: + case 177 /* ExpressionWithTypeArguments */: return true; - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: return node === parent_5.constraint; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: return node === parent_5.type; - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 135 /* Constructor */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 136 /* Constructor */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return node === parent_5.type; - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: return node === parent_5.type; - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return node === parent_5.type; - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -20879,13 +21012,13 @@ var ts; return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 126 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 127 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 209 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 214 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 215 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -20897,11 +21030,11 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 214 /* ExportAssignment */) { + if (entityName.parent.kind === 215 /* ExportAssignment */) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 155 /* PropertyAccessExpression */) { + if (entityName.kind !== 156 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); @@ -20911,7 +21044,7 @@ var ts; entityName = entityName.parent; } if (isHeritageClauseElementIdentifier(entityName)) { - var meaning = entityName.parent.kind === 177 /* HeritageClauseElement */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = entityName.parent.kind === 177 /* ExpressionWithTypeArguments */ ? 793056 /* Type */ : 1536 /* Namespace */; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } @@ -20926,14 +21059,14 @@ var ts; var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 155 /* PropertyAccessExpression */) { + else if (entityName.kind === 156 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 126 /* QualifiedName */) { + else if (entityName.kind === 127 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -20942,7 +21075,7 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 141 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = entityName.parent.kind === 142 /* 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 */; @@ -20961,14 +21094,14 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 65 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 214 /* ExportAssignment */ + return node.parent.kind === 215 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 65 /* Identifier */: - case 155 /* PropertyAccessExpression */: - case 126 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 93 /* ThisKeyword */: case 91 /* SuperKeyword */: @@ -20977,7 +21110,7 @@ var ts; case 114 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 135 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 136 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -20986,14 +21119,14 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 209 /* ImportDeclaration */ || node.parent.kind === 215 /* ExportDeclaration */) && + ((node.parent.kind === 210 /* ImportDeclaration */ || node.parent.kind === 216 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } // Intentional fall-through case 7 /* NumericLiteral */: // index access - if (node.parent.kind == 156 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind == 157 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -21010,7 +21143,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 225 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 226 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */); } return undefined; @@ -21090,7 +21223,7 @@ var ts; } // Emitter support function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 228 /* SourceFile */; } function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { // If this is es6 or higher, just use the name of the export @@ -21100,7 +21233,7 @@ var ts; } var node = getDeclarationOfAliasSymbol(symbol); if (node) { - if (node.kind === 210 /* ImportClause */) { + if (node.kind === 211 /* ImportClause */) { var defaultKeyword; if (languageVersion === 0 /* ES3 */) { defaultKeyword = "[\"default\"]"; @@ -21110,7 +21243,7 @@ var ts; } return getGeneratedNameForNode(node.parent) + defaultKeyword; } - if (node.kind === 213 /* ImportSpecifier */) { + if (node.kind === 214 /* ImportSpecifier */) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); var propertyName = node.propertyName || node.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -21119,9 +21252,11 @@ var ts; } function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { - // If this is es6 or higher, just use the name of the export + // 1. If this is es6 or higher, just use the name of the export // no need to qualify it. - if (languageVersion >= 2 /* ES6 */) { + // 2. export mechanism for System modules is different from CJS\AMD + // and it does not need qualifications for exports + if (languageVersion >= 2 /* ES6 */ || compilerOptions.module === 4 /* System */) { return undefined; } return "exports." + ts.unescapeIdentifier(symbol.name); @@ -21129,7 +21264,7 @@ var ts; var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 205 /* ModuleDeclaration */ || node.kind === 204 /* EnumDeclaration */) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 206 /* ModuleDeclaration */ || node.kind === 205 /* EnumDeclaration */) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; @@ -21158,22 +21293,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return node.expression && node.expression.kind === 65 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 227 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 228 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -21231,7 +21366,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 226 /* EnumMember */) { + if (node.kind === 227 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -21276,7 +21411,7 @@ var ts; // * The serialized type of a TypeReference with a value declaration is its entity name. // * The serialized type of a TypeReference with a call or construct signature is "Function". // * The serialized type of any other type is "Object". - var type = getTypeFromTypeReference(node); + var type = getTypeFromTypeNode(node); if (type.flags & 16 /* Void */) { return "void 0"; } @@ -21324,26 +21459,26 @@ var ts; switch (node.kind) { case 99 /* VoidKeyword */: return "void 0"; - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: return "Function"; - case 146 /* ArrayType */: - case 147 /* TupleType */: + case 147 /* ArrayType */: + case 148 /* TupleType */: return "Array"; case 113 /* BooleanKeyword */: return "Boolean"; - case 121 /* StringKeyword */: + case 122 /* StringKeyword */: case 8 /* StringLiteral */: return "String"; - case 119 /* NumberKeyword */: + case 120 /* NumberKeyword */: return "Number"; - case 141 /* TypeReference */: + case 142 /* TypeReference */: return serializeTypeReferenceNode(node, getGeneratedNameForNode); - case 144 /* TypeQuery */: - case 145 /* TypeLiteral */: - case 148 /* UnionType */: + case 145 /* TypeQuery */: + case 146 /* TypeLiteral */: + case 149 /* UnionType */: case 112 /* AnyKeyword */: break; default: @@ -21366,11 +21501,11 @@ var ts; // // For rules on serializing type annotations, see `serializeTypeNode`. switch (node.kind) { - case 201 /* ClassDeclaration */: return "Function"; - case 132 /* PropertyDeclaration */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 129 /* Parameter */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 136 /* GetAccessor */: return serializeTypeNode(node.type, getGeneratedNameForNode); - case 137 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + case 202 /* ClassDeclaration */: return "Function"; + case 133 /* PropertyDeclaration */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 130 /* Parameter */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137 /* GetAccessor */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 138 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); } if (ts.isFunctionLike(node)) { return "Function"; @@ -21387,7 +21522,7 @@ var ts; // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. if (node) { var valueDeclaration; - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* ClassDeclaration */) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -21402,10 +21537,10 @@ var ts; for (var i = 0; i < parameterCount; i++) { if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 146 /* ArrayType */) { + if (parameterType.kind === 147 /* ArrayType */) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 141 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 142 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -21453,15 +21588,21 @@ var ts; ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); return !!resolveName(location, name, 107455 /* Value */, undefined, undefined); } + function getReferencedValueDeclaration(reference) { + ts.Debug.assert(!ts.nodeIsSynthesized(reference)); + var symbol = getNodeLinks(reference).resolvedSymbol || + resolveName(reference, reference.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); + return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 152 /* BindingElement */ || (n.parent.kind === 198 /* VariableDeclaration */ && n.parent.name === n); + var isVariableDeclarationOrBindingElement = n.parent.kind === 153 /* BindingElement */ || (n.parent.kind === 199 /* VariableDeclaration */ && n.parent.name === n); var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); var isLetOrConst = symbol && (symbol.flags & 2 /* BlockScopedVariable */) && - symbol.valueDeclaration.parent.kind !== 223 /* CatchClause */; + symbol.valueDeclaration.parent.kind !== 224 /* CatchClause */; if (isLetOrConst) { // side-effect of calling this method: // assign id to symbol if it was not yet set @@ -21500,6 +21641,7 @@ var ts; resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, getBlockScopedVariableId: getBlockScopedVariableId, + getReferencedValueDeclaration: getReferencedValueDeclaration, serializeTypeOfNode: serializeTypeOfNode, serializeParameterTypesOfNode: serializeParameterTypesOfNode, serializeReturnTypeOfNode: serializeReturnTypeOfNode @@ -21561,7 +21703,7 @@ var ts; function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) // if so, we would like to give more explicit invalid usage error. - if (ts.getAncestor(identifier, 201 /* ClassDeclaration */) || ts.getAncestor(identifier, 174 /* ClassExpression */)) { + if (ts.getAncestor(identifier, 202 /* ClassDeclaration */) || ts.getAncestor(identifier, 175 /* ClassExpression */)) { return grammarErrorOnNode(identifier, message, arg0); } return false; @@ -21572,14 +21714,14 @@ var ts; var impotClause = node.importClause; if (impotClause.namedBindings) { var nameBindings = impotClause.namedBindings; - if (nameBindings.kind === 211 /* NamespaceImport */) { + if (nameBindings.kind === 212 /* NamespaceImport */) { var name_11 = nameBindings.name; if (isReservedWordInStrictMode(name_11)) { var nameText = ts.declarationNameToString(name_11); return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } } - else if (nameBindings.kind === 212 /* NamedImports */) { + else if (nameBindings.kind === 213 /* NamedImports */) { var reportError = false; for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { var element = _a[_i]; @@ -21600,23 +21742,23 @@ var ts; if (name && name.kind === 65 /* Identifier */ && isReservedWordInStrictMode(name)) { var nameText = ts.declarationNameToString(name); switch (node.kind) { - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: - case 200 /* FunctionDeclaration */: - case 128 /* TypeParameter */: - case 152 /* BindingElement */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: + case 201 /* FunctionDeclaration */: + case 129 /* TypeParameter */: + case 153 /* BindingElement */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* EnumDeclaration */: return checkGrammarIdentifierInStrictMode(name); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: // Report an error if the class declaration uses strict-mode reserved word. return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: // Report an error if the module declaration uses strict-mode reserved word. // TODO(yuisu): fix this when having external module in strict mode return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: // TODO(yuisu): fix this when having external module in strict mode return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); } @@ -21632,7 +21774,7 @@ var ts; if (typeName.kind === 65 /* Identifier */) { checkGrammarTypeNameInStrictMode(typeName); } - else if (typeName.kind === 126 /* QualifiedName */) { + else if (typeName.kind === 127 /* QualifiedName */) { // Walk from right to left and report a possible error at each Identifier in QualifiedName // Example: // x1: public.private.package // error at public and private @@ -21646,18 +21788,18 @@ var ts; // public // error at public // public.private.package // error at public // B.private.B // no error - function checkGrammarHeritageClauseElementInStrictMode(expression) { + function checkGrammarExpressionWithTypeArgumentsInStrictMode(expression) { // Example: // class C extends public // error at public if (expression && expression.kind === 65 /* Identifier */) { return checkGrammarIdentifierInStrictMode(expression); } - else if (expression && expression.kind === 155 /* PropertyAccessExpression */) { + else if (expression && expression.kind === 156 /* PropertyAccessExpression */) { // Walk from left to right in PropertyAccessExpression until we are at the left most expression // in PropertyAccessExpression. According to grammar production of MemberExpression, // the left component expression is a PrimaryExpression (i.e. Identifier) while the other // component after dots can be IdentifierName. - checkGrammarHeritageClauseElementInStrictMode(expression.expression); + checkGrammarExpressionWithTypeArgumentsInStrictMode(expression.expression); } } // The function takes an identifier itself or an expression which has SyntaxKind.Identifier. @@ -21694,7 +21836,7 @@ var ts; else if (languageVersion < 1 /* ES5 */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } - else if (node.kind === 136 /* GetAccessor */ || node.kind === 137 /* SetAccessor */) { + else if (node.kind === 137 /* GetAccessor */ || node.kind === 138 /* 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); @@ -21704,26 +21846,26 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 140 /* IndexSignature */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: - case 180 /* VariableStatement */: - case 200 /* FunctionDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 209 /* ImportDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 215 /* ExportDeclaration */: - case 214 /* ExportAssignment */: - case 129 /* Parameter */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 141 /* IndexSignature */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: + case 181 /* VariableStatement */: + case 201 /* FunctionDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 216 /* ExportDeclaration */: + case 215 /* ExportAssignment */: + case 130 /* Parameter */: break; default: return false; @@ -21757,7 +21899,7 @@ var ts; else if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { + else if (node.parent.kind === 207 /* ModuleBlock */ || node.parent.kind === 228 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -21766,10 +21908,10 @@ var ts; if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { + else if (node.parent.kind === 207 /* ModuleBlock */ || node.parent.kind === 228 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 129 /* Parameter */) { + else if (node.kind === 130 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } flags |= 128 /* Static */; @@ -21782,10 +21924,10 @@ var ts; else if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 129 /* Parameter */) { + else if (node.kind === 130 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; @@ -21794,13 +21936,13 @@ var ts; if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 129 /* Parameter */) { + else if (node.kind === 130 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 207 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -21808,7 +21950,7 @@ var ts; break; } } - if (node.kind === 135 /* Constructor */) { + if (node.kind === 136 /* Constructor */) { if (flags & 128 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -21819,13 +21961,13 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 210 /* ImportDeclaration */ || node.kind === 209 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 202 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { + else if (node.kind === 203 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 129 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 130 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -21889,7 +22031,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 163 /* ArrowFunction */) { + if (node.kind === 164 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -21924,7 +22066,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 121 /* StringKeyword */ && parameter.type.kind !== 119 /* NumberKeyword */) { + if (parameter.type.kind !== 122 /* StringKeyword */ && parameter.type.kind !== 120 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -21957,7 +22099,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 175 /* OmittedExpression */) { + if (arg.kind === 176 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -22031,11 +22173,11 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 127 /* ComputedPropertyName */) { + if (node.kind !== 128 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 169 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { + if (computedPropertyName.expression.kind === 170 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -22063,8 +22205,8 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; var name_13 = prop.name; - if (prop.kind === 175 /* OmittedExpression */ || - name_13.kind === 127 /* ComputedPropertyName */) { + if (prop.kind === 176 /* OmittedExpression */ || + name_13.kind === 128 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name_13); continue; @@ -22078,7 +22220,7 @@ 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 === 224 /* PropertyAssignment */ || prop.kind === 225 /* ShorthandPropertyAssignment */) { + if (prop.kind === 225 /* PropertyAssignment */ || prop.kind === 226 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name_13.kind === 7 /* NumericLiteral */) { @@ -22086,13 +22228,13 @@ var ts; } currentKind = Property; } - else if (prop.kind === 134 /* MethodDeclaration */) { + else if (prop.kind === 135 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 136 /* GetAccessor */) { + else if (prop.kind === 137 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 137 /* SetAccessor */) { + else if (prop.kind === 138 /* SetAccessor */) { currentKind = SetAccesor; } else { @@ -22126,24 +22268,24 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 199 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 200 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 188 /* 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 188 /* 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 === 187 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 188 /* 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); @@ -22166,10 +22308,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 136 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 137 /* GetAccessor */ && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 137 /* SetAccessor */) { + else if (kind === 138 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -22194,7 +22336,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 127 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 128 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -22204,7 +22346,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 154 /* ObjectLiteralExpression */) { + if (node.parent.kind === 155 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -22212,7 +22354,7 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.kind === 202 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -22228,22 +22370,22 @@ 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 === 202 /* InterfaceDeclaration */) { + else if (node.parent.kind === 203 /* 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 === 145 /* TypeLiteral */) { + else if (node.parent.kind === 146 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: return true; - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -22255,11 +22397,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 194 /* LabeledStatement */: + case 195 /* 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 === 189 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 190 /* ContinueStatement */ && !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); @@ -22267,8 +22409,8 @@ var ts; return false; } break; - case 193 /* SwitchStatement */: - if (node.kind === 190 /* BreakStatement */ && !node.label) { + case 194 /* SwitchStatement */: + if (node.kind === 191 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -22283,13 +22425,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 190 /* BreakStatement */ + var message = node.kind === 191 /* 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 === 190 /* BreakStatement */ + var message = node.kind === 191 /* 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); @@ -22298,10 +22440,10 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== elements[elements.length - 1]) { + 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 === 151 /* ArrayBindingPattern */ || node.name.kind === 150 /* ObjectBindingPattern */) { + if (node.name.kind === 152 /* ArrayBindingPattern */ || node.name.kind === 151 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -22314,7 +22456,7 @@ var ts; return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 187 /* ForInStatement */ && node.parent.parent.kind !== 188 /* ForOfStatement */) { + if (node.parent.parent.kind !== 188 /* ForInStatement */ && node.parent.parent.kind !== 189 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { // Error on equals token which immediate precedes the initializer @@ -22351,7 +22493,7 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - if (element.kind !== 175 /* OmittedExpression */) { + if (element.kind !== 176 /* OmittedExpression */) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -22368,15 +22510,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 183 /* IfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 192 /* WithStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 184 /* IfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 193 /* WithStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: return false; - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -22392,7 +22534,7 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 167 /* PrefixUnaryExpression */) { + if (expression.kind === 168 /* PrefixUnaryExpression */) { var unaryExpression = expression; if (unaryExpression.operator === 33 /* PlusToken */ || unaryExpression.operator === 34 /* MinusToken */) { expression = unaryExpression.operand; @@ -22421,7 +22563,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 === 127 /* ComputedPropertyName */) { + if (node.name.kind === 128 /* ComputedPropertyName */) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -22494,18 +22636,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.kind === 202 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 202 /* InterfaceDeclaration */) { + else if (node.parent.kind === 203 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 145 /* TypeLiteral */) { + else if (node.parent.kind === 146 /* 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; } @@ -22525,11 +22667,11 @@ var ts; // export_opt ExternalImportDeclaration // export_opt AmbientDeclaration // - if (node.kind === 202 /* InterfaceDeclaration */ || - node.kind === 209 /* ImportDeclaration */ || - node.kind === 208 /* ImportEqualsDeclaration */ || - node.kind === 215 /* ExportDeclaration */ || - node.kind === 214 /* ExportAssignment */ || + if (node.kind === 203 /* InterfaceDeclaration */ || + node.kind === 210 /* ImportDeclaration */ || + node.kind === 209 /* ImportEqualsDeclaration */ || + node.kind === 216 /* ExportDeclaration */ || + node.kind === 215 /* ExportAssignment */ || (node.flags & 2 /* Ambient */) || (node.flags & (1 /* Export */ | 256 /* Default */))) { return false; @@ -22539,7 +22681,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 === 180 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 181 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -22565,7 +22707,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 === 179 /* Block */ || node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { + if (node.parent.kind === 180 /* Block */ || node.parent.kind === 207 /* ModuleBlock */ || node.parent.kind === 228 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -22611,10 +22753,6 @@ var ts; return diagnostics; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); @@ -22647,7 +22785,7 @@ var ts; ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { + if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; } } @@ -22659,7 +22797,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 209 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 210 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0); writeImportDeclaration(aliasEmitInfo.node); @@ -22673,13 +22811,13 @@ var ts; // Emit references corresponding to this file var emittedReferencedFiles = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { // Check what references need to be added if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && + if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); @@ -22735,10 +22873,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 198 /* VariableDeclaration */) { + if (declaration.kind === 199 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 212 /* NamedImports */ || declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 210 /* ImportClause */) { + else if (declaration.kind === 213 /* NamedImports */ || declaration.kind === 214 /* ImportSpecifier */ || declaration.kind === 211 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -22756,7 +22894,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 === 209 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 210 /* 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; @@ -22766,12 +22904,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 206 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 206 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -22864,41 +23002,41 @@ var ts; function emitType(type) { switch (type.kind) { case 112 /* AnyKeyword */: - case 121 /* StringKeyword */: - case 119 /* NumberKeyword */: + case 122 /* StringKeyword */: + case 120 /* NumberKeyword */: case 113 /* BooleanKeyword */: - case 122 /* SymbolKeyword */: + case 123 /* SymbolKeyword */: case 99 /* VoidKeyword */: case 8 /* StringLiteral */: return writeTextOfNode(currentSourceFile, type); - case 177 /* HeritageClauseElement */: - return emitHeritageClauseElement(type); - case 141 /* TypeReference */: + case 177 /* ExpressionWithTypeArguments */: + return emitExpressionWithTypeArguments(type); + case 142 /* TypeReference */: return emitTypeReference(type); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return emitTypeQuery(type); - case 146 /* ArrayType */: + case 147 /* ArrayType */: return emitArrayType(type); - case 147 /* TupleType */: + case 148 /* TupleType */: return emitTupleType(type); - case 148 /* UnionType */: + case 149 /* UnionType */: return emitUnionType(type); - case 149 /* ParenthesizedType */: + case 150 /* ParenthesizedType */: return emitParenType(type); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 145 /* TypeLiteral */: + case 146 /* TypeLiteral */: return emitTypeLiteral(type); case 65 /* Identifier */: return emitEntityName(type); - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: return emitEntityName(type); } function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 208 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 209 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -22906,17 +23044,17 @@ var ts; writeTextOfNode(currentSourceFile, entityName); } else { - var left = entityName.kind === 126 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 126 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 127 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 127 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentSourceFile, right); } } } - function emitHeritageClauseElement(node) { - if (ts.isSupportedHeritageClauseElement(node)) { - ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 155 /* PropertyAccessExpression */); + function emitExpressionWithTypeArguments(node) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { + ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 156 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -23028,10 +23166,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 208 /* ImportEqualsDeclaration */ || - (node.parent.kind === 227 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { + else if (node.kind === 209 /* ImportEqualsDeclaration */ || + (node.parent.kind === 228 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 228 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -23041,7 +23179,7 @@ var ts; }); } else { - if (node.kind === 209 /* ImportDeclaration */) { + if (node.kind === 210 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -23059,23 +23197,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return writeVariableStatement(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return writeClassDeclaration(node); - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -23091,7 +23229,7 @@ var ts; if (node.flags & 256 /* Default */) { write("default "); } - else if (node.kind !== 202 /* InterfaceDeclaration */) { + else if (node.kind !== 203 /* InterfaceDeclaration */) { write("declare "); } } @@ -23137,7 +23275,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 211 /* NamespaceImport */) { + if (namedBindings.kind === 212 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -23165,7 +23303,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 212 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); } @@ -23218,7 +23356,7 @@ var ts; emitModuleElementDeclarationFlags(node); write("module "); writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 206 /* ModuleBlock */) { + while (node.body.kind !== 207 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentSourceFile, node.name); @@ -23279,7 +23417,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 134 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); + return node.parent.kind === 135 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -23290,15 +23428,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 === 142 /* FunctionType */ || - node.parent.kind === 143 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 145 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 134 /* MethodDeclaration */ || - node.parent.kind === 133 /* MethodSignature */ || - node.parent.kind === 142 /* FunctionType */ || - node.parent.kind === 143 /* ConstructorType */ || - node.parent.kind === 138 /* CallSignature */ || - node.parent.kind === 139 /* ConstructSignature */); + if (node.parent.kind === 143 /* FunctionType */ || + node.parent.kind === 144 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 146 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 135 /* MethodDeclaration */ || + node.parent.kind === 134 /* MethodSignature */ || + node.parent.kind === 143 /* FunctionType */ || + node.parent.kind === 144 /* ConstructorType */ || + node.parent.kind === 139 /* CallSignature */ || + node.parent.kind === 140 /* ConstructSignature */); emitType(node.constraint); } else { @@ -23309,31 +23447,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 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 138 /* CallSignature */: + case 139 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.parent.flags & 128 /* 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 === 201 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 202 /* 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 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -23358,13 +23496,13 @@ var ts; emitCommaList(typeReferences, emitTypeOfTypeReference); } function emitTypeOfTypeReference(node) { - if (ts.isSupportedHeritageClauseElement(node)) { + if (ts.isSupportedExpressionWithTypeArguments(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + if (node.parent.parent.kind === 202 /* 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 : @@ -23445,7 +23583,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 !== 198 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 199 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -23455,10 +23593,10 @@ var ts; // what we want, namely the name expression enclosed in brackets. writeTextOfNode(currentSourceFile, node.name); // If optional property emit ? - if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && ts.hasQuestionToken(node)) { + if ((node.kind === 133 /* PropertyDeclaration */ || node.kind === 132 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && node.parent.kind === 145 /* TypeLiteral */) { + if ((node.kind === 133 /* PropertyDeclaration */ || node.kind === 132 /* PropertySignature */) && node.parent.kind === 146 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 32 /* Private */)) { @@ -23467,14 +23605,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 198 /* VariableDeclaration */) { + if (node.kind === 199 /* 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 === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) { + else if (node.kind === 133 /* PropertyDeclaration */ || node.kind === 132 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (node.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? @@ -23483,7 +23621,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 === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* 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 : @@ -23515,7 +23653,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 175 /* OmittedExpression */) { + if (element.kind !== 176 /* OmittedExpression */) { elements.push(element); } } @@ -23585,7 +23723,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 === 136 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 137 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -23598,7 +23736,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 136 /* GetAccessor */ + return accessor.kind === 137 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -23607,7 +23745,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 137 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 138 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (accessorWithTypeAnnotation.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? @@ -23657,17 +23795,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 200 /* FunctionDeclaration */) { + if (node.kind === 201 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 134 /* MethodDeclaration */) { + else if (node.kind === 135 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 200 /* FunctionDeclaration */) { + if (node.kind === 201 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 135 /* Constructor */) { + else if (node.kind === 136 /* Constructor */) { write("constructor"); } else { @@ -23685,11 +23823,11 @@ var ts; } function emitSignatureDeclaration(node) { // Construct signature or constructor type write new Signature - if (node.kind === 139 /* ConstructSignature */ || node.kind === 143 /* ConstructorType */) { + if (node.kind === 140 /* ConstructSignature */ || node.kind === 144 /* ConstructorType */) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 140 /* IndexSignature */) { + if (node.kind === 141 /* IndexSignature */) { write("["); } else { @@ -23699,22 +23837,22 @@ var ts; enclosingDeclaration = node; // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 140 /* IndexSignature */) { + if (node.kind === 141 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 142 /* FunctionType */ || node.kind === 143 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 145 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 143 /* FunctionType */ || node.kind === 144 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 146 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 135 /* Constructor */ && !(node.flags & 32 /* Private */)) { + else if (node.kind !== 136 /* Constructor */ && !(node.flags & 32 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -23725,26 +23863,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 139 /* ConstructSignature */: + case 140 /* 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 138 /* CallSignature */: + case 139 /* 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 140 /* IndexSignature */: + case 141 /* 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 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -23752,7 +23890,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 === 201 /* ClassDeclaration */) { + else if (node.parent.kind === 202 /* 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 : @@ -23766,7 +23904,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 200 /* FunctionDeclaration */: + case 201 /* 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 : @@ -23801,9 +23939,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 142 /* FunctionType */ || - node.parent.kind === 143 /* ConstructorType */ || - node.parent.parent.kind === 145 /* TypeLiteral */) { + if (node.parent.kind === 143 /* FunctionType */ || + node.parent.kind === 144 /* ConstructorType */ || + node.parent.parent.kind === 146 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32 /* Private */)) { @@ -23819,24 +23957,24 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 135 /* Constructor */: + case 136 /* 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 139 /* ConstructSignature */: + case 140 /* 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 138 /* CallSignature */: + case 139 /* 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 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (node.parent.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -23844,7 +23982,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 === 201 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 202 /* 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 : @@ -23857,7 +23995,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 200 /* FunctionDeclaration */: + case 201 /* 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 : @@ -23869,12 +24007,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 === 150 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 151 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 151 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 152 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -23893,7 +24031,7 @@ var ts; typeName: bindingElement.name } : undefined; } - if (bindingElement.kind === 175 /* OmittedExpression */) { + if (bindingElement.kind === 176 /* 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) @@ -23902,7 +24040,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 152 /* BindingElement */) { + else if (bindingElement.kind === 153 /* 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" @@ -23943,40 +24081,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 205 /* ModuleDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 202 /* InterfaceDeclaration */: - case 201 /* ClassDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: + case 201 /* FunctionDeclaration */: + case 206 /* ModuleDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 203 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, !node.importClause); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return emitExportDeclaration(node); - case 135 /* Constructor */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 136 /* Constructor */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return writeFunctionDeclaration(node); - case 139 /* ConstructSignature */: - case 138 /* CallSignature */: - case 140 /* IndexSignature */: + case 140 /* ConstructSignature */: + case 139 /* CallSignature */: + case 141 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return emitAccessorDeclaration(node); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return emitPropertyDeclaration(node); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return emitExportAssignment(node); - case 227 /* SourceFile */: + case 228 /* SourceFile */: return emitSourceFile(node); } } @@ -24023,6 +24161,10 @@ var ts; /* @internal */ var ts; (function (ts) { + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; // Flags enum to track count of temp variables and a few dedicated names var TempFlags; (function (TempFlags) { @@ -24033,16 +24175,16 @@ var ts; // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature function emitFiles(resolver, host, targetSourceFile) { // emit output for the __extends helper function - var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; // emit output for the __decorate helper function - var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; // emit output for the __metadata helper function - var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\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};"; // emit output for the __param helper function - var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; + var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0 /* ES3 */; - var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; var diagnostics = []; var newLine = host.getNewLine(); if (targetSourceFile === undefined) { @@ -24100,6 +24242,13 @@ var ts; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; var currentSourceFile; + // name of an exporter function if file is a System external module + // System.register([...], function () {...}) + // exporting in System modules looks like: + // export var x; ... x = 1 + // => + // var x;... exporter("x", x = 1) + var exportFunctionForFile; var generatedNameSet = {}; var nodeToGeneratedName = []; var blockScopedVariableToGeneratedName; @@ -24118,7 +24267,8 @@ var ts; var writeEmittedFiles = writeJavaScriptFile; var detachedCommentsInfo; var writeComment = ts.writeCommentRange; - var emitSourceFileStart = function (node) { }; + /** Emit a node */ + var emit = emitNodeWithoutSourceMap; /** Called just before starting emit of a node */ var emitStart = function (node) { }; /** Called once the emit of the node is done */ @@ -24138,7 +24288,7 @@ var ts; var scopeEmitEnd = function () { }; /** Sourcemap data that will get encoded */ var sourceMapData; - if (compilerOptions.sourceMap) { + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { initializeEmitterWithSourceMaps(); } if (root) { @@ -24147,7 +24297,7 @@ var ts; } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { emitSourceFile(sourceFile); } }); @@ -24157,6 +24307,7 @@ var ts; return; function emitSourceFile(sourceFile) { currentSourceFile = sourceFile; + exportFunctionForFile = undefined; emit(sourceFile); } function isUniqueName(name) { @@ -24243,25 +24394,25 @@ var ts; } function generateNameForNode(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 201 /* ClassDeclaration */: - case 174 /* ClassExpression */: + case 201 /* FunctionDeclaration */: + case 202 /* ClassDeclaration */: + case 175 /* ClassExpression */: generateNameForFunctionOrClassDeclaration(node); break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: generateNameForModuleOrEnum(node); generateNameForNode(node.body); break; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: generateNameForModuleOrEnum(node); break; - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: generateNameForImportDeclaration(node); break; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: generateNameForExportDeclaration(node); break; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: generateNameForExportAssignment(node); break; } @@ -24281,7 +24432,7 @@ var ts; var sourceMapNameIndexMap = {}; var sourceMapNameIndices = []; function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; } // Last recorded and encoded spans var lastRecordedSourceMapSpan; @@ -24417,6 +24568,12 @@ var ts; sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; // The one that can be used from program to get the actual source file sourceMapData.inputSourceFileNames.push(node.fileName); + if (compilerOptions.inlineSources) { + if (!sourceMapData.sourceMapSourcesContent) { + sourceMapData.sourceMapSourcesContent = []; + } + sourceMapData.sourceMapSourcesContent.push(node.text); + } } function recordScopeNameOfNode(node, scopeName) { function recordScopeNameIndex(scopeNameIndex) { @@ -24431,7 +24588,7 @@ var ts; // unless it is a computed property. Then it is shown with brackets, // but the brackets are included in the name. var name_17 = node.name; - if (!name_17 || name_17.kind !== 127 /* ComputedPropertyName */) { + if (!name_17 || name_17.kind !== 128 /* ComputedPropertyName */) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -24449,20 +24606,20 @@ var ts; // The scope was already given a name use it recordScopeNameStart(scopeName); } - else if (node.kind === 200 /* FunctionDeclaration */ || - node.kind === 162 /* FunctionExpression */ || - node.kind === 134 /* MethodDeclaration */ || - node.kind === 133 /* MethodSignature */ || - node.kind === 136 /* GetAccessor */ || - node.kind === 137 /* SetAccessor */ || - node.kind === 205 /* ModuleDeclaration */ || - node.kind === 201 /* ClassDeclaration */ || - node.kind === 204 /* EnumDeclaration */) { + else if (node.kind === 201 /* FunctionDeclaration */ || + node.kind === 163 /* FunctionExpression */ || + node.kind === 135 /* MethodDeclaration */ || + node.kind === 134 /* MethodSignature */ || + node.kind === 137 /* GetAccessor */ || + node.kind === 138 /* SetAccessor */ || + node.kind === 206 /* ModuleDeclaration */ || + node.kind === 202 /* ClassDeclaration */ || + node.kind === 205 /* EnumDeclaration */) { // Declaration and has associated name use it if (node.name) { var name_18 = node.name; // For computed property names, the text will include the brackets - scopeName = name_18.kind === 127 /* ComputedPropertyName */ + scopeName = name_18.kind === 128 /* ComputedPropertyName */ ? ts.getTextOfNode(name_18) : node.name.text; } @@ -24482,18 +24639,22 @@ var ts; ts.writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { + function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { if (typeof JSON !== "undefined") { - return JSON.stringify({ + var map_1 = { version: version, file: file, sourceRoot: sourceRoot, sources: sources, names: names, mappings: mappings - }); + }; + if (sourcesContent !== undefined) { + map_1.sourcesContent = sourcesContent; + } + return JSON.stringify(map_1); } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; + return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; function serializeStringArray(list) { var output = ""; for (var i = 0, n = list.length; i < n; i++) { @@ -24506,12 +24667,22 @@ var ts; } } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { - // Write source map file encodeLastRecordedSourceMapSpan(); - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); + var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); sourceMapDataList.push(sourceMapData); + var sourceMapUrl; + if (compilerOptions.inlineSourceMap) { + // Encode the sourceMap into the sourceMap url + var base64SourceMapText = ts.convertToBase64(sourceMapText); + sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; + } + else { + // Write source map file + ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); + sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; + } // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); } // Initialize source map data var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); @@ -24524,6 +24695,7 @@ var ts; inputSourceFileNames: [], sourceMapNames: [], sourceMapMappings: "", + sourceMapSourcesContent: undefined, sourceMapDecodedMappings: [] }; // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -24552,8 +24724,24 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } + function emitNodeWithSourceMap(node, allowGeneratedIdentifiers) { + if (node) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node, false); + } + if (node.kind != 228 /* SourceFile */) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); + recordEmitNodeEndSpan(node); + } + else { + recordNewSourceFileStart(node); + emitNodeWithoutSourceMap(node, false); + } + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emitSourceFileStart = recordNewSourceFileStart; + emit = emitNodeWithSourceMap; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -24715,7 +24903,7 @@ var ts; } function emitLiteral(node) { var text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { + if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else if (languageVersion < 2 /* ES6 */ && isBinaryOrOctalIntegerLiteral(node, text)) { @@ -24804,10 +24992,10 @@ var ts; write("("); emit(tempVariable); // Now we emit the expressions - if (node.template.kind === 171 /* TemplateExpression */) { + if (node.template.kind === 172 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 169 /* BinaryExpression */ + var needsParens = templateSpan.expression.kind === 170 /* BinaryExpression */ && templateSpan.expression.operatorToken.kind === 23 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -24842,7 +25030,7 @@ var ts; // ("abc" + 1) << (2 + "") // rather than // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 161 /* ParenthesizedExpression */ + var needsParens = templateSpan.expression.kind !== 162 /* 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 @@ -24884,11 +25072,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return parent.expression === template; - case 159 /* TaggedTemplateExpression */: - case 161 /* ParenthesizedExpression */: + case 160 /* TaggedTemplateExpression */: + case 162 /* ParenthesizedExpression */: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; @@ -24909,7 +25097,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 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: switch (expression.operatorToken.kind) { case 35 /* AsteriskToken */: case 36 /* SlashToken */: @@ -24921,8 +25109,8 @@ var ts; default: return -1 /* LessThan */; } - case 172 /* YieldExpression */: - case 170 /* ConditionalExpression */: + case 173 /* YieldExpression */: + case 171 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -24937,11 +25125,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 !== 152 /* BindingElement */); + ts.Debug.assert(node.kind !== 153 /* BindingElement */); if (node.kind === 8 /* StringLiteral */) { emitLiteral(node); } - else if (node.kind === 127 /* ComputedPropertyName */) { + else if (node.kind === 128 /* 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: @@ -24985,36 +25173,36 @@ var ts; function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: - case 226 /* EnumMember */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 200 /* FunctionDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 205 /* ModuleDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: + case 227 /* EnumMember */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 206 /* ModuleDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: return parent.name === node; - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: return parent.name === node || parent.propertyName === node; - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: - case 214 /* ExportAssignment */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 215 /* ExportAssignment */: return false; - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return node.parent.label === node; } } @@ -25091,7 +25279,7 @@ var ts; } function emitBindingElement(node) { if (node.propertyName) { - emitVerbatimDeclarationName(node.propertyName); + emit(node.propertyName, false); write(": "); } if (node.dotDotDotToken) { @@ -25122,11 +25310,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 65 /* Identifier */: - case 153 /* ArrayLiteralExpression */: - case 155 /* PropertyAccessExpression */: - case 156 /* ElementAccessExpression */: - case 157 /* CallExpression */: - case 161 /* ParenthesizedExpression */: + case 154 /* ArrayLiteralExpression */: + case 156 /* PropertyAccessExpression */: + case 157 /* ElementAccessExpression */: + case 158 /* CallExpression */: + case 162 /* 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; @@ -25146,14 +25334,14 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 173 /* SpreadElementExpression */) { + if (e.kind === 174 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < length && elements[i].kind !== 173 /* SpreadElementExpression */) { + while (i < length && elements[i].kind !== 174 /* SpreadElementExpression */) { i++; } write("["); @@ -25174,7 +25362,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 173 /* SpreadElementExpression */; + return node.kind === 174 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; @@ -25244,7 +25432,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 136 /* GetAccessor */ || property.kind === 137 /* SetAccessor */) { + if (property.kind === 137 /* GetAccessor */ || property.kind === 138 /* SetAccessor */) { // TODO (drosen): Reconcile with 'emitMemberFunctions'. var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { @@ -25296,13 +25484,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 224 /* PropertyAssignment */) { + if (property.kind === 225 /* PropertyAssignment */) { emit(property.initializer); } - else if (property.kind === 225 /* ShorthandPropertyAssignment */) { + else if (property.kind === 226 /* ShorthandPropertyAssignment */) { emitExpressionIdentifier(property.name); } - else if (property.kind === 134 /* MethodDeclaration */) { + else if (property.kind === 135 /* MethodDeclaration */) { emitFunctionDeclaration(property); } else { @@ -25336,7 +25524,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 === 127 /* ComputedPropertyName */) { + if (properties[i].name.kind === 128 /* ComputedPropertyName */) { numInitialNonComputedProperties = i; break; } @@ -25352,21 +25540,21 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(169 /* BinaryExpression */, startsOnNewLine); + var result = ts.createSynthesizedNode(170 /* BinaryExpression */, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(155 /* PropertyAccessExpression */); + var result = ts.createSynthesizedNode(156 /* PropertyAccessExpression */); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(20 /* DotToken */); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(156 /* ElementAccessExpression */); + var result = ts.createSynthesizedNode(157 /* ElementAccessExpression */); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; @@ -25380,10 +25568,10 @@ var ts; // NumberLiteral // 1.x -> not the same as (1).x // - if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 159 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { return expr; } - var node = ts.createSynthesizedNode(161 /* ParenthesizedExpression */); + var node = ts.createSynthesizedNode(162 /* ParenthesizedExpression */); node.expression = expr; return node; } @@ -25396,19 +25584,19 @@ var ts; if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { write("*"); } - emitVerbatimDeclarationName(node.name); + emit(node.name, false); if (languageVersion < 2 /* ES6 */) { write(": function "); } emitSignatureAndBody(node); } function emitPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node) { - emitVerbatimDeclarationName(node.name); + emit(node.name, false); // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment. For example: // module m { // export let y; @@ -25447,7 +25635,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 155 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 156 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -25481,7 +25669,7 @@ var ts; var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emitVerbatimDeclarationName(node.name); + emit(node.name, false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { @@ -25499,10 +25687,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 173 /* SpreadElementExpression */; }); + return ts.forEach(elements, function (e) { return e.kind === 174 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 161 /* ParenthesizedExpression */ || node.kind === 160 /* TypeAssertionExpression */) { + while (node.kind === 162 /* ParenthesizedExpression */ || node.kind === 161 /* TypeAssertionExpression */) { node = node.expression; } return node; @@ -25523,13 +25711,13 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 155 /* PropertyAccessExpression */) { + if (expr.kind === 156 /* PropertyAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 156 /* ElementAccessExpression */) { + else if (expr.kind === 157 /* ElementAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); @@ -25574,7 +25762,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 155 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; + superCall = node.expression.kind === 156 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; } if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); @@ -25611,12 +25799,12 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 163 /* ArrowFunction */) { - if (node.expression.kind === 160 /* TypeAssertionExpression */) { + if (!node.parent || node.parent.kind !== 164 /* ArrowFunction */) { + if (node.expression.kind === 161 /* TypeAssertionExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind == 160 /* TypeAssertionExpression */) { + while (operand.kind == 161 /* TypeAssertionExpression */) { operand = operand.expression; } // We have an expression of the form: (SubExpr) @@ -25627,14 +25815,14 @@ 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 !== 167 /* PrefixUnaryExpression */ && - operand.kind !== 166 /* VoidExpression */ && - operand.kind !== 165 /* TypeOfExpression */ && - operand.kind !== 164 /* DeleteExpression */ && - operand.kind !== 168 /* PostfixUnaryExpression */ && - operand.kind !== 158 /* NewExpression */ && - !(operand.kind === 157 /* CallExpression */ && node.parent.kind === 158 /* NewExpression */) && - !(operand.kind === 162 /* FunctionExpression */ && node.parent.kind === 157 /* CallExpression */)) { + if (operand.kind !== 168 /* PrefixUnaryExpression */ && + operand.kind !== 167 /* VoidExpression */ && + operand.kind !== 166 /* TypeOfExpression */ && + operand.kind !== 165 /* DeleteExpression */ && + operand.kind !== 169 /* PostfixUnaryExpression */ && + operand.kind !== 159 /* NewExpression */ && + !(operand.kind === 158 /* CallExpression */ && node.parent.kind === 159 /* NewExpression */) && + !(operand.kind === 163 /* FunctionExpression */ && node.parent.kind === 158 /* CallExpression */)) { emit(operand); return; } @@ -25659,7 +25847,27 @@ var ts; write(" "); emit(node.expression); } + function isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node) { + if (!isCurrentFileSystemExternalModule() || node.kind !== 65 /* Identifier */ || ts.nodeIsSynthesized(node)) { + return false; + } + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 199 /* VariableDeclaration */ || node.parent.kind === 153 /* BindingElement */); + var targetDeclaration = isVariableDeclarationOrBindingElement + ? node.parent + : resolver.getReferencedValueDeclaration(node); + return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); + } function emitPrefixUnaryExpression(node) { + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + // emit + // ++x + // as + // exports('x', ++x) + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + } write(ts.tokenToString(node.operator)); // In some cases, we need to emit a space between the operator and the operand. One obvious case // is when the operator is an identifier, like delete or typeof. We also need to do this for plus @@ -25673,7 +25881,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 === 167 /* PrefixUnaryExpression */) { + if (node.operand.kind === 168 /* PrefixUnaryExpression */) { var operand = node.operand; if (node.operator === 33 /* PlusToken */ && (operand.operator === 33 /* PlusToken */ || operand.operator === 38 /* PlusPlusToken */)) { write(" "); @@ -25683,23 +25891,87 @@ var ts; } } emit(node.operand); + if (exportChanged) { + write(")"); + } } function emitPostfixUnaryExpression(node) { - emit(node.operand); - write(ts.tokenToString(node.operator)); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + // export function returns the value that was passes as the second argument + // however for postfix unary expressions result value should be the value before modification. + // emit 'x++' as '(export('x', ++x) - 1)' and 'x--' as '(export('x', --x) + 1)' + write("(" + exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.operand); + write("\", "); + write(ts.tokenToString(node.operator)); + emit(node.operand); + if (node.operator === 38 /* PlusPlusToken */) { + write(") - 1)"); + } + else { + write(") + 1)"); + } + } + else { + emit(node.operand); + write(ts.tokenToString(node.operator)); + } + } + function shouldHoistDeclarationInSystemJsModule(node) { + return isSourceFileLevelDeclarationInSystemJsModule(node, false); + } + /* + * Checks if given node is a source file level declaration (not nested in module/function). + * If 'isExported' is true - then declaration must also be exported. + * This function is used in two cases: + * - check if node is a exported source file level value to determine + * if we should also export the value after its it changed + * - check if node is a source level declaration to emit it differently, + * i.e non-exported variable statement 'var x = 1' is hoisted so + * we we emit variable statement 'var' should be dropped. + */ + function isSourceFileLevelDeclarationInSystemJsModule(node, isExported) { + if (!node || languageVersion >= 2 /* ES6 */ || !isCurrentFileSystemExternalModule()) { + return false; + } + var current = node; + while (current) { + if (current.kind === 228 /* SourceFile */) { + return !isExported || ((ts.getCombinedNodeFlags(node) & 1 /* Export */) !== 0); + } + else if (ts.isFunctionLike(current) || current.kind === 207 /* ModuleBlock */) { + return false; + } + else { + current = current.parent; + } + } } function emitBinaryExpression(node) { if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 53 /* EqualsToken */ && - (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 182 /* ExpressionStatement */); + (node.left.kind === 155 /* ObjectLiteralExpression */ || node.left.kind === 154 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 183 /* ExpressionStatement */); } else { + var exportChanged = node.operatorToken.kind >= 53 /* FirstAssignment */ && + node.operatorToken.kind <= 64 /* LastAssignment */ && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.left); + if (exportChanged) { + // emit assignment 'x y' as 'exports("x", x y)' + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.left); + write("\", "); + } emit(node.left); var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 /* CommaToken */ ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + if (exportChanged) { + write(")"); + } } } function synthesizedNodeStartsOnNewLine(node) { @@ -25731,7 +26003,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 179 /* Block */) { + if (node && node.kind === 180 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -25746,12 +26018,12 @@ var ts; emitToken(14 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 206 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 205 /* ModuleDeclaration */); + if (node.kind === 207 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 206 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 206 /* ModuleBlock */) { + if (node.kind === 207 /* ModuleBlock */) { emitTempDeclarations(true); } decreaseIndent(); @@ -25760,7 +26032,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 179 /* Block */) { + if (node.kind === 180 /* Block */) { write(" "); emit(node); } @@ -25772,7 +26044,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 163 /* ArrowFunction */); + emitParenthesizedIf(node.expression, node.expression.kind === 164 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { @@ -25785,7 +26057,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(76 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 183 /* IfStatement */) { + if (node.elseStatement.kind === 184 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -25797,7 +26069,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 179 /* Block */) { + if (node.statement.kind === 180 /* Block */) { write(" "); } else { @@ -25813,7 +26085,15 @@ var ts; write(")"); emitEmbeddedStatement(node.statement); } - function emitStartOfVariableDeclarationList(decl, startPos) { + /* Returns true if start of variable declaration list was emitted. + * Return false if nothing was written - this can happen for source file level variable declarations + * in system modules - such variable declarations are hoisted. + */ + function tryEmitStartOfVariableDeclarationList(decl, startPos) { + if (shouldHoistVariable(decl, true)) { + // variables in variable declaration list were already hoisted + return false; + } var tokenKind = 98 /* VarKeyword */; if (decl && languageVersion >= 2 /* ES6 */) { if (ts.isLet(decl)) { @@ -25825,28 +26105,53 @@ var ts; } if (startPos !== undefined) { emitToken(tokenKind, startPos); + write(" "); } else { switch (tokenKind) { case 98 /* VarKeyword */: - return write("var "); + write("var "); + break; case 104 /* LetKeyword */: - return write("let "); + write("let "); + break; case 70 /* ConstKeyword */: - return write("const "); + write("const "); + break; } } + return true; + } + function emitVariableDeclarationListSkippingUninitializedEntries(list) { + var started = false; + for (var _a = 0, _b = list.declarations; _a < _b.length; _a++) { + var decl = _b[_a]; + if (!decl.initializer) { + continue; + } + if (!started) { + started = true; + } + else { + write(", "); + } + emit(decl); + } + return started; } function emitForStatement(node) { var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(16 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 200 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; - var declarations = variableDeclarationList.declarations; - emitStartOfVariableDeclarationList(declarations[0], endPos); - write(" "); - emitCommaList(declarations); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + if (startIsEmitted) { + emitCommaList(variableDeclarationList.declarations); + } + else { + emitVariableDeclarationListSkippingUninitializedEntries(variableDeclarationList); + } } else if (node.initializer) { emit(node.initializer); @@ -25854,30 +26159,28 @@ var ts; write(";"); emitOptional(" ", node.condition); write(";"); - emitOptional(" ", node.iterator); + emitOptional(" ", node.incrementor); write(")"); emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 188 /* ForOfStatement */) { + if (languageVersion < 2 /* ES6 */ && node.kind === 189 /* ForOfStatement */) { return emitDownLevelForOfStatement(node); } var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(16 /* OpenParenToken */, endPos); - if (node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - var decl = variableDeclarationList.declarations[0]; - emitStartOfVariableDeclarationList(decl, endPos); - write(" "); - emit(decl); + tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 187 /* ForInStatement */) { + if (node.kind === 188 /* ForInStatement */) { write(" in "); } else { @@ -25927,30 +26230,30 @@ var ts; emitStart(node.expression); write("var "); // _i = 0 - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); if (!rhsIsIdentifier) { // , _a = expr write(", "); emitStart(node.expression); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(" = "); - emitWithoutSourceMap(node.expression); + emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } write("; "); // _i < _a.length; emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" < "); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(".length"); emitEnd(node.initializer); write("; "); // _i++) emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); emitToken(17 /* CloseParenToken */, node.expression.end); @@ -25962,7 +26265,7 @@ var ts; // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 199 /* VariableDeclarationList */) { + if (node.initializer.kind === 200 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -25975,35 +26278,35 @@ var ts; else { // The following call does not include the initializer, so we have // to emit it separately. - emitWithoutSourceMap(declaration); + emitNodeWithoutSourceMap(declaration); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { // It's an empty declaration list. This can only happen in an error case, if the user wrote // for (let of []) {} - emitWithoutSourceMap(createTempVariable(0 /* Auto */)); + emitNodeWithoutSourceMap(createTempVariable(0 /* Auto */)); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { // Initializer is an expression. Emit the expression in the body, so that it's // evaluated on every iteration. var assignmentExpression = createBinaryExpression(node.initializer, 53 /* EqualsToken */, rhsIterationValue, false); - if (node.initializer.kind === 153 /* ArrayLiteralExpression */ || node.initializer.kind === 154 /* ObjectLiteralExpression */) { + if (node.initializer.kind === 154 /* ArrayLiteralExpression */ || node.initializer.kind === 155 /* 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, true, undefined); } else { - emitWithoutSourceMap(assignmentExpression); + emitNodeWithoutSourceMap(assignmentExpression); } } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 179 /* Block */) { + if (node.statement.kind === 180 /* Block */) { emitLines(node.statement.statements); } else { @@ -26015,7 +26318,7 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 191 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -26060,7 +26363,7 @@ var ts; ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 220 /* CaseClause */) { + if (node.kind === 221 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -26115,7 +26418,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 205 /* ModuleDeclaration */); + } while (node && node.kind !== 206 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -26130,17 +26433,17 @@ var ts; write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < 2 /* ES6 */) { + else if (languageVersion < 2 /* ES6 */ && compilerOptions.module !== 4 /* System */) { write("exports."); } } - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { var zero = ts.createSynthesizedNode(7 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(166 /* VoidExpression */); + var result = ts.createSynthesizedNode(167 /* VoidExpression */); result.expression = zero; return result; } @@ -26148,19 +26451,35 @@ var ts; if (node.flags & 1 /* Export */) { writeLine(); emitStart(node); - if (node.flags & 256 /* Default */) { - if (languageVersion === 0 /* ES3 */) { - write("exports[\"default\"]"); + if (compilerOptions.module === 4 /* System */) { + // emit export default as + // export("default", ) + write(exportFunctionForFile + "(\""); + if (node.flags & 256 /* Default */) { + write("default"); } else { - write("exports.default"); + emitNodeWithoutSourceMap(node.name); } + write("\", "); + emitDeclarationName(node); + write(")"); } else { - emitModuleMemberName(node); + if (node.flags & 256 /* Default */) { + if (languageVersion === 0 /* ES3 */) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); } - write(" = "); - emitNameOfDeclaration(node); emitEnd(node); write(";"); } @@ -26170,13 +26489,24 @@ var ts; for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { var specifier = _b[_a]; writeLine(); - emitStart(specifier.name); - emitContainingModuleName(specifier); - write("."); - emitWithoutSourceMap(specifier.name); - emitEnd(specifier.name); - write(" = "); - emitExpressionIdentifier(name); + if (compilerOptions.module === 4 /* System */) { + emitStart(specifier.name); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(specifier.name); + write("\", "); + emitExpressionIdentifier(name); + write(")"); + emitEnd(specifier.name); + } + else { + emitStart(specifier.name); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier.name); + write(" = "); + emitExpressionIdentifier(name); + } write(";"); } } @@ -26185,8 +26515,18 @@ var ts; var emitCount = 0; // An exported declaration is actually emitted as an assignment (to a property on the module object), so // temporary variables in an exported declaration need to have real declarations elsewhere - var isDeclaration = (root.kind === 198 /* VariableDeclaration */ && !(ts.getCombinedNodeFlags(root) & 1 /* Export */)) || root.kind === 129 /* Parameter */; - if (root.kind === 169 /* BinaryExpression */) { + // 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 === 199 /* VariableDeclaration */) { + var isExported = ts.getCombinedNodeFlags(root) & 1 /* Export */; + var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); + canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; + } + else if (root.kind === 130 /* Parameter */) { + canDefineTempVariablesInPlace = true; + } + if (root.kind === 170 /* BinaryExpression */) { emitAssignmentExpression(root); } else { @@ -26198,7 +26538,14 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 198 /* VariableDeclaration */ || name.parent.kind === 152 /* BindingElement */)) { + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 199 /* VariableDeclaration */ || name.parent.kind === 153 /* BindingElement */); + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(name); + write("\", "); + } + if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } else { @@ -26206,11 +26553,14 @@ var ts; } write(" = "); emit(value); + if (exportChanged) { + write(")"); + } } function ensureIdentifier(expr) { if (expr.kind !== 65 /* Identifier */) { var identifier = createTempVariable(0 /* Auto */); - if (!isDeclaration) { + if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -26223,14 +26573,14 @@ var ts; // we need to generate a temporary variable value = ensureIdentifier(value); // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(169 /* BinaryExpression */); + var equals = ts.createSynthesizedNode(170 /* BinaryExpression */); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(30 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(170 /* ConditionalExpression */); + var cond = ts.createSynthesizedNode(171 /* ConditionalExpression */); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(50 /* QuestionToken */); cond.whenTrue = whenTrue; @@ -26250,7 +26600,7 @@ var ts; return createPropertyAccessExpression(object, propName); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(157 /* CallExpression */); + var call = ts.createSynthesizedNode(158 /* CallExpression */); var sliceIdentifier = ts.createSynthesizedNode(65 /* Identifier */); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -26267,7 +26617,7 @@ var ts; } for (var _a = 0; _a < properties.length; _a++) { var p = properties[_a]; - if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + if (p.kind === 225 /* PropertyAssignment */ || p.kind === 226 /* ShorthandPropertyAssignment */) { // TODO(andersh): Computed property support var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); @@ -26283,8 +26633,8 @@ var ts; } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175 /* OmittedExpression */) { - if (e.kind !== 173 /* SpreadElementExpression */) { + if (e.kind !== 176 /* OmittedExpression */) { + if (e.kind !== 174 /* SpreadElementExpression */) { emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } else if (i === elements.length - 1) { @@ -26294,14 +26644,14 @@ var ts; } } function emitDestructuringAssignment(target, value) { - if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { + if (target.kind === 170 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 154 /* ObjectLiteralExpression */) { + if (target.kind === 155 /* ObjectLiteralExpression */) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 153 /* ArrayLiteralExpression */) { + else if (target.kind === 154 /* ArrayLiteralExpression */) { emitArrayLiteralAssignment(target, value); } else { @@ -26315,14 +26665,14 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 161 /* ParenthesizedExpression */) { + if (root.parent.kind !== 162 /* ParenthesizedExpression */) { write("("); } value = ensureIdentifier(value); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 161 /* ParenthesizedExpression */) { + if (root.parent.kind !== 162 /* ParenthesizedExpression */) { write(")"); } } @@ -26346,12 +26696,12 @@ var ts; } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 150 /* ObjectBindingPattern */) { + if (pattern.kind === 151 /* 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 !== 175 /* OmittedExpression */) { + else if (element.kind !== 176 /* OmittedExpression */) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); @@ -26379,7 +26729,6 @@ var ts; } else { renameNonTopLevelLetAndConst(node.name); - emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2 /* ES6 */) { // downlevel emit for non-initialized let bindings defined in loops @@ -26392,16 +26741,26 @@ var ts; (getCombinedFlagsForIdentifier(node.name) & 4096 /* Let */); // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isUninitializedLet && - node.parent.parent.kind !== 187 /* ForInStatement */ && - node.parent.parent.kind !== 188 /* ForOfStatement */) { + node.parent.parent.kind !== 188 /* ForInStatement */ && + node.parent.parent.kind !== 189 /* ForOfStatement */) { initializer = createVoidZero(); } } + var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.name); + if (exportChanged) { + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(node.name); + write("\", "); + } + emitModuleMemberName(node); emitOptional(" = ", initializer); + if (exportChanged) { + write(")"); + } } } function emitExportVariableAssignments(node) { - if (node.kind === 175 /* OmittedExpression */) { + if (node.kind === 176 /* OmittedExpression */) { return; } var name = node.name; @@ -26413,7 +26772,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { + if (!node.parent || (node.parent.kind !== 199 /* VariableDeclaration */ && node.parent.kind !== 153 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -26428,7 +26787,7 @@ var ts; if (languageVersion >= 2 /* ES6 */ || ts.nodeIsSynthesized(node) || node.kind !== 65 /* Identifier */ || - (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { + (node.parent.kind !== 199 /* VariableDeclaration */ && node.parent.kind !== 153 /* BindingElement */)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); @@ -26437,17 +26796,17 @@ var ts; return; } // here it is known that node is a block scoped variable - var list = ts.getAncestor(node, 199 /* VariableDeclarationList */); - if (list.parent.kind === 180 /* VariableStatement */) { - var isSourceFileLevelBinding = list.parent.parent.kind === 227 /* SourceFile */; - var isModuleLevelBinding = list.parent.parent.kind === 206 /* ModuleBlock */; - var isFunctionLevelBinding = list.parent.parent.kind === 179 /* Block */ && ts.isFunctionLike(list.parent.parent.parent); + var list = ts.getAncestor(node, 200 /* VariableDeclarationList */); + if (list.parent.kind === 181 /* VariableStatement */) { + var isSourceFileLevelBinding = list.parent.parent.kind === 228 /* SourceFile */; + var isModuleLevelBinding = list.parent.parent.kind === 207 /* ModuleBlock */; + var isFunctionLevelBinding = list.parent.parent.kind === 180 /* Block */ && ts.isFunctionLike(list.parent.parent.parent); if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { return; } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 227 /* SourceFile */ + var parent = blockScopeContainer.kind === 228 /* SourceFile */ ? blockScopeContainer : blockScopeContainer.parent; if (resolver.resolvesToSomeValue(parent, node.text)) { @@ -26462,19 +26821,28 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 1 /* Export */) && languageVersion >= 2 /* ES6 */ && - node.parent.kind === 227 /* SourceFile */; + node.parent.kind === 228 /* SourceFile */; } function emitVariableStatement(node) { + var startIsEmitted = true; if (!(node.flags & 1 /* Export */)) { - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { // Exported ES6 module member write("export "); - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); + } + if (startIsEmitted) { + emitCommaList(node.declarationList.declarations); + write(";"); + } + else { + var atLeastOneItem = emitVariableDeclarationListSkippingUninitializedEntries(node.declarationList); + if (atLeastOneItem) { + write(";"); + } } - emitCommaList(node.declarationList.declarations); - write(";"); if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); } @@ -26521,14 +26889,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitWithoutSourceMap(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -26548,7 +26916,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -26569,7 +26937,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -26578,27 +26946,27 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 136 /* GetAccessor */ ? "get " : "set "); - emitVerbatimDeclarationName(node.name); + write(node.kind === 137 /* GetAccessor */ ? "get " : "set "); + emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 163 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; + return node.kind === 164 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } - function emitNameOfDeclaration(node) { + function emitDeclarationName(node) { if (node.name) { - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(getGeneratedNameForNode(node)); } } function shouldEmitFunctionName(node) { - if (node.kind === 162 /* FunctionExpression */) { + if (node.kind === 163 /* FunctionExpression */) { // Emit name if one is present return !!node.name; } - if (node.kind === 200 /* FunctionDeclaration */) { + if (node.kind === 201 /* FunctionDeclaration */) { // Emit name if one is present, or emit generated name in down-level case (for export default case) return !!node.name || languageVersion < 2 /* ES6 */; } @@ -26607,6 +26975,10 @@ var ts; if (ts.nodeIsMissing(node.body)) { return emitOnlyPinnedOrTripleSlashComments(node); } + if (node.kind !== 135 /* MethodDeclaration */ && node.kind !== 134 /* MethodSignature */) { + // Methods will emit the comments as part of emitting method declaration + emitLeadingComments(node); + } // For targeting below es6, emit functions-like declaration including arrow function using function keyword. // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead if (!shouldEmitAsArrowFunction(node)) { @@ -26623,12 +26995,15 @@ var ts; write(" "); } if (shouldEmitFunctionName(node)) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 /* ES6 */ && node.kind === 200 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 /* ES6 */ && node.kind === 201 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } + if (node.kind !== 135 /* MethodDeclaration */ && node.kind !== 134 /* MethodSignature */) { + emitTrailingComments(node); + } } function emitCaptureThisForNodeIfNecessary(node) { if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { @@ -26677,7 +27052,7 @@ var ts; // in that case. write(" { }"); } - else if (node.body.kind === 179 /* Block */) { + else if (node.body.kind === 180 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -26708,10 +27083,10 @@ var ts; write(" "); // Unwrap all type assertions. var current = body; - while (current.kind === 160 /* TypeAssertionExpression */) { + while (current.kind === 161 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 154 /* ObjectLiteralExpression */); + emitParenthesizedIf(body, current.kind === 155 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -26787,9 +27162,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 182 /* ExpressionStatement */) { + if (statement && statement.kind === 183 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 157 /* CallExpression */) { + if (expr && expr.kind === 158 /* CallExpression */) { var func = expr.expression; if (func && func.kind === 91 /* SuperKeyword */) { return statement; @@ -26805,7 +27180,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitWithoutSourceMap(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -26818,22 +27193,22 @@ var ts; // TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here. if (memberName.kind === 8 /* StringLiteral */ || memberName.kind === 7 /* NumericLiteral */) { write("["); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 127 /* ComputedPropertyName */) { + else if (memberName.kind === 128 /* ComputedPropertyName */) { emitComputedPropertyName(memberName); } else { write("."); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); } } - function getInitializedProperties(node, static) { + function getInitializedProperties(node, isStatic) { var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 132 /* PropertyDeclaration */ && static === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { + if (member.kind === 133 /* PropertyDeclaration */ && isStatic === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { properties.push(member); } } @@ -26855,7 +27230,7 @@ var ts; } else { if (property.flags & 128 /* Static */) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } else { write("this"); @@ -26873,11 +27248,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 178 /* SemicolonClassElement */) { + if (member.kind === 179 /* SemicolonClassElement */) { writeLine(); write(";"); } - else if (member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) { + else if (member.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */) { if (!member.body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -26896,7 +27271,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) { + else if (member.kind === 137 /* GetAccessor */ || member.kind === 138 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -26946,22 +27321,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) && !member.body) { + if ((member.kind === 135 /* MethodDeclaration */ || node.kind === 134 /* MethodSignature */) && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === 134 /* MethodDeclaration */ || - member.kind === 136 /* GetAccessor */ || - member.kind === 137 /* SetAccessor */) { + else if (member.kind === 135 /* MethodDeclaration */ || + member.kind === 137 /* GetAccessor */ || + member.kind === 138 /* SetAccessor */) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 128 /* Static */) { write("static "); } - if (member.kind === 136 /* GetAccessor */) { + if (member.kind === 137 /* GetAccessor */) { write("get "); } - else if (member.kind === 137 /* SetAccessor */) { + else if (member.kind === 138 /* SetAccessor */) { write("set "); } if (member.asteriskToken) { @@ -26972,7 +27347,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 178 /* SemicolonClassElement */) { + else if (member.kind === 179 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -26997,11 +27372,11 @@ var ts; var hasInstancePropertyWithInitializer = false; // Emit the constructor overload pinned comments ts.forEach(node.members, function (member) { - if (member.kind === 135 /* Constructor */ && !member.body) { + if (member.kind === 136 /* Constructor */ && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } // Check if there is any non-static property assignment - if (member.kind === 132 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { + if (member.kind === 133 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -27017,7 +27392,7 @@ var ts; emitStart(ctor || node); if (languageVersion < 2 /* ES6 */) { write("function "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitSignatureParameters(ctor); } else { @@ -27109,7 +27484,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* 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: @@ -27167,7 +27542,7 @@ var ts; write("export "); } write("let "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = "); } else if (isES6ExportedDeclaration(node)) { @@ -27189,7 +27564,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, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174 /* ClassExpression */; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 175 /* ClassExpression */; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0 /* Auto */); @@ -27202,7 +27577,7 @@ var ts; // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. if ((node.name || !(node.flags & 256 /* Default */)) && !thisNodeIsDecorated) { write(" "); - emitNameOfDeclaration(node); + emitDeclarationName(node); } var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { @@ -27219,6 +27594,7 @@ var ts; writeLine(); emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); + // TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now. // For a decorated class, we need to assign its name (if it has one). This is because we emit // the class as a class expression to avoid the double-binding of the identifier: // @@ -27228,15 +27604,6 @@ var ts; // if (thisNodeIsDecorated) { write(";"); - if (node.name) { - writeLine(); - write("Object.defineProperty("); - emitNameOfDeclaration(node); - write(", \"name\", { value: \""); - emitNameOfDeclaration(node); - write("\", configurable: true });"); - writeLine(); - } } // Emit static property assignment. Because classDeclaration is lexically evaluated, // it is safe to emit static property assignment after classDeclaration @@ -27268,7 +27635,7 @@ var ts; emitStart(node); emitModuleMemberName(node); write(" = "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitEnd(node); write(";"); } @@ -27276,14 +27643,17 @@ var ts; // if this is a top level default export of decorated class, write the export after the declaration. writeLine(); write("export default "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(";"); } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 201 /* ClassDeclaration */) { - write("var "); - emitNameOfDeclaration(node); + if (node.kind === 202 /* ClassDeclaration */) { + // source file level classes in system modules are hoisted so 'var's for them are already defined + if (!shouldHoistDeclarationInSystemJsModule(node)) { + write("var "); + } + emitDeclarationName(node); write(" = "); } write("(function ("); @@ -27306,7 +27676,7 @@ var ts; writeLine(); emitStart(baseTypeNode); write("__extends("); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(", _super);"); emitEnd(baseTypeNode); } @@ -27319,7 +27689,7 @@ var ts; writeLine(); emitToken(15 /* CloseBraceToken */, node.members.end, function () { write("return "); - emitNameOfDeclaration(node); + emitDeclarationName(node); }); write(";"); emitTempDeclarations(true); @@ -27337,11 +27707,11 @@ var ts; emit(baseTypeNode.expression); } write(")"); - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 201 /* ClassDeclaration */) { + if (node.kind === 202 /* ClassDeclaration */) { emitExportMemberAssignment(node); } if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile && node.name) { @@ -27349,7 +27719,7 @@ var ts; } } function emitClassMemberPrefix(node, member) { - emitNameOfDeclaration(node); + emitDeclarationName(node); if (!(member.flags & 128 /* Static */)) { write(".prototype"); } @@ -27379,7 +27749,7 @@ var ts; // writeLine(); emitStart(node); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); @@ -27394,7 +27764,7 @@ var ts; decreaseIndent(); writeLine(); write("], "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); @@ -27433,7 +27803,7 @@ var ts; else { decorators = member.decorators; // we only decorate the parameters here if this is a method - if (member.kind === 134 /* MethodDeclaration */) { + if (member.kind === 135 /* MethodDeclaration */) { functionLikeMember = member; } } @@ -27471,7 +27841,7 @@ var ts; // writeLine(); emitStart(member); - if (member.kind !== 132 /* PropertyDeclaration */) { + if (member.kind !== 133 /* PropertyDeclaration */) { write("Object.defineProperty("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -27501,7 +27871,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - if (member.kind !== 132 /* PropertyDeclaration */) { + if (member.kind !== 133 /* PropertyDeclaration */) { write(", Object.getOwnPropertyDescriptor("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -27543,10 +27913,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 134 /* MethodDeclaration */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 132 /* PropertyDeclaration */: + case 135 /* MethodDeclaration */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 133 /* PropertyDeclaration */: return true; } return false; @@ -27556,7 +27926,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 134 /* MethodDeclaration */: + case 135 /* MethodDeclaration */: return true; } return false; @@ -27566,9 +27936,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 201 /* ClassDeclaration */: - case 134 /* MethodDeclaration */: - case 137 /* SetAccessor */: + case 202 /* ClassDeclaration */: + case 135 /* MethodDeclaration */: + case 138 /* SetAccessor */: return true; } return false; @@ -27731,7 +28101,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 205 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 206 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -27748,7 +28118,9 @@ var ts; if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - if (!isModuleMergedWithES6Class(node)) { + var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); + var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); + if (emitVarForModule) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); @@ -27765,7 +28137,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 206 /* ModuleBlock */) { + if (node.body.kind === 207 /* ModuleBlock */) { var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; tempFlags = 0; @@ -27799,6 +28171,14 @@ var ts; write(" = {}));"); emitEnd(node); if (!isES6ExportedDeclaration(node) && node.name.kind === 65 /* Identifier */ && node.parent === currentSourceFile) { + if (compilerOptions.module === 4 /* System */ && (node.flags & 1 /* Export */)) { + writeLine(); + write(exportFunctionForFile + "(\""); + emitDeclarationName(node); + write("\", "); + emitDeclarationName(node); + write(")"); + } emitExportMemberAssignments(node.name); } } @@ -27815,16 +28195,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 208 /* ImportEqualsDeclaration */) { + if (node.kind === 209 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 212 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 209 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; + return node.kind === 210 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -27852,7 +28232,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 212 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -27878,7 +28258,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 208 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; + var isExportedImport = node.kind === 209 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (compilerOptions.module !== 2 /* AMD */) { emitLeadingComments(node); @@ -27897,7 +28277,7 @@ var ts; // import { x, y } from "foo" // import d, * as x from "foo" // import d, { x, y } from "foo" - var isNakedImport = 209 /* ImportDeclaration */ && !node.importClause; + var isNakedImport = 210 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -27965,6 +28345,7 @@ var ts; } } function emitExportDeclaration(node) { + ts.Debug.assert(compilerOptions.module !== 4 /* System */); if (languageVersion < 2 /* ES6 */) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); @@ -27985,11 +28366,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitWithoutSourceMap(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); } @@ -28025,7 +28406,7 @@ var ts; } if (node.moduleSpecifier) { write(" from "); - emitWithoutSourceMap(node.moduleSpecifier); + emitNodeWithoutSourceMap(node.moduleSpecifier); } write(";"); emitEnd(node); @@ -28043,10 +28424,10 @@ var ts; } emitStart(specifier); if (specifier.propertyName) { - emitWithoutSourceMap(specifier.propertyName); + emitNodeWithoutSourceMap(specifier.propertyName); write(" as "); } - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier); needsComma = true; } @@ -28060,8 +28441,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 200 /* FunctionDeclaration */ && - expression.kind !== 201 /* ClassDeclaration */) { + if (expression.kind !== 201 /* FunctionDeclaration */ && + expression.kind !== 202 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -28069,14 +28450,21 @@ var ts; else { writeLine(); emitStart(node); - emitContainingModuleName(node); - if (languageVersion === 0 /* ES3 */) { - write("[\"default\"] = "); + if (compilerOptions.module === 4 /* System */) { + write(exportFunctionForFile + "(\"default\","); + emit(node.expression); + write(")"); } else { - write(".default = "); + emitContainingModuleName(node); + if (languageVersion === 0 /* ES3 */) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } + emit(node.expression); } - emit(node.expression); write(";"); emitEnd(node); } @@ -28090,7 +28478,7 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { // import "mod" @@ -28100,13 +28488,13 @@ var ts; externalImports.push(node); } break; - case 208 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 219 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + case 209 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 220 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -28127,7 +28515,7 @@ var ts; } } break; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; @@ -28148,25 +28536,494 @@ var ts; write("}"); } } - function emitAMDModule(node, startIndex) { + function getLocalNameForExternalImport(importNode) { + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + return getGeneratedNameForNode(importNode); + } + } + function getExternalModuleNameText(importNode) { + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8 /* StringLiteral */) { + return getLiteralText(moduleName); + } + return undefined; + } + function emitVariableDeclarationsForImports() { + if (externalImports.length === 0) { + return; + } + writeLine(); + var started = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var importNode = externalImports[_a]; + // do not create variable declaration for exports and imports that lack import clause + var skipNode = importNode.kind === 216 /* ExportDeclaration */ || + (importNode.kind === 210 /* ImportDeclaration */ && !importNode.importClause); + if (skipNode) { + continue; + } + if (!started) { + write("var "); + started = true; + } + else { + write(", "); + } + write(getLocalNameForExternalImport(importNode)); + } + if (started) { + write(";"); + } + } + function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { + // when resolving exports local exported entries/indirect exported entries in the module + // should always win over entries with similar names that were added via star exports + // to support this we store names of local/indirect exported entries in a set. + // this set is used to filter names brought by star expors. + if (!hasExportStars) { + // local names set is needed only in presence of star exports + return undefined; + } + // local names set should only be added if we have anything exported + if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { + // no exported declarations (export var ...) or export specifiers (export {x}) + // check if we have any non star export declarations. + var hasExportDeclarationWithExportClause = false; + for (var _a = 0; _a < externalImports.length; _a++) { + var externalImport = externalImports[_a]; + if (externalImport.kind === 216 /* ExportDeclaration */ && externalImport.exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + if (!hasExportDeclarationWithExportClause) { + // we still need to emit exportStar helper + return emitExportStarFunction(undefined); + } + } + var exportedNamesStorageRef = makeUniqueName("exportedNames"); + writeLine(); + write("var " + exportedNamesStorageRef + " = {"); + increaseIndent(); + var started = false; + if (exportedDeclarations) { + for (var i = 0; i < exportedDeclarations.length; ++i) { + // write name of exported declaration, i.e 'export var x...' + writeExportedName(exportedDeclarations[i]); + } + } + if (exportSpecifiers) { + for (var n in exportSpecifiers) { + for (var _b = 0, _c = exportSpecifiers[n]; _b < _c.length; _b++) { + var specifier = _c[_b]; + // write name of export specified, i.e. 'export {x}' + writeExportedName(specifier.name); + } + } + } + for (var _d = 0; _d < externalImports.length; _d++) { + var externalImport = externalImports[_d]; + if (externalImport.kind !== 216 /* ExportDeclaration */) { + continue; + } + var exportDecl = externalImport; + if (!exportDecl.exportClause) { + // export * from ... + continue; + } + for (var _e = 0, _f = exportDecl.exportClause.elements; _e < _f.length; _e++) { + var element = _f[_e]; + // write name of indirectly exported entry, i.e. 'export {x} from ...' + writeExportedName(element.name || element.propertyName); + } + } + decreaseIndent(); + writeLine(); + write("};"); + return emitExportStarFunction(exportedNamesStorageRef); + function emitExportStarFunction(localNames) { + var exportStarFunction = makeUniqueName("exportStar"); + writeLine(); + // define an export star helper function + write("function " + exportStarFunction + "(m) {"); + increaseIndent(); + writeLine(); + write("for(var n in m) {"); + increaseIndent(); + writeLine(); + write("if (n !== \"default\""); + if (localNames) { + write("&& !" + localNames + ".hasOwnProperty(n)"); + } + write(") " + exportFunctionForFile + "(n, m[n]);"); + decreaseIndent(); + writeLine(); + write("}"); + decreaseIndent(); + writeLine(); + write("}"); + return exportStarFunction; + } + function writeExportedName(node) { + // do not record default exports + // they are local to module and never overwritten (explicitly skipped) by star export + if (node.kind !== 65 /* Identifier */ && node.flags & 256 /* Default */) { + return; + } + if (started) { + write(","); + } + else { + started = true; + } + writeLine(); + write("'"); + if (node.kind === 65 /* Identifier */) { + emitNodeWithoutSourceMap(node); + } + else { + emitDeclarationName(node); + } + write("': true"); + } + } + function processTopLevelVariableAndFunctionDeclarations(node) { + // per ES6 spec: + // 15.2.1.16.4 ModuleDeclarationInstantiation() Concrete Method + // - var declarations are initialized to undefined - 14.a.ii + // - function/generator declarations are instantiated - 16.a.iv + // this means that after module is instantiated but before its evaluation + // exported functions are already accessible at import sites + // in theory we should hoist only exported functions and its dependencies + // in practice to simplify things we'll hoist all source level functions and variable declaration + // including variables declarations for module and class declarations + var hoistedVars; + var hoistedFunctionDeclarations; + var exportedDeclarations; + visit(node); + if (hoistedVars) { + writeLine(); + write("var "); + for (var i = 0; i < hoistedVars.length; ++i) { + var local = hoistedVars[i]; + if (i !== 0) { + write(", "); + } + if (local.kind === 202 /* ClassDeclaration */ || local.kind === 206 /* ModuleDeclaration */) { + emitDeclarationName(local); + } + else { + emit(local); + } + var flags = ts.getCombinedNodeFlags(local.kind === 65 /* Identifier */ ? local.parent : local); + if (flags & 1 /* Export */) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(local); + } + } + write(";"); + } + if (hoistedFunctionDeclarations) { + for (var _a = 0; _a < hoistedFunctionDeclarations.length; _a++) { + var f = hoistedFunctionDeclarations[_a]; + writeLine(); + emit(f); + if (f.flags & 1 /* Export */) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(f); + } + } + } + return exportedDeclarations; + function visit(node) { + if (node.kind === 201 /* FunctionDeclaration */) { + if (!hoistedFunctionDeclarations) { + hoistedFunctionDeclarations = []; + } + hoistedFunctionDeclarations.push(node); + return; + } + if (node.kind === 202 /* ClassDeclaration */) { + // TODO: rename block scoped classes + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 206 /* ModuleDeclaration */ && shouldEmitModuleDeclaration(node)) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(node); + return; + } + if (node.kind === 199 /* VariableDeclaration */ || node.kind === 153 /* BindingElement */) { + if (shouldHoistVariable(node, false)) { + var name_21 = node.name; + if (name_21.kind === 65 /* Identifier */) { + if (!hoistedVars) { + hoistedVars = []; + } + hoistedVars.push(name_21); + } + else { + ts.forEachChild(name_21, visit); + } + } + return; + } + if (ts.isBindingPattern(node)) { + ts.forEach(node.elements, visit); + return; + } + if (!ts.isDeclaration(node)) { + ts.forEachChild(node, visit); + } + } + } + function shouldHoistVariable(node, checkIfSourceFileLevelDecl) { + if (checkIfSourceFileLevelDecl && !shouldHoistDeclarationInSystemJsModule(node)) { + return false; + } + // hoist variable if + // - it is not block scoped + // - it is top level block scoped + // 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) & 12288 /* BlockScoped */) === 0 || + ts.getEnclosingBlockScopeContainer(node).kind === 228 /* SourceFile */; + } + function isCurrentFileSystemExternalModule() { + return compilerOptions.module === 4 /* System */ && ts.isExternalModule(currentSourceFile); + } + function emitSystemModuleBody(node, startIndex) { + // shape of the body in system modules: + // function (exports) { + // + // + // + // return { + // setters: [ + // + // ], + // execute: function() { + // + // } + // } + // + // } + // I.e: + // import {x} from 'file1' + // var y = 1; + // export function foo() { return y + x(); } + // console.log(y); + // will be transformed to + // function(exports) { + // var file1; // local alias + // var y; + // function foo() { return y + file1.x(); } + // exports("foo", foo); + // return { + // setters: [ + // function(v) { file1 = v } + // ], + // execute(): function() { + // y = 1; + // console.log(y); + // } + // }; + // } + emitVariableDeclarationsForImports(); + writeLine(); + var exportedDeclarations = processTopLevelVariableAndFunctionDeclarations(node); + var exportStarFunction = emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations); + writeLine(); + write("return {"); + increaseIndent(); + writeLine(); + emitSetters(exportStarFunction); + writeLine(); + emitExecute(node, startIndex); + emitTempDeclarations(true); + decreaseIndent(); + writeLine(); + write("}"); // return + } + function emitSetters(exportStarFunction) { + write("setters:["); + for (var i = 0; i < externalImports.length; ++i) { + if (i !== 0) { + write(","); + } + writeLine(); + increaseIndent(); + var importNode = externalImports[i]; + var importVariableName = getLocalNameForExternalImport(importNode) || ""; + var parameterName = "_" + importVariableName; + write("function (" + parameterName + ") {"); + switch (importNode.kind) { + case 210 /* ImportDeclaration */: + if (!importNode.importClause) { + // 'import "..."' case + // module is imported only for side-effects, setter body will be empty + break; + } + // fall-through + case 209 /* ImportEqualsDeclaration */: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + writeLine(); + // save import into the local + write(importVariableName + " = " + parameterName + ";"); + writeLine(); + var defaultName = importNode.kind === 210 /* ImportDeclaration */ + ? importNode.importClause.name + : importNode.name; + if (defaultName) { + // emit re-export for imported default name + // import n1 from 'foo1' + // import n2 = require('foo2') + // export {n1} + // export {n2} + emitExportMemberAssignments(defaultName); + writeLine(); + } + if (importNode.kind === 210 /* ImportDeclaration */ && + importNode.importClause.namedBindings) { + var namedBindings = importNode.importClause.namedBindings; + if (namedBindings.kind === 212 /* NamespaceImport */) { + // emit re-export for namespace + // import * as n from 'foo' + // export {n} + emitExportMemberAssignments(namedBindings.name); + writeLine(); + } + else { + // emit re-exports for named imports + // import {a, b} from 'foo' + // export {a, b as c} + for (var _a = 0, _b = namedBindings.elements; _a < _b.length; _a++) { + var element = _b[_a]; + emitExportMemberAssignments(element.name || element.propertyName); + writeLine(); + } + } + } + decreaseIndent(); + break; + case 216 /* ExportDeclaration */: + ts.Debug.assert(importVariableName !== ""); + increaseIndent(); + if (importNode.exportClause) { + // export {a, b as c} from 'foo' + // emit as: + // exports('a', _foo["a"]) + // exports('c', _foo["b"]) + for (var _c = 0, _d = importNode.exportClause.elements; _c < _d.length; _c++) { + var e = _d[_c]; + writeLine(); + write(exportFunctionForFile + "(\""); + emitNodeWithoutSourceMap(e.name); + write("\", " + parameterName + "[\""); + emitNodeWithoutSourceMap(e.propertyName || e.name); + write("\"]);"); + } + } + else { + writeLine(); + // export * from 'foo' + // emit as: + // exportStar(_foo); + write(exportStarFunction + "(" + parameterName + ");"); + } + writeLine(); + decreaseIndent(); + break; + } + write("}"); + decreaseIndent(); + } + write("],"); + } + function emitExecute(node, startIndex) { + write("execute: function() {"); + increaseIndent(); + writeLine(); + for (var i = startIndex; i < node.statements.length; ++i) { + var statement = node.statements[i]; + // - imports/exports are not emitted for system modules + // - function declarations are not emitted because they were already hoisted + switch (statement.kind) { + case 216 /* ExportDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 201 /* FunctionDeclaration */: + continue; + } + writeLine(); + emit(statement); + } + decreaseIndent(); + writeLine(); + write("}"); // execute + } + function emitSystemModule(node, startIndex) { collectExternalModuleInfo(node); + // System modules has the following shape + // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) + // 'exports' here is a function 'exports(name: string, value: T): T' that is used to publish exported values. + // 'exports' returns its 'value' argument so in most cases expressions + // that mutate exported values can be rewritten as: + // expr -> exports('name', expr). + // The only exception in this rule is postfix unary operators, + // see comment to 'emitPostfixUnaryExpression' for more details + ts.Debug.assert(!exportFunctionForFile); + // make sure that name of 'exports' function does not conflict with existing identifiers + exportFunctionForFile = makeUniqueName("exports"); + write("System.register(["); + for (var i = 0; i < externalImports.length; ++i) { + var text = getExternalModuleNameText(externalImports[i]); + if (i !== 0) { + write(", "); + } + write(text); + } + write("], function(" + exportFunctionForFile + ") {"); + writeLine(); + increaseIndent(); + emitCaptureThisForNodeIfNecessary(node); + emitSystemModuleBody(node, startIndex); + decreaseIndent(); + writeLine(); + write("});"); + } + function emitAMDDependencies(node, includeNonAmdDependencies) { // An AMD define function has the following shape: // define(id?, dependencies?, factory); // // This has the shape of // define(name, ["module1", "module2"], function (module1Alias) { - // The location of the alias in the parameter list in the factory function needs to + // The location of the alias in the parameter list in the factory function needs to // match the position of the module name in the dependency list. // - // To ensure this is true in cases of modules with no aliases, e.g.: - // `import "module"` or `` + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` // we need to add modules without alias names to the end of the dependencies list - var aliasedModuleNames = []; // names of modules with corresponding parameter in the + var aliasedModuleNames = []; // names of modules with corresponding parameter in the // factory function. var unaliasedModuleNames = []; // names of modules with no corresponding parameters in // factory function. var importAliasNames = []; // names of the parameters in the factory function; these - // paramters need to match the indexes of the corresponding + // parameters need to match the indexes of the corresponding // module names in aliasedModuleNames. // Fill in amd-dependency tags for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { @@ -28182,21 +29039,10 @@ var ts; for (var _c = 0; _c < externalImports.length; _c++) { var importNode = externalImports[_c]; // Find the name of the external module - var externalModuleName = ""; - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8 /* StringLiteral */) { - externalModuleName = getLiteralText(moduleName); - } - // Find the name of the module alais, if there is one - var importAliasName = void 0; - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); - } - else { - importAliasName = getGeneratedNameForNode(importNode); - } - if (importAliasName) { + var externalModuleName = getExternalModuleNameText(importNode); + // Find the name of the module alias, if there is one + var importAliasName = getLocalNameForExternalImport(importNode); + if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); importAliasNames.push(importAliasName); } @@ -28204,11 +29050,6 @@ var ts; unaliasedModuleNames.push(externalModuleName); } } - writeLine(); - write("define("); - if (node.amdModuleName) { - write("\"" + node.amdModuleName + "\", "); - } write("[\"require\", \"exports\""); if (aliasedModuleNames.length) { write(", "); @@ -28223,6 +29064,15 @@ var ts; write(", "); write(importAliasNames.join(", ")); } + } + function emitAMDModule(node, startIndex) { + collectExternalModuleInfo(node); + writeLine(); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + emitAMDDependencies(node, true); write(") {"); increaseIndent(); emitExportStarHelper(); @@ -28242,6 +29092,22 @@ var ts; emitTempDeclarations(true); emitExportEquals(false); } + function emitUMDModule(node, startIndex) { + collectExternalModuleInfo(node); + // Module is detected first to support Browserify users that load into a browser with an AMD loader + writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})("); + emitAMDDependencies(node, false); + write(") {"); + increaseIndent(); + emitExportStarHelper(); + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(true); + emitExportEquals(true); + decreaseIndent(); + writeLine(); + write("});"); + } function emitES6Module(node, startIndex) { externalImports = undefined; exportSpecifiers = undefined; @@ -28294,30 +29160,39 @@ var ts; emitDetachedComments(node); // emit prologue directives prior to __extends var startIndex = emitDirectivePrologues(node.statements, false); - // 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 */)) { - writeLines(extendsHelper); - extendsEmitted = true; - } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { - writeLines(decorateHelper); - if (compilerOptions.emitDecoratorMetadata) { - writeLines(metadataHelper); + // Only emit helpers if the user did not say otherwise. + 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 */)) { + writeLines(extendsHelper); + extendsEmitted = true; + } + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } + decorateEmitted = true; + } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { + writeLines(paramHelper); + paramEmitted = true; } - decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { - writeLines(paramHelper); - paramEmitted = true; - } - if (ts.isExternalModule(node)) { + if (ts.isExternalModule(node) || compilerOptions.separateCompilation) { if (languageVersion >= 2 /* ES6 */) { emitES6Module(node, startIndex); } else if (compilerOptions.module === 2 /* AMD */) { emitAMDModule(node, startIndex); } + else if (compilerOptions.module === 4 /* System */) { + emitSystemModule(node, startIndex); + } + else if (compilerOptions.module === 3 /* UMD */) { + emitUMDModule(node, startIndex); + } else { emitCommonJSModule(node, startIndex); } @@ -28333,86 +29208,18 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - /** - * The standard function to emit on any Node. - * This will take care of leading/trailing comments, and sourcemaps if applicable. - */ - function emit(node) { - emitNodeWorker(node, true, true); - } - /** - * A function to be called in the case where sourcemaps should not be tracked for a single node. - * This will still take care of leading/trailing comments. - * - * Note, however, that sourcemap tracking may resume for child nodes within the given - * node depending on the specifics of how the given node will be emitted. - * - * For instance, if this function is called with the node 'a + b', then we will not track - * the sourcemap for 'a + b' itself, but if 'emit' is called instead for nodes 'a' and 'b', - * then both 'a' and 'b' will have sourcemaps recorded if appropriate. - */ - function emitWithoutSourceMap(node) { - emitNodeWorker(node, false, true); - } - /** - * Emits a node with comments and tracks sourcemaps for said node, disallowing the renaming - * of identifiers to be *for this node*. - * - * This is useful in scenarios when a name's usage can be non-local and it is not feasible to - * rename it (e.g. the declaration name of a property for a shorthand property). - * - * Note that preventing generated identifier renaming only applies if the given node is an - * identifier. If it is not an identifier, contained identifiers may still be replaced - * by their generated counterparts. - * - * For instance, given an the computed property '[a + b]' from below : - * var x = { - * [a + b]() { - * } - * } - * Both 'a' and 'b' may be replaced by generated counterparts in '[a + b]'. - */ - function emitVerbatimDeclarationName(node) { - emitNodeWorker(node, true, false); - } - /** - * Do not call this function directly. - * - * This function acts as a common path to 'emit' and 'emitNodeWithoutSourceMap' - * that is aware of ordering between comments and sourcemap spans. - */ - function emitNodeWorker(node, shouldEmitSourceMap, allowGeneratedIdentifiers) { + function emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers) { if (!node) { return; } if (node.flags & 2 /* Ambient */) { - emitOnlyPinnedOrTripleSlashComments(node); - return; - } - // Emitting on a SourceFile is a special case; there is not necessarily - // a corresponding start/end we're interested in, and comments will be - // emitted for the end-of-file - if (node.kind === 227 /* SourceFile */) { - if (shouldEmitSourceMap) { - emitSourceFileStart(node); - } - emitBareNode(node, allowGeneratedIdentifiers); - return; + return emitOnlyPinnedOrTripleSlashComments(node); } var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } - // Only track sourcemaps on *parsed* nodes when requested. - // Synthesized nodes do not correspond to text in the original source. - if (shouldEmitSourceMap && !ts.nodeIsSynthesized(node)) { - emitStart(node); - emitBareNode(node, allowGeneratedIdentifiers); - emitEnd(node); - } - else { - emitBareNode(node, allowGeneratedIdentifiers); - } + emitJavaScriptWorker(node, allowGeneratedIdentifiers); if (emitComments) { emitTrailingComments(node); } @@ -28421,19 +29228,18 @@ var ts; 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 202 /* InterfaceDeclaration */: - case 209 /* ImportDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 214 /* ExportAssignment */: + case 203 /* InterfaceDeclaration */: + case 201 /* FunctionDeclaration */: + case 210 /* ImportDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 215 /* ExportAssignment */: return false; - case 200 /* FunctionDeclaration */: - return !!node.body; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); @@ -28442,9 +29248,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 !== 179 /* Block */ && + if (node.kind !== 180 /* Block */ && node.parent && - node.parent.kind === 163 /* ArrowFunction */ && + node.parent.kind === 164 /* ArrowFunction */ && node.parent.body === node && compilerOptions.target <= 1 /* ES5 */) { return false; @@ -28452,21 +29258,19 @@ var ts; // Emit comments for everything else. return true; } - /** - * Emits a node without emitting comments or tracking sourcemap information. - */ - function emitBareNode(node, allowGeneratedIdentifiers) { + function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { + if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } // Check if the node can be emitted regardless of the ScriptTarget switch (node.kind) { case 65 /* Identifier */: return emitIdentifier(node, allowGeneratedIdentifiers); - case 129 /* Parameter */: + case 130 /* Parameter */: return emitParameter(node); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return emitMethod(node); - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: return emitAccessor(node); case 93 /* ThisKeyword */: return emitThis(node); @@ -28486,140 +29290,140 @@ var ts; case 12 /* TemplateMiddle */: case 13 /* TemplateTail */: return emitLiteral(node); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: return emitTemplateExpression(node); - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return emitTemplateSpan(node); - case 126 /* QualifiedName */: + case 127 /* QualifiedName */: return emitQualifiedName(node); - case 150 /* ObjectBindingPattern */: + case 151 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 151 /* ArrayBindingPattern */: + case 152 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 152 /* BindingElement */: + case 153 /* BindingElement */: return emitBindingElement(node); - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 224 /* PropertyAssignment */: + case 225 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 225 /* ShorthandPropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 127 /* ComputedPropertyName */: + case 128 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 155 /* PropertyAccessExpression */: + case 156 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 157 /* CallExpression */: + case 158 /* CallExpression */: return emitCallExpression(node); - case 158 /* NewExpression */: + case 159 /* NewExpression */: return emitNewExpression(node); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 160 /* TypeAssertionExpression */: + case 161 /* TypeAssertionExpression */: return emit(node.expression); - case 161 /* ParenthesizedExpression */: + case 162 /* ParenthesizedExpression */: return emitParenExpression(node); - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 164 /* DeleteExpression */: + case 165 /* DeleteExpression */: return emitDeleteExpression(node); - case 165 /* TypeOfExpression */: + case 166 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 166 /* VoidExpression */: + case 167 /* VoidExpression */: return emitVoidExpression(node); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 168 /* PostfixUnaryExpression */: + case 169 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return emitBinaryExpression(node); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return emitConditionalExpression(node); - case 173 /* SpreadElementExpression */: + case 174 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 172 /* YieldExpression */: + case 173 /* YieldExpression */: return emitYieldExpression(node); - case 175 /* OmittedExpression */: + case 176 /* OmittedExpression */: return; - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return emitBlock(node); - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: return emitVariableStatement(node); - case 181 /* EmptyStatement */: + case 182 /* EmptyStatement */: return write(";"); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return emitExpressionStatement(node); - case 183 /* IfStatement */: + case 184 /* IfStatement */: return emitIfStatement(node); - case 184 /* DoStatement */: + case 185 /* DoStatement */: return emitDoStatement(node); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: return emitWhileStatement(node); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return emitForStatement(node); - case 188 /* ForOfStatement */: - case 187 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 188 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 189 /* ContinueStatement */: - case 190 /* BreakStatement */: + case 190 /* ContinueStatement */: + case 191 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: return emitReturnStatement(node); - case 192 /* WithStatement */: + case 193 /* WithStatement */: return emitWithStatement(node); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return emitSwitchStatement(node); - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: return emitLabelledStatement(node); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: return emitThrowStatement(node); - case 196 /* TryStatement */: + case 197 /* TryStatement */: return emitTryStatement(node); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return emitCatchClause(node); - case 197 /* DebuggerStatement */: + case 198 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 174 /* ClassExpression */: + case 175 /* ClassExpression */: return emitClassExpression(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return emitClassDeclaration(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return emitEnumMember(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: return emitImportDeclaration(node); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: return emitExportDeclaration(node); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: return emitExportAssignment(node); - case 227 /* SourceFile */: + case 228 /* SourceFile */: return emitSourceFileNode(node); } } function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; + return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -28642,7 +29446,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 === 227 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 228 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); @@ -28657,7 +29461,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 === 227 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 228 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } @@ -28720,13 +29524,13 @@ var ts; // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { // Valid detachedComments ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } @@ -28767,7 +29571,9 @@ var ts; /* @internal */ ts.ioReadTime = 0; /* @internal */ ts.ioWriteTime = 0; /** The version of the TypeScript compiler release */ - ts.version = "1.5.0-beta"; + ts.version = "1.5.0"; + var carriageReturnLineFeed = "\r\n"; + var lineFeed = "\n"; function findConfigFile(searchPath) { var fileName = "tsconfig.json"; while (true) { @@ -28841,6 +29647,9 @@ var ts; } } } + var newLine = options.newLine === 0 /* CarriageReturnLineFeed */ ? carriageReturnLineFeed : + options.newLine === 1 /* LineFeed */ ? lineFeed : + ts.sys.newLine; return { getSourceFile: getSourceFile, getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, @@ -28848,14 +29657,14 @@ var ts; getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { return newLine; } }; } ts.createCompilerHost = createCompilerHost; - function getPreEmitDiagnostics(program) { - var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + function getPreEmitDiagnostics(program, sourceFile) { + var diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics()); + diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); } return ts.sortAndDeduplicateDiagnostics(diagnostics); } @@ -29103,7 +29912,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */ || node.kind === 215 /* ExportDeclaration */) { + if (node.kind === 210 /* ImportDeclaration */ || node.kind === 209 /* ImportEqualsDeclaration */ || node.kind === 216 /* ExportDeclaration */) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8 /* StringLiteral */) { var moduleNameText = moduleNameExpr.text; @@ -29123,7 +29932,7 @@ var ts; } } } - else if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { + else if (node.kind === 206 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { // TypeScript 1.0 spec (April 2014): 12.1.6 // An AmbientExternalModuleDeclaration declares an external module. // This type of declaration is permitted only in the global module. @@ -29218,6 +30027,22 @@ var ts; diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation)); } } + if (options.inlineSourceMap) { + if (options.sourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.mapRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.sourceRoot) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + } + if (options.inlineSources) { + if (!options.sourceMap && !options.inlineSourceMap) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); + } + } if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { @@ -29237,17 +30062,17 @@ var ts; var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided)); } } else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); + diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); } // Cannot specify module gen target when in es6 or above if (options.module && languageVersion >= 2 /* ES6 */) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher)); } // there has to be common source directory if user specified --outdir || --sourceRoot // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted @@ -29314,6 +30139,14 @@ var ts; type: "boolean", description: ts.Diagnostics.Print_this_message }, + { + name: "inlineSourceMap", + type: "boolean" + }, + { + name: "inlineSources", + type: "boolean" + }, { name: "listFiles", type: "boolean" @@ -29334,17 +30167,33 @@ var ts; shortName: "m", type: { "commonjs": 1 /* CommonJS */, - "amd": 2 /* AMD */ + "amd": 2 /* AMD */, + "system": 4 /* System */, + "umd": 3 /* UMD */ }, - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, + description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd, paramType: ts.Diagnostics.KIND, - error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd + error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd + }, + { + name: "newLine", + type: { + "crlf": 0 /* CarriageReturnLineFeed */, + "lf": 1 /* LineFeed */ + }, + description: ts.Diagnostics.Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + paramType: ts.Diagnostics.NEWLINE, + error: ts.Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF }, { name: "noEmit", type: "boolean", description: ts.Diagnostics.Do_not_emit_outputs }, + { + name: "noEmitHelpers", + type: "boolean" + }, { name: "noEmitOnError", type: "boolean", @@ -29434,7 +30283,7 @@ var ts; type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 + error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 }, { name: "version", @@ -29565,19 +30414,34 @@ var ts; function readConfigFile(fileName) { try { var text = ts.sys.readFile(fileName); - return /\S/.test(text) ? JSON.parse(text) : {}; } catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; } + return parseConfigFileText(fileName, text); } ts.readConfigFile = readConfigFile; + /** + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ + function parseConfigFileText(fileName, jsonText) { + try { + return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} }; + } + catch (e) { + return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; + } + } + ts.parseConfigFileText = parseConfigFileText; /** * Parse the contents of a config file (tsconfig.json). * @param json The contents of the config file to parse * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseConfigFile(json, basePath) { + function parseConfigFile(json, host, basePath) { var errors = []; return { options: getCompilerOptions(), @@ -29633,7 +30497,7 @@ var ts; } } else { - var sysFiles = ts.sys.readDirectory(basePath, ".ts"); + var sysFiles = host.readDirectory(basePath, ".ts"); for (var i = 0; i < sysFiles.length; i++) { var name = sysFiles[i]; if (!ts.fileExtensionIs(name, ".d.ts") || !ts.contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) { @@ -29718,7 +30582,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 163 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 164 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -29730,7 +30594,7 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 179 /* Block */: + case 180 /* Block */: if (!ts.isFunctionBlock(n)) { var parent_6 = n.parent; var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); @@ -29738,18 +30602,18 @@ var ts; // 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_6.kind === 184 /* DoStatement */ || - parent_6.kind === 187 /* ForInStatement */ || - parent_6.kind === 188 /* ForOfStatement */ || - parent_6.kind === 186 /* ForStatement */ || - parent_6.kind === 183 /* IfStatement */ || - parent_6.kind === 185 /* WhileStatement */ || - parent_6.kind === 192 /* WithStatement */ || - parent_6.kind === 223 /* CatchClause */) { + if (parent_6.kind === 185 /* DoStatement */ || + parent_6.kind === 188 /* ForInStatement */ || + parent_6.kind === 189 /* ForOfStatement */ || + parent_6.kind === 187 /* ForStatement */ || + parent_6.kind === 184 /* IfStatement */ || + parent_6.kind === 186 /* WhileStatement */ || + parent_6.kind === 193 /* WithStatement */ || + parent_6.kind === 224 /* CatchClause */) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_6.kind === 196 /* TryStatement */) { + if (parent_6.kind === 197 /* TryStatement */) { // Could be the try-block, or the finally-block. var tryStatement = parent_6; if (tryStatement.tryBlock === n) { @@ -29776,23 +30640,23 @@ var ts; break; } // Fallthrough. - case 206 /* ModuleBlock */: { + case 207 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 154 /* ObjectLiteralExpression */: - case 207 /* CaseBlock */: { + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 155 /* ObjectLiteralExpression */: + case 208 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 18 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -29820,12 +30684,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_21 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_21); + for (var name_22 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_22); 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_21); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_22); if (!matches) { continue; } @@ -29838,14 +30702,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_21); + matches = patternMatcher.getMatches(containers, name_22); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_22, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -29883,7 +30747,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 127 /* ComputedPropertyName */) { + else if (declaration.name.kind === 128 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -29904,7 +30768,7 @@ var ts; } return true; } - if (expression.kind === 155 /* PropertyAccessExpression */) { + if (expression.kind === 156 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -29917,7 +30781,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 === 127 /* ComputedPropertyName */) { + if (declaration.name.kind === 128 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -29993,17 +30857,17 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* 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 === 205 /* ModuleDeclaration */); + } while (current.kind === 206 /* ModuleDeclaration */); // fall through - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 202 /* InterfaceDeclaration */: - case 200 /* FunctionDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 203 /* InterfaceDeclaration */: + case 201 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -30014,21 +30878,21 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 215 /* ExportDeclaration */: + case 216 /* 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 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -30040,7 +30904,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 212 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -30049,21 +30913,21 @@ var ts; } } break; - case 152 /* BindingElement */: - case 198 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 199 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } // Fall through - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 202 /* InterfaceDeclaration */: - case 205 /* ModuleDeclaration */: - case 200 /* FunctionDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 213 /* ImportSpecifier */: - case 217 /* ExportSpecifier */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 203 /* InterfaceDeclaration */: + case 206 /* ModuleDeclaration */: + case 201 /* FunctionDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 214 /* ImportSpecifier */: + case 218 /* ExportSpecifier */: childNodes.push(node); break; } @@ -30111,17 +30975,17 @@ var ts; for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 203 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -30132,12 +30996,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 200 /* FunctionDeclaration */) { + if (functionDeclaration.kind === 201 /* FunctionDeclaration */) { // A function declaration is 'top level' if it contains any function declarations // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 179 /* Block */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 180 /* Block */) { // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 201 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } // Or if it is not parented by another function. i.e all functions @@ -30197,7 +31061,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 129 /* Parameter */: + case 130 /* Parameter */: if (ts.isBindingPattern(node.name)) { break; } @@ -30205,36 +31069,36 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 136 /* GetAccessor */: + case 137 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 137 /* SetAccessor */: + case 138 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 226 /* EnumMember */: + case 227 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 138 /* CallSignature */: + case 139 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 139 /* ConstructSignature */: + case 140 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: var variableDeclarationNode; - var name_22; - if (node.kind === 152 /* BindingElement */) { - name_22 = node.name; + var name_23; + if (node.kind === 153 /* BindingElement */) { + name_23 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 198 /* VariableDeclaration */) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 199 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -30242,24 +31106,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_22 = node.name; + name_23 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_23), ts.ScriptElementKind.variableElement); } - case 135 /* Constructor */: + case 136 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 217 /* ExportSpecifier */: - case 213 /* ImportSpecifier */: - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: + case 218 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -30289,17 +31153,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 227 /* SourceFile */: + case 228 /* SourceFile */: return createSourceFileItem(node); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: return createClassItem(node); - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: return createEnumItem(node); - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return createModuleItem(node); - case 200 /* FunctionDeclaration */: + case 201 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -30311,7 +31175,7 @@ var ts; // 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 === 205 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 206 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -30323,7 +31187,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 === 179 /* Block */) { + if (node.body && node.body.kind === 180 /* 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)); } @@ -30344,7 +31208,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 135 /* Constructor */ && member; + return member.kind === 136 /* 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 @@ -30368,7 +31232,7 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127 /* ComputedPropertyName */; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 128 /* ComputedPropertyName */; }); } /** * Like removeComputedProperties, but retains the properties with well known symbol names @@ -30377,13 +31241,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 205 /* ModuleDeclaration */) { + while (node.body.kind === 206 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 227 /* SourceFile */ + return node.kind === 228 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -31178,7 +32042,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 157 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 158 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -31186,7 +32050,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 65 /* Identifier */ ? expression - : expression.kind === 155 /* PropertyAccessExpression */ + : expression.kind === 156 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -31219,7 +32083,7 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 157 /* CallExpression */ || node.parent.kind === 158 /* NewExpression */) { + if (node.parent.kind === 158 /* CallExpression */ || node.parent.kind === 159 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: // 1. The token introduces a list, and should begin a sig help session @@ -31272,25 +32136,25 @@ var ts; }; } } - else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 159 /* TaggedTemplateExpression */) { + else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 160 /* 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, 0); } } - else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 159 /* TaggedTemplateExpression */) { + else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 160 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 172 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 176 /* TemplateSpan */ && node.parent.parent.parent.kind === 159 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 178 /* TemplateSpan */ && node.parent.parent.parent.kind === 160 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 172 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 13 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -31408,7 +32272,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 === 171 /* TemplateExpression */) { + if (template.kind === 172 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -31417,7 +32281,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 227 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 228 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -31618,40 +32482,40 @@ var ts; return false; } switch (n.kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 154 /* ObjectLiteralExpression */: - case 150 /* ObjectBindingPattern */: - case 145 /* TypeLiteral */: - case 179 /* Block */: - case 206 /* ModuleBlock */: - case 207 /* CaseBlock */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 155 /* ObjectLiteralExpression */: + case 151 /* ObjectBindingPattern */: + case 146 /* TypeLiteral */: + case 180 /* Block */: + case 207 /* ModuleBlock */: + case 208 /* CaseBlock */: return nodeEndsWith(n, 15 /* CloseBraceToken */, sourceFile); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 158 /* NewExpression */: + case 159 /* NewExpression */: if (!n.arguments) { return true; } // fall through - case 157 /* CallExpression */: - case 161 /* ParenthesizedExpression */: - case 149 /* ParenthesizedType */: + case 158 /* CallExpression */: + case 162 /* ParenthesizedExpression */: + case 150 /* ParenthesizedType */: return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); - case 142 /* FunctionType */: - case 143 /* ConstructorType */: + case 143 /* FunctionType */: + case 144 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 139 /* ConstructSignature */: - case 138 /* CallSignature */: - case 163 /* ArrowFunction */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 140 /* ConstructSignature */: + case 139 /* CallSignature */: + case 164 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -31661,63 +32525,63 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 17 /* CloseParenToken */, sourceFile); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 183 /* IfStatement */: + case 184 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 153 /* ArrayLiteralExpression */: - case 151 /* ArrayBindingPattern */: - case 156 /* ElementAccessExpression */: - case 127 /* ComputedPropertyName */: - case 147 /* TupleType */: + case 154 /* ArrayLiteralExpression */: + case 152 /* ArrayBindingPattern */: + case 157 /* ElementAccessExpression */: + case 128 /* ComputedPropertyName */: + case 148 /* TupleType */: return nodeEndsWith(n, 19 /* CloseBracketToken */, sourceFile); - case 140 /* IndexSignature */: + case 141 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 185 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 186 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 184 /* DoStatement */: + case 185 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, 100 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 144 /* TypeQuery */: + case 145 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 165 /* TypeOfExpression */: - case 164 /* DeleteExpression */: - case 166 /* VoidExpression */: - case 172 /* YieldExpression */: - case 173 /* SpreadElementExpression */: + case 166 /* TypeOfExpression */: + case 165 /* DeleteExpression */: + case 167 /* VoidExpression */: + case 173 /* YieldExpression */: + case 174 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 159 /* TaggedTemplateExpression */: + case 160 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 171 /* TemplateExpression */: + case 172 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 176 /* TemplateSpan */: + case 178 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 167 /* PrefixUnaryExpression */: + case 168 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 170 /* ConditionalExpression */: + case 171 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -31731,7 +32595,7 @@ var ts; function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { - var last = children[children.length - 1]; + var last = ts.lastOrUndefined(children); if (last.kind === expectedLastToken) { return true; } @@ -31773,7 +32637,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 === 228 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 229 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -31907,7 +32771,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 227 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 228 /* 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. @@ -31951,17 +32815,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 141 /* TypeReference */ || node.kind === 157 /* CallExpression */) { + if (node.kind === 142 /* TypeReference */ || node.kind === 158 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 201 /* ClassDeclaration */ || node.kind === 202 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 202 /* ClassDeclaration */ || node.kind === 203 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 125 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 126 /* LastToken */; } ts.isToken = isToken; function isWord(kind) { @@ -32016,7 +32880,7 @@ var ts; var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 130 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -32225,7 +33089,7 @@ var ts; if (isStarted) { if (trailingTrivia) { ts.Debug.assert(trailingTrivia.length !== 0); - wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4 /* NewLineTrivia */; + wasNewLine = ts.lastOrUndefined(trailingTrivia).kind === 4 /* NewLineTrivia */; } else { wasNewLine = false; @@ -32718,7 +33582,7 @@ var ts; this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([96 /* TryKeyword */, 81 /* FinallyKeyword */]), 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 120 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 121 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); @@ -32726,9 +33590,9 @@ var ts; // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114 /* ConstructorKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // Use of module as a function call. e.g.: import m2 = module("m2"); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 118 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 119 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 120 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 118 /* NamespaceKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 121 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); @@ -32748,7 +33612,7 @@ var ts; // decorators this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 121 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ @@ -32838,9 +33702,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_23 in o) { - if (o[name_23] === rule) { - return name_23; + for (var name_24 in o) { + if (o[name_24] === rule) { + return name_24; } } throw new Error("Unknown rule"); @@ -32849,34 +33713,36 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 186 /* ForStatement */; + return context.contextNode.kind === 187 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 169 /* BinaryExpression */: - case 170 /* ConditionalExpression */: + case 170 /* BinaryExpression */: + case 171 /* ConditionalExpression */: return true; + // equals in binding elements: function foo([[x, y] = [1, 2]]) + case 153 /* BindingElement */: + // equals in type X = ... + case 204 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: // equal in p = 0; - case 129 /* Parameter */: - case 226 /* EnumMember */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 130 /* Parameter */: + case 227 /* EnumMember */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 187 /* ForInStatement */: + case 188 /* ForInStatement */: return context.currentTokenSpan.kind === 86 /* InKeyword */ || context.nextTokenSpan.kind === 86 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 188 /* ForOfStatement */: - return context.currentTokenSpan.kind === 125 /* OfKeyword */ || context.nextTokenSpan.kind === 125 /* OfKeyword */; - case 152 /* BindingElement */: - return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; + case 189 /* ForOfStatement */: + return context.currentTokenSpan.kind === 126 /* OfKeyword */ || context.nextTokenSpan.kind === 126 /* OfKeyword */; } return false; }; @@ -32884,7 +33750,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 170 /* ConditionalExpression */; + return context.contextNode.kind === 171 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -32928,31 +33794,31 @@ var ts; return true; } switch (node.kind) { - case 179 /* Block */: - case 207 /* CaseBlock */: - case 154 /* ObjectLiteralExpression */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 208 /* CaseBlock */: + case 155 /* ObjectLiteralExpression */: + case 207 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: //case SyntaxKind.MemberFunctionDeclaration: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: ///case SyntaxKind.MethodSignature: - case 138 /* CallSignature */: - case 162 /* FunctionExpression */: - case 135 /* Constructor */: - case 163 /* ArrowFunction */: + case 139 /* CallSignature */: + case 163 /* FunctionExpression */: + case 136 /* Constructor */: + case 164 /* ArrowFunction */: //case SyntaxKind.ConstructorDeclaration: //case SyntaxKind.SimpleArrowFunctionExpression: //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: return true; } return false; @@ -32962,55 +33828,55 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 145 /* TypeLiteral */: - case 205 /* ModuleDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 146 /* TypeLiteral */: + case 206 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 201 /* ClassDeclaration */: - case 205 /* ModuleDeclaration */: - case 204 /* EnumDeclaration */: - case 179 /* Block */: - case 223 /* CatchClause */: - case 206 /* ModuleBlock */: - case 193 /* SwitchStatement */: + case 202 /* ClassDeclaration */: + case 206 /* ModuleDeclaration */: + case 205 /* EnumDeclaration */: + case 180 /* Block */: + case 224 /* CatchClause */: + case 207 /* ModuleBlock */: + case 194 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 183 /* IfStatement */: - case 193 /* SwitchStatement */: - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 185 /* WhileStatement */: - case 196 /* TryStatement */: - case 184 /* DoStatement */: - case 192 /* WithStatement */: + case 184 /* IfStatement */: + case 194 /* SwitchStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 186 /* WhileStatement */: + case 197 /* TryStatement */: + case 185 /* DoStatement */: + case 193 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 223 /* CatchClause */: + case 224 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 154 /* ObjectLiteralExpression */; + return context.contextNode.kind === 155 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 157 /* CallExpression */; + return context.contextNode.kind === 158 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 158 /* NewExpression */; + return context.contextNode.kind === 159 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -33031,38 +33897,38 @@ var ts; while (ts.isExpression(node)) { node = node.parent; } - return node.kind === 130 /* Decorator */; + return node.kind === 131 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 199 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 200 /* 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 === 205 /* ModuleDeclaration */; + return context.contextNode.kind === 206 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 145 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 146 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { if (token.kind !== 24 /* LessThanToken */ && token.kind !== 25 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 141 /* TypeReference */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 142 /* TypeReference */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: return true; default: return false; @@ -33073,7 +33939,7 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 166 /* VoidExpression */; + return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 167 /* VoidExpression */; }; return Rules; })(); @@ -33097,7 +33963,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 125 /* LastToken */ + 1; + this.mapRowLength = 126 /* 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); @@ -33292,7 +34158,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 125 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 126 /* LastToken */; token++) { result.push(token); } return result; @@ -33334,9 +34200,9 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 125 /* LastKeyword */); + TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 126 /* LastKeyword */); TokenRange.BinaryOperators = TokenRange.FromRange(24 /* FirstBinaryOperator */, 64 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 125 /* OfKeyword */]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 126 /* OfKeyword */]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38 /* PlusPlusToken */, 39 /* MinusMinusToken */, 47 /* TildeToken */, 46 /* ExclamationToken */]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7 /* NumericLiteral */, 65 /* Identifier */, 16 /* OpenParenToken */, 18 /* OpenBracketToken */, 14 /* OpenBraceToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); @@ -33344,7 +34210,7 @@ var ts; TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 119 /* NumberKeyword */, 121 /* StringKeyword */, 113 /* BooleanKeyword */, 122 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); + TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 120 /* NumberKeyword */, 122 /* StringKeyword */, 113 /* BooleanKeyword */, 123 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -33547,17 +34413,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 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 179 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 227 /* SourceFile */: - case 179 /* Block */: - case 206 /* ModuleBlock */: + return body && body.kind === 180 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 228 /* SourceFile */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -33682,6 +34548,8 @@ var ts; var previousRange; var previousParent; var previousRangeStartLine; + var lastIndentedLine; + var indentationOnLastIndentedLine; var edits = []; formattingScanner.advance(); if (formattingScanner.isOnToken()) { @@ -33728,9 +34596,9 @@ var ts; // - source file // - switch\default clauses if (isSomeBlock(parent.kind) || - parent.kind === 227 /* SourceFile */ || - parent.kind === 220 /* CaseClause */ || - parent.kind === 221 /* DefaultClause */) { + parent.kind === 228 /* SourceFile */ || + parent.kind === 221 /* CaseClause */ || + parent.kind === 222 /* DefaultClause */) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -33751,7 +34619,9 @@ var ts; // if node is located on the same line with the parent // - inherit indentation from the parent // - push children if either parent of node itself has non-zero delta - indentation = parentDynamicIndentation.getIndentation(); + indentation = startLine === lastIndentedLine + ? indentationOnLastIndentedLine + : parentDynamicIndentation.getIndentation(); delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { @@ -33764,19 +34634,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 201 /* ClassDeclaration */: return 69 /* ClassKeyword */; - case 202 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; - case 200 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; - case 204 /* EnumDeclaration */: return 204 /* EnumDeclaration */; - case 136 /* GetAccessor */: return 116 /* GetKeyword */; - case 137 /* SetAccessor */: return 120 /* SetKeyword */; - case 134 /* MethodDeclaration */: + case 202 /* ClassDeclaration */: return 69 /* ClassKeyword */; + case 203 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; + case 201 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; + case 205 /* EnumDeclaration */: return 205 /* EnumDeclaration */; + case 137 /* GetAccessor */: return 116 /* GetKeyword */; + case 138 /* SetAccessor */: return 121 /* SetKeyword */; + case 135 /* MethodDeclaration */: if (node.asteriskToken) { return 35 /* AsteriskToken */; } // fall-through - case 132 /* PropertyDeclaration */: - case 129 /* Parameter */: + case 133 /* PropertyDeclaration */: + case 130 /* Parameter */: return node.name.kind; } } @@ -33909,7 +34779,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 130 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 131 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -33999,7 +34869,6 @@ var ts; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; } - var triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { case 3 /* MultiLineCommentTrivia */: var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); @@ -34023,6 +34892,8 @@ var ts; if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + lastIndentedLine = tokenStart.line; + indentationOnLastIndentedLine = tokenIndentation; } } formattingScanner.advance(); @@ -34231,20 +35102,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 179 /* Block */: - case 206 /* ModuleBlock */: + case 180 /* Block */: + case 207 /* ModuleBlock */: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 135 /* Constructor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 163 /* ArrowFunction */: + case 136 /* Constructor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 164 /* ArrowFunction */: if (node.typeParameters === list) { return 24 /* LessThanToken */; } @@ -34252,8 +35123,8 @@ var ts; return 16 /* OpenParenToken */; } break; - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: if (node.typeArguments === list) { return 24 /* LessThanToken */; } @@ -34261,7 +35132,7 @@ var ts; return 16 /* OpenParenToken */; } break; - case 141 /* TypeReference */: + case 142 /* TypeReference */: if (node.typeArguments === list) { return 24 /* LessThanToken */; } @@ -34360,7 +35231,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 169 /* BinaryExpression */) { + if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 170 /* 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 */) { @@ -34471,7 +35342,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 === 227 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 228 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -34504,7 +35375,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 183 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 184 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 76 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -34516,23 +35387,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 141 /* TypeReference */: + case 142 /* TypeReference */: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 154 /* ObjectLiteralExpression */: + case 155 /* ObjectLiteralExpression */: return node.parent.properties; - case 153 /* ArrayLiteralExpression */: + case 154 /* ArrayLiteralExpression */: return node.parent.elements; - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: { + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -34543,8 +35414,8 @@ var ts; } break; } - case 158 /* NewExpression */: - case 157 /* CallExpression */: { + case 159 /* NewExpression */: + case 158 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -34623,28 +35494,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 153 /* ArrayLiteralExpression */: - case 179 /* Block */: - case 206 /* ModuleBlock */: - case 154 /* ObjectLiteralExpression */: - case 145 /* TypeLiteral */: - case 147 /* TupleType */: - case 207 /* CaseBlock */: - case 221 /* DefaultClause */: - case 220 /* CaseClause */: - case 161 /* ParenthesizedExpression */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: - case 180 /* VariableStatement */: - case 198 /* VariableDeclaration */: - case 214 /* ExportAssignment */: - case 191 /* ReturnStatement */: - case 170 /* ConditionalExpression */: - case 151 /* ArrayBindingPattern */: - case 150 /* ObjectBindingPattern */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 154 /* ArrayLiteralExpression */: + case 180 /* Block */: + case 207 /* ModuleBlock */: + case 155 /* ObjectLiteralExpression */: + case 146 /* TypeLiteral */: + case 148 /* TupleType */: + case 208 /* CaseBlock */: + case 222 /* DefaultClause */: + case 221 /* CaseClause */: + case 162 /* ParenthesizedExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: + case 181 /* VariableStatement */: + case 199 /* VariableDeclaration */: + case 215 /* ExportAssignment */: + case 192 /* ReturnStatement */: + case 171 /* ConditionalExpression */: + case 152 /* ArrayBindingPattern */: + case 151 /* ObjectBindingPattern */: return true; } return false; @@ -34654,22 +35525,22 @@ var ts; return true; } switch (parent) { - case 184 /* DoStatement */: - case 185 /* WhileStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 186 /* ForStatement */: - case 183 /* IfStatement */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 138 /* CallSignature */: - case 163 /* ArrowFunction */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - return child !== 179 /* Block */; + case 185 /* DoStatement */: + case 186 /* WhileStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 187 /* ForStatement */: + case 184 /* IfStatement */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 139 /* CallSignature */: + case 164 /* ArrowFunction */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + return child !== 180 /* Block */; default: return false; } @@ -34679,7 +35550,7 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); /// -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -34774,7 +35645,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(228 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); + var list = createNode(229 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0; _i < nodes.length; _i++) { @@ -34793,7 +35664,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 126 /* FirstNode */) { + if (this.kind >= 127 /* FirstNode */) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -34838,7 +35709,7 @@ var ts; var children = this.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 126 /* FirstNode */) { + if (child.kind < 127 /* FirstNode */) { return child; } return child.getFirstToken(sourceFile); @@ -34848,7 +35719,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 126 /* FirstNode */) { + if (child.kind < 127 /* FirstNode */) { return child; } return child.getLastToken(sourceFile); @@ -34901,7 +35772,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 === 129 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 130 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -34910,15 +35781,15 @@ var ts; }); } // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 205 /* ModuleDeclaration */ && declaration.body.kind === 205 /* ModuleDeclaration */) { + if (declaration.kind === 206 /* ModuleDeclaration */ && declaration.body.kind === 206 /* ModuleDeclaration */) { return; } // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 205 /* ModuleDeclaration */ && declaration.parent.kind === 205 /* ModuleDeclaration */) { + while (declaration.kind === 206 /* ModuleDeclaration */ && declaration.parent.kind === 206 /* ModuleDeclaration */) { declaration = declaration.parent; } // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 199 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -35257,9 +36128,9 @@ var ts; if (result_2 !== undefined) { return result_2; } - if (declaration.name.kind === 127 /* ComputedPropertyName */) { + if (declaration.name.kind === 128 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 155 /* PropertyAccessExpression */) { + if (expr.kind === 156 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -35279,9 +36150,9 @@ var ts; } function visit(node) { switch (node.kind) { - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -35301,60 +36172,60 @@ var ts; ts.forEachChild(node, visit); } break; - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 204 /* EnumDeclaration */: - case 205 /* ModuleDeclaration */: - case 208 /* ImportEqualsDeclaration */: - case 217 /* ExportSpecifier */: - case 213 /* ImportSpecifier */: - case 208 /* ImportEqualsDeclaration */: - case 210 /* ImportClause */: - case 211 /* NamespaceImport */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 145 /* TypeLiteral */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 205 /* EnumDeclaration */: + case 206 /* ModuleDeclaration */: + case 209 /* ImportEqualsDeclaration */: + case 218 /* ExportSpecifier */: + case 214 /* ImportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 211 /* ImportClause */: + case 212 /* NamespaceImport */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 146 /* TypeLiteral */: addDeclaration(node); // fall through - case 135 /* Constructor */: - case 180 /* VariableStatement */: - case 199 /* VariableDeclarationList */: - case 150 /* ObjectBindingPattern */: - case 151 /* ArrayBindingPattern */: - case 206 /* ModuleBlock */: + case 136 /* Constructor */: + case 181 /* VariableStatement */: + case 200 /* VariableDeclarationList */: + case 151 /* ObjectBindingPattern */: + case 152 /* ArrayBindingPattern */: + case 207 /* ModuleBlock */: ts.forEachChild(node, visit); break; - case 179 /* Block */: + case 180 /* Block */: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 129 /* Parameter */: + case 130 /* Parameter */: // Only consider properties defined as constructor parameters if (!(node.flags & 112 /* AccessibilityModifier */)) { break; } // fall through - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 226 /* EnumMember */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 227 /* EnumMember */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: addDeclaration(node); break; - case 215 /* ExportDeclaration */: + case 216 /* 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 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -35366,7 +36237,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 212 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -35425,7 +36296,7 @@ var ts; })(ts.OutputFileType || (ts.OutputFileType = {})); var OutputFileType = ts.OutputFileType; (function (EndOfLineState) { - EndOfLineState[EndOfLineState["Start"] = 0] = "Start"; + EndOfLineState[EndOfLineState["None"] = 0] = "None"; EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; @@ -35527,10 +36398,31 @@ var ts; ClassificationTypeNames.interfaceName = "interface name"; ClassificationTypeNames.moduleName = "module name"; ClassificationTypeNames.typeParameterName = "type parameter name"; - ClassificationTypeNames.typeAlias = "type alias name"; + ClassificationTypeNames.typeAliasName = "type alias name"; + ClassificationTypeNames.parameterName = "parameter name"; return ClassificationTypeNames; })(); ts.ClassificationTypeNames = ClassificationTypeNames; + (function (ClassificationType) { + ClassificationType[ClassificationType["comment"] = 1] = "comment"; + ClassificationType[ClassificationType["identifier"] = 2] = "identifier"; + ClassificationType[ClassificationType["keyword"] = 3] = "keyword"; + ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType[ClassificationType["operator"] = 5] = "operator"; + ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType[ClassificationType["text"] = 9] = "text"; + ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation"; + ClassificationType[ClassificationType["className"] = 11] = "className"; + ClassificationType[ClassificationType["enumName"] = 12] = "enumName"; + ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName"; + ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName"; + ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; + })(ts.ClassificationType || (ts.ClassificationType = {})); + var ClassificationType = ts.ClassificationType; function displayPartsToString(displayParts) { if (displayParts) { return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); @@ -35544,16 +36436,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 162 /* FunctionExpression */) { + if (declaration.kind === 163 /* FunctionExpression */) { return true; } - if (declaration.kind !== 198 /* VariableDeclaration */ && declaration.kind !== 200 /* FunctionDeclaration */) { + if (declaration.kind !== 199 /* VariableDeclaration */ && declaration.kind !== 201 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { // Reached source file or module block - if (parent_7.kind === 227 /* SourceFile */ || parent_7.kind === 206 /* ModuleBlock */) { + if (parent_7.kind === 228 /* SourceFile */ || parent_7.kind === 207 /* ModuleBlock */) { return false; } } @@ -35905,7 +36797,7 @@ var ts; else { if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // import d from "mod"; @@ -35915,7 +36807,7 @@ var ts; } else if (token === 53 /* EqualsToken */) { token = scanner.scan(); - if (token === 118 /* RequireKeyword */) { + if (token === 119 /* RequireKeyword */) { token = scanner.scan(); if (token === 16 /* OpenParenToken */) { token = scanner.scan(); @@ -35944,7 +36836,7 @@ var ts; } if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // import {a as A} from "mod"; @@ -35960,7 +36852,7 @@ var ts; token = scanner.scan(); if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // import * as NS from "mod" @@ -35983,7 +36875,7 @@ var ts; } if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // export {a as A} from "mod"; @@ -35995,7 +36887,7 @@ var ts; } else if (token === 35 /* AsteriskToken */) { token = scanner.scan(); - if (token === 124 /* FromKeyword */) { + if (token === 125 /* FromKeyword */) { token = scanner.scan(); if (token === 8 /* StringLiteral */) { // export * from "mod" @@ -36018,7 +36910,7 @@ var ts; /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 194 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 195 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -36027,12 +36919,12 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 65 /* Identifier */ && - (node.parent.kind === 190 /* BreakStatement */ || node.parent.kind === 189 /* ContinueStatement */) && + (node.parent.kind === 191 /* BreakStatement */ || node.parent.kind === 190 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 65 /* Identifier */ && - node.parent.kind === 194 /* LabeledStatement */ && + node.parent.kind === 195 /* LabeledStatement */ && node.parent.label === node; } /** @@ -36040,7 +36932,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 194 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 195 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -36051,25 +36943,25 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 156 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 159 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 205 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 206 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 65 /* Identifier */ && @@ -36078,22 +36970,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 === 65 /* Identifier */ || node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) && - (node.parent.kind === 224 /* PropertyAssignment */ || node.parent.kind === 225 /* ShorthandPropertyAssignment */) && node.parent.name === node; + (node.parent.kind === 225 /* PropertyAssignment */ || node.parent.kind === 226 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) { switch (node.parent.kind) { - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 226 /* EnumMember */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 205 /* ModuleDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 227 /* EnumMember */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 206 /* ModuleDeclaration */: return node.parent.name === node; - case 156 /* ElementAccessExpression */: + case 157 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } @@ -36152,7 +37044,7 @@ var ts; })(BreakContinueSearchType || (BreakContinueSearchType = {})); // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 66 /* FirstKeyword */; i <= 125 /* LastKeyword */; i++) { + for (var i = 66 /* FirstKeyword */; i <= 126 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -36167,17 +37059,17 @@ var ts; return undefined; } switch (node.kind) { - case 227 /* SourceFile */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 201 /* ClassDeclaration */: - case 202 /* InterfaceDeclaration */: - case 204 /* EnumDeclaration */: - case 205 /* ModuleDeclaration */: + case 228 /* SourceFile */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 202 /* ClassDeclaration */: + case 203 /* InterfaceDeclaration */: + case 205 /* EnumDeclaration */: + case 206 /* ModuleDeclaration */: return node; } } @@ -36185,38 +37077,38 @@ var ts; ts.getContainerNode = getContainerNode; /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 205 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 201 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 202 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 203 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 204 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 198 /* VariableDeclaration */: + case 206 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 202 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 203 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 204 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 205 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 199 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 200 /* FunctionDeclaration */: return ScriptElementKind.functionElement; - case 136 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; - case 137 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 201 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 137 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 138 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: return ScriptElementKind.memberFunctionElement; - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return ScriptElementKind.memberVariableElement; - case 140 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; - case 139 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; - case 138 /* CallSignature */: return ScriptElementKind.callSignatureElement; - case 135 /* Constructor */: return ScriptElementKind.constructorImplementationElement; - case 128 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 226 /* EnumMember */: return ScriptElementKind.variableElement; - case 129 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 208 /* ImportEqualsDeclaration */: - case 213 /* ImportSpecifier */: - case 210 /* ImportClause */: - case 217 /* ExportSpecifier */: - case 211 /* NamespaceImport */: + case 141 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 140 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 139 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 136 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 129 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 227 /* EnumMember */: return ScriptElementKind.variableElement; + case 130 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 209 /* ImportEqualsDeclaration */: + case 214 /* ImportSpecifier */: + case 211 /* ImportClause */: + case 218 /* ExportSpecifier */: + case 212 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -36417,44 +37309,44 @@ var ts; return false; } switch (node.kind) { - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 222 /* HeritageClause */: + case 223 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 102 /* ImplementsKeyword */) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 203 /* TypeAliasDeclaration */: + case 204 /* TypeAliasDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 200 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -36462,20 +37354,20 @@ var ts; return true; } break; - case 180 /* VariableStatement */: + case 181 /* VariableStatement */: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 198 /* VariableDeclaration */: + case 199 /* VariableDeclaration */: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start = expression.typeArguments.pos; @@ -36483,7 +37375,7 @@ var ts; return true; } break; - case 129 /* Parameter */: + case 130 /* Parameter */: var parameter = node; if (parameter.modifiers) { var start = parameter.modifiers.pos; @@ -36499,17 +37391,17 @@ var ts; return true; } break; - case 132 /* PropertyDeclaration */: + case 133 /* PropertyDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 160 /* TypeAssertionExpression */: + case 161 /* 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 130 /* Decorator */: + case 131 /* Decorator */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -36642,11 +37534,11 @@ var ts; // visible symbols in the scope, and the node is the current location. var node = currentToken; var isRightOfDot = false; - if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 155 /* PropertyAccessExpression */) { + if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 156 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 126 /* QualifiedName */) { + else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 127 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -36673,7 +37565,7 @@ var ts; // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */) { + if (node.kind === 65 /* Identifier */ || node.kind === 127 /* QualifiedName */ || node.kind === 156 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -36715,13 +37607,13 @@ var ts; symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(contextToken, 210 /* ImportClause */)) { + else if (ts.getAncestor(contextToken, 211 /* ImportClause */)) { // cursor is in import clause // try to show exported member for imported module isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(contextToken)) { - var importDeclaration = ts.getAncestor(contextToken, 209 /* ImportDeclaration */); + var importDeclaration = ts.getAncestor(contextToken, 210 /* ImportDeclaration */); ts.Debug.assert(importDeclaration !== undefined); var exports; if (importDeclaration.moduleSpecifier) { @@ -36800,7 +37692,7 @@ var ts; // import {| // import {a,| if (node.kind === 14 /* OpenBraceToken */ || node.kind === 23 /* CommaToken */) { - return node.parent.kind === 212 /* NamedImports */; + return node.parent.kind === 213 /* NamedImports */; } } return false; @@ -36810,35 +37702,36 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23 /* CommaToken */: - return containingNodeKind === 157 /* CallExpression */ // func( a, | - || containingNodeKind === 135 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion - || containingNodeKind === 158 /* NewExpression */ // new C(a, | - || containingNodeKind === 153 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 169 /* BinaryExpression */; // let x = (a, | + return containingNodeKind === 158 /* CallExpression */ // func( a, | + || containingNodeKind === 136 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion + || containingNodeKind === 159 /* NewExpression */ // new C(a, | + || containingNodeKind === 154 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 170 /* BinaryExpression */; // let x = (a, | case 16 /* OpenParenToken */: - return containingNodeKind === 157 /* CallExpression */ // func( | - || containingNodeKind === 135 /* Constructor */ // constructor( | - || containingNodeKind === 158 /* NewExpression */ // new C(a| - || containingNodeKind === 161 /* ParenthesizedExpression */; // let x = (a| + return containingNodeKind === 158 /* CallExpression */ // func( | + || containingNodeKind === 136 /* Constructor */ // constructor( | + || containingNodeKind === 159 /* NewExpression */ // new C(a| + || containingNodeKind === 162 /* ParenthesizedExpression */; // let x = (a| case 18 /* OpenBracketToken */: - return containingNodeKind === 153 /* ArrayLiteralExpression */; // [ | - case 117 /* ModuleKeyword */: + return containingNodeKind === 154 /* ArrayLiteralExpression */; // [ | + case 117 /* ModuleKeyword */: // module | + case 118 /* NamespaceKeyword */: return true; case 20 /* DotToken */: - return containingNodeKind === 205 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 206 /* ModuleDeclaration */; // module A.| case 14 /* OpenBraceToken */: - return containingNodeKind === 201 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 202 /* ClassDeclaration */; // class A{ | case 53 /* EqualsToken */: - return containingNodeKind === 198 /* VariableDeclaration */ // let x = a| - || containingNodeKind === 169 /* BinaryExpression */; // x = a| + return containingNodeKind === 199 /* VariableDeclaration */ // let x = a| + || containingNodeKind === 170 /* BinaryExpression */; // x = a| case 11 /* TemplateHead */: - return containingNodeKind === 171 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 172 /* TemplateExpression */; // `aa ${| case 12 /* TemplateMiddle */: - return containingNodeKind === 176 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 178 /* TemplateSpan */; // `aa ${10} dd ${| case 108 /* PublicKeyword */: case 106 /* PrivateKeyword */: case 107 /* ProtectedKeyword */: - return containingNodeKind === 132 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 133 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -36874,7 +37767,7 @@ var ts; switch (previousToken.kind) { case 14 /* OpenBraceToken */: // let x = { | case 23 /* CommaToken */: - if (parent_8 && parent_8.kind === 154 /* ObjectLiteralExpression */) { + if (parent_8 && parent_8.kind === 155 /* ObjectLiteralExpression */) { return parent_8; } break; @@ -36884,16 +37777,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 138 /* CallSignature */: - case 139 /* ConstructSignature */: - case 140 /* IndexSignature */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 139 /* CallSignature */: + case 140 /* ConstructSignature */: + case 141 /* IndexSignature */: return true; } return false; @@ -36903,56 +37796,56 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23 /* CommaToken */: - return containingNodeKind === 198 /* VariableDeclaration */ || - containingNodeKind === 199 /* VariableDeclarationList */ || - containingNodeKind === 180 /* VariableStatement */ || - containingNodeKind === 204 /* EnumDeclaration */ || + return containingNodeKind === 199 /* VariableDeclaration */ || + containingNodeKind === 200 /* VariableDeclarationList */ || + containingNodeKind === 181 /* VariableStatement */ || + containingNodeKind === 205 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 201 /* ClassDeclaration */ || - containingNodeKind === 200 /* FunctionDeclaration */ || - containingNodeKind === 202 /* InterfaceDeclaration */ || - containingNodeKind === 151 /* ArrayBindingPattern */ || - containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x, y| + containingNodeKind === 202 /* ClassDeclaration */ || + containingNodeKind === 201 /* FunctionDeclaration */ || + containingNodeKind === 203 /* InterfaceDeclaration */ || + containingNodeKind === 152 /* ArrayBindingPattern */ || + containingNodeKind === 151 /* ObjectBindingPattern */; // function func({ x, y| case 20 /* DotToken */: - return containingNodeKind === 151 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 152 /* ArrayBindingPattern */; // var [.| case 18 /* OpenBracketToken */: - return containingNodeKind === 151 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 152 /* ArrayBindingPattern */; // var [x| case 16 /* OpenParenToken */: - return containingNodeKind === 223 /* CatchClause */ || + return containingNodeKind === 224 /* CatchClause */ || isFunction(containingNodeKind); case 14 /* OpenBraceToken */: - return containingNodeKind === 204 /* EnumDeclaration */ || - containingNodeKind === 202 /* InterfaceDeclaration */ || - containingNodeKind === 145 /* TypeLiteral */ || - containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x| + return containingNodeKind === 205 /* EnumDeclaration */ || + containingNodeKind === 203 /* InterfaceDeclaration */ || + containingNodeKind === 146 /* TypeLiteral */ || + containingNodeKind === 151 /* ObjectBindingPattern */; // function func({ x| case 22 /* SemicolonToken */: - return containingNodeKind === 131 /* PropertySignature */ && + return containingNodeKind === 132 /* PropertySignature */ && previousToken.parent && previousToken.parent.parent && - (previousToken.parent.parent.kind === 202 /* InterfaceDeclaration */ || - previousToken.parent.parent.kind === 145 /* TypeLiteral */); // let x : { a; | + (previousToken.parent.parent.kind === 203 /* InterfaceDeclaration */ || + previousToken.parent.parent.kind === 146 /* TypeLiteral */); // let x : { a; | case 24 /* LessThanToken */: - return containingNodeKind === 201 /* ClassDeclaration */ || - containingNodeKind === 200 /* FunctionDeclaration */ || - containingNodeKind === 202 /* InterfaceDeclaration */ || + return containingNodeKind === 202 /* ClassDeclaration */ || + containingNodeKind === 201 /* FunctionDeclaration */ || + containingNodeKind === 203 /* InterfaceDeclaration */ || isFunction(containingNodeKind); case 109 /* StaticKeyword */: - return containingNodeKind === 132 /* PropertyDeclaration */; + return containingNodeKind === 133 /* PropertyDeclaration */; case 21 /* DotDotDotToken */: - return containingNodeKind === 129 /* Parameter */ || - containingNodeKind === 135 /* Constructor */ || + return containingNodeKind === 130 /* Parameter */ || + containingNodeKind === 136 /* Constructor */ || (previousToken.parent && previousToken.parent.parent && - previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z| + previousToken.parent.parent.kind === 152 /* ArrayBindingPattern */); // var [ ...z| case 108 /* PublicKeyword */: case 106 /* PrivateKeyword */: case 107 /* ProtectedKeyword */: - return containingNodeKind === 129 /* Parameter */; + return containingNodeKind === 130 /* Parameter */; case 69 /* ClassKeyword */: case 77 /* EnumKeyword */: case 103 /* InterfaceKeyword */: case 83 /* FunctionKeyword */: case 98 /* VarKeyword */: case 116 /* GetKeyword */: - case 120 /* SetKeyword */: + case 121 /* SetKeyword */: case 85 /* ImportKeyword */: case 104 /* LetKeyword */: case 70 /* ConstKeyword */: @@ -36988,7 +37881,7 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 212 /* NamedImports */) { + importDeclaration.importClause.namedBindings.kind === 213 /* NamedImports */) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -37005,7 +37898,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 224 /* PropertyAssignment */ && m.kind !== 225 /* ShorthandPropertyAssignment */) { + if (m.kind !== 225 /* PropertyAssignment */ && m.kind !== 226 /* ShorthandPropertyAssignment */) { // Ignore omitted expressions for missing members in the object literal return; } @@ -37055,10 +37948,10 @@ var ts; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; var nameTable = getNameTable(sourceFile); - for (var name_24 in nameTable) { - if (!allNames[name_24]) { - allNames[name_24] = name_24; - var displayName = getCompletionEntryDisplayName(name_24, target, true); + for (var name_25 in nameTable) { + if (!allNames[name_25]) { + allNames[name_25] = name_25; + var displayName = getCompletionEntryDisplayName(name_25, target, true); if (displayName) { var entry = { name: displayName, @@ -37233,22 +38126,6 @@ var ts; } return ScriptElementKind.unknown; } - function getTypeKind(type) { - var flags = type.getFlags(); - if (flags & 128 /* Enum */) - return ScriptElementKind.enumElement; - if (flags & 1024 /* Class */) - return ScriptElementKind.classElement; - if (flags & 2048 /* Interface */) - return ScriptElementKind.interfaceElement; - if (flags & 512 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - if (flags & 1048703 /* Intrinsic */) - return ScriptElementKind.primitiveType; - if (flags & 256 /* StringLiteral */) - return ScriptElementKind.primitiveType; - return ScriptElementKind.unknown; - } function getSymbolModifiers(symbol) { return symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) @@ -37273,7 +38150,7 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 155 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 156 /* 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)) { @@ -37282,7 +38159,7 @@ var ts; } // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 157 /* CallExpression */ || location.kind === 158 /* NewExpression */) { + if (location.kind === 158 /* CallExpression */ || location.kind === 159 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -37295,7 +38172,7 @@ var ts; // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 158 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 159 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { // Get the first signature if there @@ -37347,24 +38224,24 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 135 /* Constructor */)) { + (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 136 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 135 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 136 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 135 /* Constructor */) { + if (functionDeclaration.kind === 136 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 139 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -37387,7 +38264,7 @@ var ts; } if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(123 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(124 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); @@ -37407,7 +38284,9 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(117 /* ModuleKeyword */)); + var declaration = ts.getDeclarationOfKind(symbol, 206 /* ModuleDeclaration */); + var isNamespace = declaration && declaration.name && declaration.name.kind === 65 /* Identifier */; + displayParts.push(ts.keywordPart(isNamespace ? 118 /* NamespaceKeyword */ : 117 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -37428,13 +38307,13 @@ var ts; } else { // Method/function type parameter - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).parent; + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 129 /* TypeParameter */).parent; var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 139 /* ConstructSignature */) { + if (signatureDeclaration.kind === 140 /* ConstructSignature */) { displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 138 /* CallSignature */ && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 139 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -37443,7 +38322,7 @@ var ts; if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 226 /* EnumMember */) { + if (declaration.kind === 227 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -37459,13 +38338,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 208 /* ImportEqualsDeclaration */) { + if (declaration.kind === 209 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(118 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(119 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); @@ -37592,8 +38471,8 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 65 /* Identifier */: - case 155 /* PropertyAccessExpression */: - case 126 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: case 93 /* ThisKeyword */: case 91 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position @@ -37629,6 +38508,62 @@ var ts; containerName: containerName }; } + function getDefinitionFromSymbol(symbol, node) { + var typeChecker = program.getTypeChecker(); + var result = []; + var declarations = symbol.getDeclarations(); + var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + var symbolKind = getSymbolKind(symbol, node); + var containerSymbol = symbol.parent; + var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && + !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + // Just add all the declarations. + ts.forEach(declarations, function (declaration) { + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + }); + } + return result; + function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { + // Applicable only if we are in a new expression, or we are on a constructor declaration + // and in either case the symbol has a construct signature definition, i.e. class + if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { + if (symbol.flags & 32 /* Class */) { + var classDeclaration = symbol.getDeclarations()[0]; + ts.Debug.assert(classDeclaration && classDeclaration.kind === 202 /* ClassDeclaration */); + return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); + } + } + return false; + } + function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { + if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { + return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); + } + return false; + } + function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + var declarations = []; + var definition; + ts.forEach(signatureDeclarations, function (d) { + if ((selectConstructors && d.kind === 136 /* Constructor */) || + (!selectConstructors && (d.kind === 201 /* FunctionDeclaration */ || d.kind === 135 /* MethodDeclaration */ || d.kind === 134 /* MethodSignature */))) { + declarations.push(d); + if (d.body) + definition = d; + } + }); + if (definition) { + result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); + return true; + } + else if (declarations.length) { + result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + return true; + } + return false; + } + } /// Goto definition function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); @@ -37681,7 +38616,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 === 225 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 226 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -37692,59 +38627,38 @@ var ts; var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } - var result = []; - var declarations = symbol.getDeclarations(); - var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol - var symbolKind = getSymbolKind(symbol, node); - var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); + return getDefinitionFromSymbol(symbol, node); + } + /// Goto type + function getTypeDefinitionAtPosition(fileName, position) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var node = ts.getTouchingPropertyName(sourceFile, position); + if (!node) { + return undefined; } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - // Applicable only if we are in a new expression, or we are on a constructor declaration - // and in either case the symbol has a construct signature definition, i.e. class - if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { - if (symbol.flags & 32 /* Class */) { - var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 201 /* ClassDeclaration */); - return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); - } - } - return false; + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + return undefined; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); - } - return false; + var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + if (!type) { + return undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 135 /* Constructor */) || - (!selectConstructors && (d.kind === 200 /* FunctionDeclaration */ || d.kind === 134 /* MethodDeclaration */ || d.kind === 133 /* MethodSignature */))) { - declarations.push(d); - if (d.body) - definition = d; + if (type.flags & 16384 /* Union */) { + var result = []; + ts.forEach(type.types, function (t) { + if (t.symbol) { + result.push.apply(result, getDefinitionFromSymbol(t.symbol, node)); } }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(createDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; + return result; } + if (!type.symbol) { + return undefined; + } + return getDefinitionFromSymbol(type.symbol, node); } function getOccurrencesAtPosition(fileName, position) { var results = getOccurrencesAtPositionCore(fileName, position); @@ -37831,74 +38745,74 @@ var ts; switch (node.kind) { case 84 /* IfKeyword */: case 76 /* ElseKeyword */: - if (hasKind(node.parent, 183 /* IfStatement */)) { + if (hasKind(node.parent, 184 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 90 /* ReturnKeyword */: - if (hasKind(node.parent, 191 /* ReturnStatement */)) { + if (hasKind(node.parent, 192 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 94 /* ThrowKeyword */: - if (hasKind(node.parent, 195 /* ThrowStatement */)) { + if (hasKind(node.parent, 196 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 68 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 196 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 197 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 96 /* TryKeyword */: case 81 /* FinallyKeyword */: - if (hasKind(parent(node), 196 /* TryStatement */)) { + if (hasKind(parent(node), 197 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 92 /* SwitchKeyword */: - if (hasKind(node.parent, 193 /* SwitchStatement */)) { + if (hasKind(node.parent, 194 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 67 /* CaseKeyword */: case 73 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 193 /* SwitchStatement */)) { + if (hasKind(parent(parent(parent(node))), 194 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 66 /* BreakKeyword */: case 71 /* ContinueKeyword */: - if (hasKind(node.parent, 190 /* BreakStatement */) || hasKind(node.parent, 189 /* ContinueStatement */)) { + if (hasKind(node.parent, 191 /* BreakStatement */) || hasKind(node.parent, 190 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurences(node.parent); } break; case 82 /* ForKeyword */: - if (hasKind(node.parent, 186 /* ForStatement */) || - hasKind(node.parent, 187 /* ForInStatement */) || - hasKind(node.parent, 188 /* ForOfStatement */)) { + if (hasKind(node.parent, 187 /* ForStatement */) || + hasKind(node.parent, 188 /* ForInStatement */) || + hasKind(node.parent, 189 /* ForOfStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 100 /* WhileKeyword */: case 75 /* DoKeyword */: - if (hasKind(node.parent, 185 /* WhileStatement */) || hasKind(node.parent, 184 /* DoStatement */)) { + if (hasKind(node.parent, 186 /* WhileStatement */) || hasKind(node.parent, 185 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 114 /* ConstructorKeyword */: - if (hasKind(node.parent, 135 /* Constructor */)) { + if (hasKind(node.parent, 136 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; case 116 /* GetKeyword */: - case 120 /* SetKeyword */: - if (hasKind(node.parent, 136 /* GetAccessor */) || hasKind(node.parent, 137 /* SetAccessor */)) { + case 121 /* SetKeyword */: + if (hasKind(node.parent, 137 /* GetAccessor */) || hasKind(node.parent, 138 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } default: if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 180 /* VariableStatement */)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 181 /* VariableStatement */)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -37914,10 +38828,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 195 /* ThrowStatement */) { + if (node.kind === 196 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 196 /* TryStatement */) { + else if (node.kind === 197 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -37946,12 +38860,12 @@ var ts; var child = throwStatement; while (child.parent) { var parent_9 = child.parent; - if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227 /* SourceFile */) { + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 228 /* SourceFile */) { return parent_9; } // 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_9.kind === 196 /* TryStatement */) { + if (parent_9.kind === 197 /* TryStatement */) { var tryStatement = parent_9; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; @@ -37966,7 +38880,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 190 /* BreakStatement */ || node.kind === 189 /* ContinueStatement */) { + if (node.kind === 191 /* BreakStatement */ || node.kind === 190 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -37982,16 +38896,16 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { switch (node_1.kind) { - case 193 /* SwitchStatement */: - if (statement.kind === 189 /* ContinueStatement */) { + case 194 /* SwitchStatement */: + if (statement.kind === 190 /* ContinueStatement */) { continue; } // Fall through. - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 185 /* WhileStatement */: - case 184 /* DoStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 186 /* WhileStatement */: + case 185 /* DoStatement */: if (!statement.label || isLabeledBy(node_1, statement.label.text)) { return node_1; } @@ -38010,18 +38924,18 @@ 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 === 201 /* ClassDeclaration */ || - (declaration.kind === 129 /* Parameter */ && hasKind(container, 135 /* Constructor */)))) { + if (!(container.kind === 202 /* ClassDeclaration */ || + (declaration.kind === 130 /* Parameter */ && hasKind(container, 136 /* Constructor */)))) { return undefined; } } else if (modifier === 109 /* StaticKeyword */) { - if (container.kind !== 201 /* ClassDeclaration */) { + if (container.kind !== 202 /* ClassDeclaration */) { return undefined; } } else if (modifier === 78 /* ExportKeyword */ || modifier === 115 /* DeclareKeyword */) { - if (!(container.kind === 206 /* ModuleBlock */ || container.kind === 227 /* SourceFile */)) { + if (!(container.kind === 207 /* ModuleBlock */ || container.kind === 228 /* SourceFile */)) { return undefined; } } @@ -38033,20 +38947,20 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 206 /* ModuleBlock */: - case 227 /* SourceFile */: + case 207 /* ModuleBlock */: + case 228 /* SourceFile */: nodes = container.statements; break; - case 135 /* Constructor */: + case 136 /* Constructor */: nodes = container.parameters.concat(container.parent.members); break; - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: 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 & 112 /* AccessibilityModifier */) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 135 /* Constructor */ && member; + return member.kind === 136 /* Constructor */ && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -38094,13 +39008,13 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 136 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 137 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 138 /* SetAccessor */); return ts.map(keywords, getHighlightSpanForNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 120 /* SetKeyword */); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 121 /* SetKeyword */); }); } } } @@ -38118,7 +39032,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82 /* ForKeyword */, 100 /* WhileKeyword */, 75 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 184 /* DoStatement */) { + if (loopNode.kind === 185 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 100 /* WhileKeyword */)) { @@ -38139,13 +39053,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: - case 184 /* DoStatement */: - case 185 /* WhileStatement */: + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: + case 185 /* DoStatement */: + case 186 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -38199,7 +39113,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, 179 /* Block */))) { + if (!(func && hasKind(func.body, 180 /* Block */))) { return undefined; } var keywords = []; @@ -38215,7 +39129,7 @@ var ts; function getIfElseOccurrences(ifStatement) { var keywords = []; // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 183 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 184 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. @@ -38228,7 +39142,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 183 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 184 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -38407,17 +39321,17 @@ var ts; } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 213 /* ImportSpecifier */ || location.parent.kind === 217 /* ExportSpecifier */) && + (location.parent.kind === 214 /* ImportSpecifier */ || location.parent.kind === 218 /* ExportSpecifier */) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 217 /* ExportSpecifier */; + return declaration.kind === 214 /* ImportSpecifier */ || declaration.kind === 218 /* ExportSpecifier */; }); } function getDeclaredName(symbol, location) { // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 163 /* FunctionExpression */ ? d : undefined; }); // When a name gets interned into a SourceFile's 'identifiers' Map, // its name is escaped and stored in the same way its symbol name/identifier // name should be stored. Function expressions, however, are a special case, @@ -38444,7 +39358,7 @@ var ts; return location.getText(); } // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 163 /* FunctionExpression */ ? d : undefined; }); // When a name gets interned into a SourceFile's 'identifiers' Map, // its name is escaped and stored in the same way its symbol name/identifier // name should be stored. Function expressions, however, are a special case, @@ -38468,7 +39382,7 @@ var ts; if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 201 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 202 /* ClassDeclaration */); } } // If the symbol is an import we would like to find it if we are looking for what it imports. @@ -38494,7 +39408,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 228 /* 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; @@ -38682,13 +39596,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -38720,27 +39634,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // fall through - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 227 /* SourceFile */: + case 228 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // Fall through - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 163 /* 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. @@ -38749,7 +39663,7 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 227 /* SourceFile */) { + if (searchSpaceNode.kind === 228 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -38780,27 +39694,27 @@ var ts; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 201 /* ClassDeclaration */: + case 202 /* 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 & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 227 /* SourceFile */: - if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { + case 228 /* SourceFile */: + if (container.kind === 228 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -38854,11 +39768,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 201 /* ClassDeclaration */) { + if (declaration.kind === 202 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 202 /* InterfaceDeclaration */) { + else if (declaration.kind === 203 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -38919,19 +39833,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_25 = node.text; + var name_26 = 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_25); + var unionProperty = contextualType.getProperty(name_26); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_25); + var symbol = t.getProperty(name_26); if (symbol) { result_4.push(symbol); } @@ -38940,7 +39854,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_25); + var symbol_1 = contextualType.getProperty(name_26); if (symbol_1) { return [symbol_1]; } @@ -38998,10 +39912,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 168 /* PostfixUnaryExpression */ || parent.kind === 167 /* PrefixUnaryExpression */) { + if (parent.kind === 169 /* PostfixUnaryExpression */ || parent.kind === 168 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 169 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 170 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; return 53 /* FirstAssignment */ <= operator && operator <= 64 /* LastAssignment */; } @@ -39035,33 +39949,33 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 129 /* Parameter */: - case 198 /* VariableDeclaration */: - case 152 /* BindingElement */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: - case 224 /* PropertyAssignment */: - case 225 /* ShorthandPropertyAssignment */: - case 226 /* EnumMember */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 135 /* Constructor */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 200 /* FunctionDeclaration */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: - case 223 /* CatchClause */: + case 130 /* Parameter */: + case 199 /* VariableDeclaration */: + case 153 /* BindingElement */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: + case 225 /* PropertyAssignment */: + case 226 /* ShorthandPropertyAssignment */: + case 227 /* EnumMember */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 136 /* Constructor */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 201 /* FunctionDeclaration */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: + case 224 /* CatchClause */: return 1 /* Value */; - case 128 /* TypeParameter */: - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: - case 145 /* TypeLiteral */: + case 129 /* TypeParameter */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: + case 146 /* TypeLiteral */: return 2 /* Type */; - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (node.name.kind === 8 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } @@ -39071,15 +39985,15 @@ var ts; else { return 4 /* Namespace */; } - case 212 /* NamedImports */: - case 213 /* ImportSpecifier */: - case 208 /* ImportEqualsDeclaration */: - case 209 /* ImportDeclaration */: - case 214 /* ExportAssignment */: - case 215 /* ExportDeclaration */: + case 213 /* NamedImports */: + case 214 /* ImportSpecifier */: + case 209 /* ImportEqualsDeclaration */: + case 210 /* ImportDeclaration */: + case 215 /* ExportAssignment */: + case 216 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 227 /* SourceFile */: + case 228 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; @@ -39089,7 +40003,7 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 141 /* TypeReference */ || node.parent.kind === 177 /* HeritageClauseElement */; + return node.parent.kind === 142 /* TypeReference */ || node.parent.kind === 177 /* ExpressionWithTypeArguments */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -39097,32 +40011,32 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 155 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 155 /* PropertyAccessExpression */) { + if (root.parent.kind === 156 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 156 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 177 /* HeritageClauseElement */ && root.parent.parent.kind === 222 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 177 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 223 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || - (decl.kind === 202 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); + return (decl.kind === 202 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || + (decl.kind === 203 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 126 /* QualifiedName */) { - while (root.parent && root.parent.kind === 126 /* QualifiedName */) { + if (root.parent.kind === 127 /* QualifiedName */) { + while (root.parent && root.parent.kind === 127 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 141 /* TypeReference */ && !isLastClause; + return root.parent.kind === 142 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 126 /* QualifiedName */) { + while (node.parent.kind === 127 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -39132,15 +40046,15 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 126 /* QualifiedName */ && + if (node.parent.kind === 127 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 208 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 209 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 214 /* ExportAssignment */) { + if (node.parent.kind === 215 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -39180,8 +40094,8 @@ var ts; return; } switch (node.kind) { - case 155 /* PropertyAccessExpression */: - case 126 /* QualifiedName */: + case 156 /* PropertyAccessExpression */: + case 127 /* QualifiedName */: case 8 /* StringLiteral */: case 80 /* FalseKeyword */: case 95 /* TrueKeyword */: @@ -39204,7 +40118,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 === 205 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 206 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -39231,29 +40145,37 @@ var ts; return ts.NavigationBar.getNavigationBarItems(sourceFile); } function getSemanticClassifications(fileName, span) { + return convertClassifications(getEncodedSemanticClassifications(fileName, span)); + } + function getEncodedSemanticClassifications(fileName, span) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var typeChecker = program.getTypeChecker(); var result = []; processNode(sourceFile); - return result; + return { spans: result, endOfLineState: 0 /* None */ }; + function pushClassification(start, length, type) { + result.push(start); + result.push(length); + result.push(type); + } function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) { - return ClassificationTypeNames.className; + return 11 /* className */; } else if (flags & 384 /* Enum */) { - return ClassificationTypeNames.enumName; + return 12 /* enumName */; } else if (flags & 524288 /* TypeAlias */) { - return ClassificationTypeNames.typeAlias; + return 16 /* typeAliasName */; } else if (meaningAtPosition & 2 /* Type */) { if (flags & 64 /* Interface */) { - return ClassificationTypeNames.interfaceName; + return 13 /* interfaceName */; } else if (flags & 262144 /* TypeParameter */) { - return ClassificationTypeNames.typeParameterName; + return 15 /* typeParameterName */; } } else if (flags & 1536 /* Module */) { @@ -39262,7 +40184,7 @@ var ts; // - There exists a module declaration which actually impacts the value side. if (meaningAtPosition & 4 /* Namespace */ || (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { - return ClassificationTypeNames.moduleName; + return 14 /* moduleName */; } } return undefined; @@ -39271,7 +40193,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; + return declaration.kind === 206 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } @@ -39283,10 +40205,7 @@ var ts; if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { - result.push({ - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - classificationType: type - }); + pushClassification(node.getStart(), node.getWidth(), type); } } } @@ -39294,7 +40213,42 @@ var ts; } } } + function getClassificationTypeName(type) { + switch (type) { + case 1 /* comment */: return ClassificationTypeNames.comment; + case 2 /* identifier */: return ClassificationTypeNames.identifier; + case 3 /* keyword */: return ClassificationTypeNames.keyword; + case 4 /* numericLiteral */: return ClassificationTypeNames.numericLiteral; + case 5 /* operator */: return ClassificationTypeNames.operator; + case 6 /* stringLiteral */: return ClassificationTypeNames.stringLiteral; + case 8 /* whiteSpace */: return ClassificationTypeNames.whiteSpace; + case 9 /* text */: return ClassificationTypeNames.text; + case 10 /* punctuation */: return ClassificationTypeNames.punctuation; + case 11 /* className */: return ClassificationTypeNames.className; + case 12 /* enumName */: return ClassificationTypeNames.enumName; + case 13 /* interfaceName */: return ClassificationTypeNames.interfaceName; + case 14 /* moduleName */: return ClassificationTypeNames.moduleName; + case 15 /* typeParameterName */: return ClassificationTypeNames.typeParameterName; + case 16 /* typeAliasName */: return ClassificationTypeNames.typeAliasName; + case 17 /* parameterName */: return ClassificationTypeNames.parameterName; + } + } + function convertClassifications(classifications) { + ts.Debug.assert(classifications.spans.length % 3 === 0); + var dense = classifications.spans; + var result = []; + for (var i = 0, n = dense.length; i < n; i += 3) { + result.push({ + textSpan: ts.createTextSpan(dense[i], dense[i + 1]), + classificationType: getClassificationTypeName(dense[i + 2]) + }); + } + return result; + } function getSyntacticClassifications(fileName, span) { + return convertClassifications(getEncodedSyntacticClassifications(fileName, span)); + } + function getEncodedSyntacticClassifications(fileName, span) { // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); // Make a scanner we can get trivia from. @@ -39302,7 +40256,12 @@ var ts; var mergeConflictScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); var result = []; processElement(sourceFile); - return result; + return { spans: result, endOfLineState: 0 /* None */ }; + function pushClassification(start, length, type) { + result.push(start); + result.push(length); + result.push(type); + } function classifyLeadingTrivia(token) { var tokenStart = ts.skipTrivia(sourceFile.text, token.pos, false); if (tokenStart === token.pos) { @@ -39321,10 +40280,7 @@ var ts; } if (ts.isComment(kind)) { // Simple comment. Just add as is. - result.push({ - textSpan: ts.createTextSpan(start, width), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, width, 1 /* comment */); continue; } if (kind === 6 /* ConflictMarkerTrivia */) { @@ -39333,10 +40289,7 @@ var ts; // for the <<<<<<< and >>>>>>> markers, we just add them in as comments // in the classification stream. if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - result.push({ - textSpan: ts.createTextSpan(start, width), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, width, 1 /* comment */); continue; } // for the ======== add a comment for the first line, and then lex all @@ -39355,10 +40308,7 @@ var ts; break; } } - result.push({ - textSpan: ts.createTextSpanFromBounds(start, i), - classificationType: ClassificationTypeNames.comment - }); + pushClassification(start, i - start, 1 /* comment */); mergeConflictScanner.setTextPos(i); while (mergeConflictScanner.getTextPos() < end) { classifyDisabledCodeToken(); @@ -39370,10 +40320,7 @@ var ts; var end = mergeConflictScanner.getTextPos(); var type = classifyTokenType(tokenKind); if (type) { - result.push({ - textSpan: ts.createTextSpanFromBounds(start, end), - classificationType: type - }); + pushClassification(start, end - start, type); } } function classifyToken(token) { @@ -39381,10 +40328,7 @@ var ts; if (token.getWidth() > 0) { var type = classifyTokenType(token.kind, token); if (type) { - result.push({ - textSpan: ts.createTextSpan(token.getStart(), token.getWidth()), - classificationType: type - }); + pushClassification(token.getStart(), token.getWidth(), type); } } } @@ -39393,7 +40337,7 @@ var ts; // classify based on that instead. function classifyTokenType(tokenKind, token) { if (ts.isKeyword(tokenKind)) { - return ClassificationTypeNames.keyword; + return 3 /* keyword */; } // Special case < and > If they appear in a generic context they are punctuation, // not operators. @@ -39401,73 +40345,78 @@ var ts; // If the node owning the token has a type argument list or type parameter list, then // we can effectively assume that a '<' and '>' belong to those lists. if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { - return ClassificationTypeNames.punctuation; + return 10 /* punctuation */; } } if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 53 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 198 /* VariableDeclaration */ || - token.parent.kind === 132 /* PropertyDeclaration */ || - token.parent.kind === 129 /* Parameter */) { - return ClassificationTypeNames.operator; + if (token.parent.kind === 199 /* VariableDeclaration */ || + token.parent.kind === 133 /* PropertyDeclaration */ || + token.parent.kind === 130 /* Parameter */) { + return 5 /* operator */; } } - if (token.parent.kind === 169 /* BinaryExpression */ || - token.parent.kind === 167 /* PrefixUnaryExpression */ || - token.parent.kind === 168 /* PostfixUnaryExpression */ || - token.parent.kind === 170 /* ConditionalExpression */) { - return ClassificationTypeNames.operator; + if (token.parent.kind === 170 /* BinaryExpression */ || + token.parent.kind === 168 /* PrefixUnaryExpression */ || + token.parent.kind === 169 /* PostfixUnaryExpression */ || + token.parent.kind === 171 /* ConditionalExpression */) { + return 5 /* operator */; } } - return ClassificationTypeNames.punctuation; + return 10 /* punctuation */; } else if (tokenKind === 7 /* NumericLiteral */) { - return ClassificationTypeNames.numericLiteral; + return 4 /* numericLiteral */; } else if (tokenKind === 8 /* StringLiteral */) { - return ClassificationTypeNames.stringLiteral; + return 6 /* stringLiteral */; } else if (tokenKind === 9 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. - return ClassificationTypeNames.stringLiteral; + return 6 /* stringLiteral */; } else if (ts.isTemplateLiteralKind(tokenKind)) { // TODO (drosen): we should *also* get another classification type for these literals. - return ClassificationTypeNames.stringLiteral; + return 6 /* stringLiteral */; } else if (tokenKind === 65 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.className; + return 11 /* className */; } return; - case 128 /* TypeParameter */: + case 129 /* TypeParameter */: if (token.parent.name === token) { - return ClassificationTypeNames.typeParameterName; + return 15 /* typeParameterName */; } return; - case 202 /* InterfaceDeclaration */: + case 203 /* InterfaceDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.interfaceName; + return 13 /* interfaceName */; } return; - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.enumName; + return 12 /* enumName */; } return; - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (token.parent.name === token) { - return ClassificationTypeNames.moduleName; + return 14 /* moduleName */; + } + return; + case 130 /* Parameter */: + if (token.parent.name === token) { + return 17 /* parameterName */; } return; } } - return ClassificationTypeNames.text; + return 9 /* text */; } } function processElement(element) { @@ -39747,11 +40696,14 @@ var ts; getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, getSyntacticClassifications: getSyntacticClassifications, getSemanticClassifications: getSemanticClassifications, + getEncodedSyntacticClassifications: getEncodedSyntacticClassifications, + getEncodedSemanticClassifications: getEncodedSemanticClassifications, getCompletionsAtPosition: getCompletionsAtPosition, getCompletionEntryDetails: getCompletionEntryDetails, getSignatureHelpItems: getSignatureHelpItems, getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, + getTypeDefinitionAtPosition: getTypeDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, @@ -39799,7 +40751,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 === 219 /* ExternalModuleReference */ || + node.parent.kind === 220 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -39812,7 +40764,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 156 /* ElementAccessExpression */ && + node.parent.kind === 157 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /// Classifier @@ -39860,7 +40812,7 @@ var ts; function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { if (keyword2 === 116 /* GetKeyword */ || - keyword2 === 120 /* SetKeyword */ || + keyword2 === 121 /* SetKeyword */ || keyword2 === 114 /* ConstructorKeyword */ || keyword2 === 109 /* StaticKeyword */) { // Allow things like "public get", "public constructor" and "public static". @@ -39875,9 +40827,58 @@ var ts; // if there are more cases we want the classifier to be better at. return true; } + function convertClassifications(classifications, text) { + var entries = []; + var dense = classifications.spans; + var lastEnd = 0; + for (var i = 0, n = dense.length; i < n; i += 3) { + var start = dense[i]; + var length_1 = dense[i + 1]; + var type = dense[i + 2]; + // Make a whitespace entry between the last item and this one. + if (lastEnd >= 0) { + var whitespaceLength_1 = start - lastEnd; + if (whitespaceLength_1 > 0) { + entries.push({ length: whitespaceLength_1, classification: TokenClass.Whitespace }); + } + } + entries.push({ length: length_1, classification: convertClassification(type) }); + lastEnd = start + length_1; + } + var whitespaceLength = text.length - lastEnd; + if (whitespaceLength > 0) { + entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); + } + return { entries: entries, finalLexState: classifications.endOfLineState }; + } + function convertClassification(type) { + switch (type) { + case 1 /* comment */: return TokenClass.Comment; + case 3 /* keyword */: return TokenClass.Keyword; + case 4 /* numericLiteral */: return TokenClass.NumberLiteral; + case 5 /* operator */: return TokenClass.Operator; + case 6 /* stringLiteral */: return TokenClass.StringLiteral; + case 8 /* whiteSpace */: return TokenClass.Whitespace; + case 10 /* punctuation */: return TokenClass.Punctuation; + case 2 /* identifier */: + case 11 /* className */: + case 12 /* enumName */: + case 13 /* interfaceName */: + case 14 /* moduleName */: + case 15 /* typeParameterName */: + case 16 /* typeAliasName */: + case 9 /* text */: + case 17 /* parameterName */: + default: + return TokenClass.Identifier; + } + } + function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); + } // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), // we will be more conservative in order to avoid conflicting with the syntactic classifier. - function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { var offset = 0; var token = 0 /* Unknown */; var lastNonTriviaToken = 0 /* Unknown */; @@ -39917,8 +40918,8 @@ var ts; } scanner.setText(text); var result = { - finalLexState: 0 /* Start */, - entries: [] + endOfLineState: 0 /* None */, + spans: [] }; // We can run into an unfortunate interaction between the lexical and syntactic classifier // when the user is typing something generic. Consider the case where the user types: @@ -39970,10 +40971,10 @@ var ts; angleBracketStack--; } else if (token === 112 /* AnyKeyword */ || - token === 121 /* StringKeyword */ || - token === 119 /* NumberKeyword */ || + token === 122 /* StringKeyword */ || + token === 120 /* NumberKeyword */ || token === 113 /* BooleanKeyword */ || - token === 122 /* SymbolKeyword */) { + token === 123 /* SymbolKeyword */) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -40020,7 +41021,7 @@ var ts; function processToken() { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); - addResult(end - start, classFromKind(token)); + addResult(start, end, classFromKind(token)); if (end >= text.length) { if (token === 8 /* StringLiteral */) { // Check to see if we finished up on a multiline string literal. @@ -40034,7 +41035,7 @@ var ts; // If we have an odd number of backslashes, then the multiline string is unclosed if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 /* doubleQuote */ + result.endOfLineState = quoteChar === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; } @@ -40043,16 +41044,16 @@ var ts; else if (token === 3 /* MultiLineCommentTrivia */) { // Check to see if the multiline comment was unclosed. if (scanner.isUnterminated()) { - result.finalLexState = 1 /* InMultiLineCommentTrivia */; + result.endOfLineState = 1 /* InMultiLineCommentTrivia */; } } else if (ts.isTemplateLiteralKind(token)) { if (scanner.isUnterminated()) { if (token === 13 /* TemplateTail */) { - result.finalLexState = 5 /* InTemplateMiddleOrTail */; + result.endOfLineState = 5 /* InTemplateMiddleOrTail */; } else if (token === 10 /* NoSubstitutionTemplateLiteral */) { - result.finalLexState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; + result.endOfLineState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; } else { ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); @@ -40060,18 +41061,30 @@ var ts; } } else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11 /* TemplateHead */) { - result.finalLexState = 6 /* InTemplateSubstitutionPosition */; + result.endOfLineState = 6 /* InTemplateSubstitutionPosition */; } } } - function addResult(length, classification) { + function addResult(start, end, classification) { + if (classification === 8 /* whiteSpace */) { + // Don't bother with whitespace classifications. They're not needed. + return; + } + if (start === 0 && offset > 0) { + // We're classifying the first token, and this was a case where we prepended + // text. We should consider the start of this token to be at the start of + // the original text. + start += offset; + } + // All our tokens are in relation to the augmented text. Move them back to be + // relative to the original text. + start -= offset; + end -= offset; + var length = end - start; if (length > 0) { - // If this is the first classification we're adding to the list, then remove any - // offset we have if we were continuing a construct from the previous line. - if (result.entries.length === 0) { - length -= offset; - } - result.entries.push({ length: length, classification: classification }); + result.spans.push(start); + result.spans.push(length); + result.spans.push(classification); } } } @@ -40132,41 +41145,44 @@ var ts; } } function isKeyword(token) { - return token >= 66 /* FirstKeyword */ && token <= 125 /* LastKeyword */; + return token >= 66 /* FirstKeyword */ && token <= 126 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { - return TokenClass.Keyword; + return 3 /* keyword */; } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return TokenClass.Operator; + return 5 /* operator */; } else if (token >= 14 /* FirstPunctuation */ && token <= 64 /* LastPunctuation */) { - return TokenClass.Punctuation; + return 10 /* punctuation */; } switch (token) { case 7 /* NumericLiteral */: - return TokenClass.NumberLiteral; + return 4 /* numericLiteral */; case 8 /* StringLiteral */: - return TokenClass.StringLiteral; + return 6 /* stringLiteral */; case 9 /* RegularExpressionLiteral */: - return TokenClass.RegExpLiteral; + return 7 /* regularExpressionLiteral */; case 6 /* ConflictMarkerTrivia */: case 3 /* MultiLineCommentTrivia */: case 2 /* SingleLineCommentTrivia */: - return TokenClass.Comment; + return 1 /* comment */; case 5 /* WhitespaceTrivia */: case 4 /* NewLineTrivia */: - return TokenClass.Whitespace; + return 8 /* whiteSpace */; case 65 /* Identifier */: default: if (ts.isTemplateLiteralKind(token)) { - return TokenClass.StringLiteral; + return 6 /* stringLiteral */; } - return TokenClass.Identifier; + return 2 /* identifier */; } } - return { getClassificationsForLine: getClassificationsForLine }; + return { + getClassificationsForLine: getClassificationsForLine, + getEncodedLexicalClassifications: getEncodedLexicalClassifications + }; } ts.createClassifier = createClassifier; /** @@ -40187,7 +41203,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 227 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 228 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -40257,125 +41273,125 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 184 /* DoStatement */) { + if (node.parent.kind === 185 /* DoStatement */) { // Set span as if on while keyword return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ForStatement */) { + if (node.parent.kind === 187 /* ForStatement */) { // For now lets set the span on this expression, fix it later return textSpan(node); } - if (node.parent.kind === 169 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { + if (node.parent.kind === 170 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { // if this is comma expression, the breakpoint is possible in this expression return textSpan(node); } - if (node.parent.kind == 163 /* ArrowFunction */ && node.parent.body == node) { + if (node.parent.kind == 164 /* 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 180 /* VariableStatement */: + case 181 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 198 /* VariableDeclaration */: - case 132 /* PropertyDeclaration */: - case 131 /* PropertySignature */: + case 199 /* VariableDeclaration */: + case 133 /* PropertyDeclaration */: + case 132 /* PropertySignature */: return spanInVariableDeclaration(node); - case 129 /* Parameter */: + case 130 /* Parameter */: return spanInParameterDeclaration(node); - case 200 /* FunctionDeclaration */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: - case 162 /* FunctionExpression */: - case 163 /* ArrowFunction */: + case 201 /* FunctionDeclaration */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: + case 163 /* FunctionExpression */: + case 164 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 179 /* Block */: + case 180 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // Fall through - case 206 /* ModuleBlock */: + case 207 /* ModuleBlock */: return spanInBlock(node); - case 223 /* CatchClause */: + case 224 /* CatchClause */: return spanInBlock(node.block); - case 182 /* ExpressionStatement */: + case 183 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 191 /* ReturnStatement */: + case 192 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 185 /* WhileStatement */: + case 186 /* WhileStatement */: // Span on while(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 184 /* DoStatement */: + case 185 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 197 /* DebuggerStatement */: + case 198 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 183 /* IfStatement */: + case 184 /* IfStatement */: // set on if(..) span return textSpan(node, ts.findNextToken(node.expression, node)); - case 194 /* LabeledStatement */: + case 195 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 190 /* BreakStatement */: - case 189 /* ContinueStatement */: + case 191 /* BreakStatement */: + case 190 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 186 /* ForStatement */: + case 187 /* ForStatement */: return spanInForStatement(node); - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 188 /* ForInStatement */: + case 189 /* ForOfStatement */: // span on for (a in ...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 193 /* SwitchStatement */: + case 194 /* SwitchStatement */: // span on switch(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 220 /* CaseClause */: - case 221 /* DefaultClause */: + case 221 /* CaseClause */: + case 222 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 196 /* TryStatement */: + case 197 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 195 /* ThrowStatement */: + case 196 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 214 /* ExportAssignment */: + case 215 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 209 /* ImportDeclaration */: + case 210 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 215 /* ExportDeclaration */: + case 216 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 201 /* ClassDeclaration */: - case 204 /* EnumDeclaration */: - case 226 /* EnumMember */: - case 157 /* CallExpression */: - case 158 /* NewExpression */: + case 202 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 227 /* EnumMember */: + case 158 /* CallExpression */: + case 159 /* NewExpression */: // span on complete node return textSpan(node); - case 192 /* WithStatement */: + case 193 /* WithStatement */: // span in statement return spanInNode(node.statement); // No breakpoint in interface, type alias - case 202 /* InterfaceDeclaration */: - case 203 /* TypeAliasDeclaration */: + case 203 /* InterfaceDeclaration */: + case 204 /* TypeAliasDeclaration */: return undefined; // Tokens: case 22 /* SemicolonToken */: @@ -40405,11 +41421,11 @@ var ts; return spanInNextNode(node); default: // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 224 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 225 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 160 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 161 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNode(node.parent.expression); } // return type of function go to previous token @@ -40422,12 +41438,12 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 187 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */) { + if (variableDeclaration.parent.parent.kind === 188 /* ForInStatement */ || + variableDeclaration.parent.parent.kind === 189 /* ForOfStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 181 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 187 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement @@ -40481,7 +41497,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 1 /* Export */) || - (functionDeclaration.parent.kind === 201 /* ClassDeclaration */ && functionDeclaration.kind !== 135 /* Constructor */); + (functionDeclaration.parent.kind === 202 /* ClassDeclaration */ && functionDeclaration.kind !== 136 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -40504,18 +41520,18 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 205 /* ModuleDeclaration */: + case 206 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement - case 185 /* WhileStatement */: - case 183 /* IfStatement */: - case 187 /* ForInStatement */: - case 188 /* ForOfStatement */: + case 186 /* WhileStatement */: + case 184 /* IfStatement */: + case 188 /* ForInStatement */: + case 189 /* 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 186 /* ForStatement */: + case 187 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement @@ -40523,7 +41539,7 @@ var ts; } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 199 /* VariableDeclarationList */) { + if (forStatement.initializer.kind === 200 /* VariableDeclarationList */) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -40536,20 +41552,20 @@ var ts; if (forStatement.condition) { return textSpan(forStatement.condition); } - if (forStatement.iterator) { - return textSpan(forStatement.iterator); + if (forStatement.incrementor) { + return textSpan(forStatement.incrementor); } } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 204 /* EnumDeclaration */: + case 205 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 201 /* ClassDeclaration */: + case 202 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 207 /* CaseBlock */: + case 208 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -40557,30 +41573,30 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 206 /* ModuleBlock */: + case 207 /* ModuleBlock */: // If this is not instantiated module block no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 204 /* EnumDeclaration */: - case 201 /* ClassDeclaration */: + case 205 /* EnumDeclaration */: + case 202 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 179 /* Block */: + case 180 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // fall through. - case 223 /* CatchClause */: - return spanInNode(node.parent.statements[node.parent.statements.length - 1]); + case 224 /* CatchClause */: + return spanInNode(ts.lastOrUndefined(node.parent.statements)); ; - case 207 /* CaseBlock */: + case 208 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; - var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; + var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { - return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; // Default to parent node @@ -40589,7 +41605,7 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 184 /* DoStatement */) { + if (node.parent.kind === 185 /* DoStatement */) { // Go to while keyword and do action instead return spanInPreviousNode(node); } @@ -40599,17 +41615,17 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 162 /* FunctionExpression */: - case 200 /* FunctionDeclaration */: - case 163 /* ArrowFunction */: - case 134 /* MethodDeclaration */: - case 133 /* MethodSignature */: - case 136 /* GetAccessor */: - case 137 /* SetAccessor */: - case 135 /* Constructor */: - case 185 /* WhileStatement */: - case 184 /* DoStatement */: - case 186 /* ForStatement */: + case 163 /* FunctionExpression */: + case 201 /* FunctionDeclaration */: + case 164 /* ArrowFunction */: + case 135 /* MethodDeclaration */: + case 134 /* MethodSignature */: + case 137 /* GetAccessor */: + case 138 /* SetAccessor */: + case 136 /* Constructor */: + case 186 /* WhileStatement */: + case 185 /* DoStatement */: + case 187 /* ForStatement */: return spanInPreviousNode(node); // Default to parent node default: @@ -40620,19 +41636,19 @@ var ts; } function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 224 /* PropertyAssignment */) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 225 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 160 /* TypeAssertionExpression */) { + if (node.parent.kind === 161 /* TypeAssertionExpression */) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 184 /* DoStatement */) { + if (node.parent.kind === 185 /* DoStatement */) { // Set span on while expression return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } @@ -40646,7 +41662,7 @@ var ts; })(ts || (ts = {})); // // Copyright (c) Microsoft Corporation. All rights reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -40665,7 +41681,9 @@ var debugObjectHost = this; var ts; (function (ts) { function logInternalError(logger, err) { - logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); + if (logger) { + logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); + } } var ScriptSnapshotShimAdapter = (function () { function ScriptSnapshotShimAdapter(scriptSnapshotShim) { @@ -40758,24 +41776,39 @@ var ts; return LanguageServiceShimHostAdapter; })(); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - function simpleForwardCall(logger, actionDescription, action) { - logger.log(actionDescription); - var start = Date.now(); + var CoreServicesShimHostAdapter = (function () { + function CoreServicesShimHostAdapter(shimHost) { + this.shimHost = shimHost; + } + CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extension) { + var encoded = this.shimHost.readDirectory(rootDir, extension); + return JSON.parse(encoded); + }; + return CoreServicesShimHostAdapter; + })(); + ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; + function simpleForwardCall(logger, actionDescription, action, noPerfLogging) { + if (!noPerfLogging) { + logger.log(actionDescription); + var start = Date.now(); + } var result = action(); - var end = Date.now(); - logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { - var str = result; - if (str.length > 128) { - str = str.substring(0, 128) + "..."; + if (!noPerfLogging) { + var end = Date.now(); + logger.log(actionDescription + " completed in " + (end - start) + " msec"); + if (typeof (result) === "string") { + var str = result; + if (str.length > 128) { + str = str.substring(0, 128) + "..."; + } + logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); } - logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); } return result; } - function forwardJSONCall(logger, actionDescription, action) { + function forwardJSONCall(logger, actionDescription, action, noPerfLogging) { try { - var result = simpleForwardCall(logger, actionDescription, action); + var result = simpleForwardCall(logger, actionDescription, action, noPerfLogging); return JSON.stringify({ result: result }); } catch (err) { @@ -40820,7 +41853,7 @@ var ts; this.logger = this.host; } LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action); + return forwardJSONCall(this.logger, actionDescription, action, false); }; /// DISPOSE /** @@ -40873,6 +41906,22 @@ var ts; return classifications; }); }; + LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); + }); + }; + LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); + }); + }; LanguageServiceShimObject.prototype.getNewLine = function () { return this.host.getNewLine ? this.host.getNewLine() : "\r\n"; }; @@ -40951,6 +42000,17 @@ var ts; return _this.languageService.getDefinitionAtPosition(fileName, position); }); }; + /// GOTO Type + /** + * Computes the definition location of the type of the symbol + * at the requested position. + */ + LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) { + var _this = this; + return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { + return _this.languageService.getTypeDefinitionAtPosition(fileName, position); + }); + }; LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { var _this = this; return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { @@ -41092,12 +42152,21 @@ var ts; }; return LanguageServiceShimObject; })(ShimBase); + function convertClassifications(classifications) { + return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; + } var ClassifierShimObject = (function (_super) { __extends(ClassifierShimObject, _super); - function ClassifierShimObject(factory) { + function ClassifierShimObject(factory, logger) { _super.call(this, factory); + this.logger = logger; this.classifier = ts.createClassifier(); } + ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) { + var _this = this; + return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, + /*noPerfLogging:*/ true); + }; /// COLORIZATION ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); @@ -41114,12 +42183,13 @@ var ts; })(ShimBase); var CoreServicesShimObject = (function (_super) { __extends(CoreServicesShimObject, _super); - function CoreServicesShimObject(factory, logger) { + function CoreServicesShimObject(factory, logger, host) { _super.call(this, factory); this.logger = logger; + this.host = host; } CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action); + return forwardJSONCall(this.logger, actionDescription, action, false); }; CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { @@ -41146,6 +42216,26 @@ var ts; return convertResult; }); }; + CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { + var _this = this; + return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { + var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); + var result = ts.parseConfigFileText(fileName, text); + if (result.error) { + return { + options: {}, + files: [], + errors: [realizeDiagnostic(result.error, '\r\n')] + }; + } + var configFile = ts.parseConfigFile(result.config, _this.host, ts.getDirectoryPath(ts.normalizeSlashes(fileName))); + return { + options: configFile.options, + files: configFile.fileNames, + errors: [realizeDiagnostics(configFile.errors, '\r\n')] + }; + }); + }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { return this.forwardJSONCall("getDefaultCompilationSettings()", function () { return ts.getDefaultCompilerOptions(); @@ -41177,19 +42267,20 @@ var ts; }; TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) { try { - return new ClassifierShimObject(this); + return new ClassifierShimObject(this, logger); } catch (err) { logInternalError(logger, err); throw err; } }; - TypeScriptServicesFactory.prototype.createCoreServicesShim = function (logger) { + TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) { try { - return new CoreServicesShimObject(this, logger); + var adapter = new CoreServicesShimHostAdapter(host); + return new CoreServicesShimObject(this, host, adapter); } catch (err) { - logInternalError(logger, err); + logInternalError(host, err); throw err; } }; @@ -41227,4 +42318,4 @@ var TypeScript; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); /* @internal */ -var toolsVersion = "1.5"; +var toolsVersion = "1.4"; diff --git a/doc/logo.svg b/doc/logo.svg new file mode 100644 index 00000000000..fc7e0fadd66 --- /dev/null +++ b/doc/logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/scripts/createBenchmark.ts b/scripts/createBenchmark.ts new file mode 100644 index 00000000000..659df53c915 --- /dev/null +++ b/scripts/createBenchmark.ts @@ -0,0 +1,124 @@ +/// +/// + +import * as fs from "fs"; +import * as path from "path"; +import * as typescript from "typescript"; +declare var ts: typeof typescript; + +var tsSourceDir = "../src"; +var tsBuildDir = "../built/local"; +var testOutputDir = "../built/benchmark"; +var sourceFiles = [ + "compiler/types.ts", + "compiler/core.ts", + "compiler/sys.ts", + "compiler/diagnosticInformationMap.generated.ts", + "compiler/scanner.ts", + "compiler/binder.ts", + "compiler/utilities.ts", + "compiler/parser.ts", + "compiler/checker.ts", + "compiler/declarationEmitter.ts", + "compiler/emitter.ts", + "compiler/program.ts", + "compiler/commandLineParser.ts", + "compiler/tsc.ts"]; + +// .ts sources for the compiler, used as a test input +var rawCompilerSources = ""; +sourceFiles.forEach(f=> { + rawCompilerSources += "\r\n" + fs.readFileSync(path.join(tsSourceDir, f)).toString(); +}); +var compilerSoruces = `var compilerSources = ${JSON.stringify(rawCompilerSources) };`; + +// .js code for the compiler, what we are actuallty testing +var rawCompilerJavaScript = fs.readFileSync(path.join(tsBuildDir, "tsc.js")).toString(); +rawCompilerJavaScript = rawCompilerJavaScript.replace("ts.executeCommandLine(ts.sys.args);", ""); + +// lib.d.ts sources +var rawLibSources = fs.readFileSync(path.join(tsBuildDir, "lib.d.ts")).toString(); +var libSoruces = `var libSources = ${JSON.stringify(rawLibSources) };`; + +// write test output +if (!fs.existsSync(testOutputDir)) { + fs.mkdirSync(testOutputDir); +} + +// 1. compiler ts sources, used to test +fs.writeFileSync( + path.join(testOutputDir, "compilerSources.js"), + `${ compilerSoruces } \r\n ${ libSoruces }`); + +// 2. the compiler js sources + a call the compiler +fs.writeFileSync( + path.join(testOutputDir, "benchmarktsc.js"), + `${ rawCompilerJavaScript }\r\n${ compile.toString() }\r\ncompile(compilerSources, libSources);`); + +// 3. test html file to drive the test +fs.writeFileSync( + path.join(testOutputDir, "benchmarktsc.html"), + ` + + + + Typescript 1.1 Compiler + + + +
Status: Running
+
End-to-End Time: N/A
+ + + + + +`); + +function compile(compilerSources, librarySources) { + var program = ts.createProgram( + ["lib.d.ts", "compiler.ts"], + { + noResolve: true, + out: "compiler.js", + removeComments: true, + target: ts.ScriptTarget.ES3 + }, { + getDefaultLibFileName: () => "lib.d.ts", + getSourceFile: (filename, languageVersion) => { + var source: string; + if (filename === "lib.d.ts") source = librarySources; + else if (filename === "compiler.ts") source = compilerSources; + else console.error("Unexpected read file request: " + filename); + + return ts.createSourceFile(filename, source, languageVersion); + }, + writeFile: (filename, data, writeByteOrderMark) => { + if (filename !== "compiler.js") + console.error("Unexpected write file request: " + filename); + // console.log(data); + }, + getCurrentDirectory: () => "", + getCanonicalFileName: (filename) => filename, + useCaseSensitiveFileNames: () => false, + getNewLine: () => "\r\n" + }); + + var emitOutput = program.emit(); + + var errors = program.getSyntacticDiagnostics() + .concat(program.getSemanticDiagnostics()) + .concat(program.getGlobalDiagnostics()) + .concat(emitOutput.diagnostics); + + if (errors.length) { + console.error("Unexpected errors."); + errors.forEach(e=> console.log(`${e.code}: ${e.messageText}`)) + } +} diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9d6d9fab35b..170f3d3c830 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -239,11 +239,7 @@ module ts { if (symbolKind & SymbolFlags.IsContainer) { container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - - lastContainer = container; + addToContainerChain(container); } if (isBlockScopeContainer) { @@ -262,6 +258,14 @@ module ts { blockScopeContainer = savedBlockScopeContainer; } + function addToContainerChain(node: Node) { + if (lastContainer) { + lastContainer.nextContainer = node; + } + + lastContainer = node; + } + function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags, isBlockScopeContainer: boolean) { switch (container.kind) { case SyntaxKind.ModuleDeclaration: @@ -403,6 +407,7 @@ module ts { default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); } declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 369861d6fbd..4c5712299da 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -88,12 +88,11 @@ module ts { let undefinedType = createIntrinsicType(TypeFlags.Undefined | TypeFlags.ContainsUndefinedOrNull, "undefined"); let nullType = createIntrinsicType(TypeFlags.Null | TypeFlags.ContainsUndefinedOrNull, "null"); let unknownType = createIntrinsicType(TypeFlags.Any, "unknown"); - let resolvingType = createIntrinsicType(TypeFlags.Any, "__resolving__"); let emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); let anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); let noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - + let anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); let unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); @@ -118,7 +117,7 @@ module ts { let getGlobalParameterDecoratorType: () => ObjectType; let getGlobalPropertyDecoratorType: () => ObjectType; let getGlobalMethodDecoratorType: () => ObjectType; - + let tupleTypes: Map = {}; let unionTypes: Map = {}; let stringLiteralTypes: Map = {}; @@ -126,6 +125,9 @@ module ts { let emitDecorate = false; let emitParam = false; + let resolutionTargets: Object[] = []; + let resolutionResults: boolean[] = []; + let mergedSymbols: Symbol[] = []; let symbolLinks: SymbolLinks[] = []; let nodeLinks: NodeLinks[] = []; @@ -350,9 +352,9 @@ module ts { } else if (location.kind === SyntaxKind.SourceFile || (location.kind === SyntaxKind.ModuleDeclaration && (location).name.kind === SyntaxKind.StringLiteral)) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & SymbolFlags.ModuleMember); + result = getSymbolOfNode(location).exports["default"]; let localSymbol = getLocalSymbolForExportDefault(result); - if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { + if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { break loop; } result = undefined; @@ -582,7 +584,7 @@ module ts { if (moduleSymbol) { let exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); if (!exportDefaultSymbol) { - error(node.name, Diagnostics.External_module_0_has_no_default_export, symbolToString(moduleSymbol)); + error(node.name, Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } return exportDefaultSymbol; } @@ -801,7 +803,9 @@ module ts { let symbol: Symbol; if (name.kind === SyntaxKind.Identifier) { - symbol = resolveName(name, (name).text, meaning, Diagnostics.Cannot_find_name_0, name); + let message = meaning === SymbolFlags.Namespace ? Diagnostics.Cannot_find_namespace_0 : Diagnostics.Cannot_find_name_0; + + symbol = resolveName(name, (name).text, meaning, message, name); if (!symbol) { return undefined; } @@ -870,10 +874,10 @@ module ts { if (sourceFile.symbol) { return sourceFile.symbol; } - error(moduleReferenceLiteral, Diagnostics.File_0_is_not_an_external_module, sourceFile.fileName); + error(moduleReferenceLiteral, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); return; } - error(moduleReferenceLiteral, Diagnostics.Cannot_find_external_module_0, moduleName); + error(moduleReferenceLiteral, Diagnostics.Cannot_find_module_0, moduleName); } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, @@ -888,7 +892,7 @@ module ts { function resolveESModuleSymbol(moduleSymbol: Symbol, moduleReferenceExpression: Expression): Symbol { let symbol = resolveExternalModuleSymbol(moduleSymbol); if (symbol && !(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) { - error(moduleReferenceExpression, Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + error(moduleReferenceExpression, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } return symbol; @@ -1980,7 +1984,7 @@ module ts { } } - function collectLinkedAliases(node: Identifier): Node[]{ + function collectLinkedAliases(node: Identifier): Node[] { var exportSymbol: Symbol; if (node.parent && node.parent.kind === SyntaxKind.ExportAssignment) { exportSymbol = resolveName(node.parent, node.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, node); @@ -2014,6 +2018,38 @@ module ts { } } + // Push an entry on the type resolution stack. If an entry with the given target is not already on the stack, + // a new entry with that target and an associated result value of true is pushed on the stack, and the value + // true is returned. Otherwise, a circularity has occurred and the result values of the existing entry and + // all entries pushed after it are changed to false, and the value false is returned. The target object provides + // a unique identity for a particular type resolution result: Symbol instances are used to track resolution of + // SymbolLinks.type, SymbolLinks instances are used to track resolution of SymbolLinks.declaredType, and + // Signature instances are used to track resolution of Signature.resolvedReturnType. + function pushTypeResolution(target: Object): boolean { + let i = 0; + let count = resolutionTargets.length; + while (i < count && resolutionTargets[i] !== target) { + i++; + } + if (i < count) { + do { + resolutionResults[i++] = false; + } + while (i < count); + return false; + } + resolutionTargets.push(target); + resolutionResults.push(true); + return true; + } + + // Pop an entry from the type resolution stack and return its associated result value. The result value will + // be true if no circularities were detected, or false if a circularity was found. + function popTypeResolution(): boolean { + resolutionTargets.pop(); + return resolutionResults.pop(); + } + function getRootDeclaration(node: Node): Node { while (node.kind === SyntaxKind.BindingElement) { node = node.parent.parent; @@ -2271,20 +2307,27 @@ module ts { return links.type = checkExpression((declaration).expression); } // Handle variable, parameter or property - links.type = resolvingType; + if (!pushTypeResolution(symbol)) { + return unknownType; + } let type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - let diagnostic = (symbol.valueDeclaration).type ? - Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + if (!popTypeResolution()) { + if ((symbol.valueDeclaration).type) { + // Variable has type annotation that circularly references the variable itself + type = unknownType; + error(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, + symbolToString(symbol)); + } + else { + // Variable has initializer that circularly references the variable itself + type = anyType; + if (compilerOptions.noImplicitAny) { + error(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, + symbolToString(symbol)); + } + } } + links.type = type; } return links.type; } @@ -2308,19 +2351,13 @@ module ts { function getTypeOfAccessors(symbol: Symbol): Type { let links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - - function checkAndStoreTypeOfAccessors(symbol: Symbol, links?: SymbolLinks) { - links = links || getSymbolLinks(symbol); if (!links.type) { - links.type = resolvingType; + if (!pushTypeResolution(symbol)) { + return unknownType; + } let getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); let setter = getDeclarationOfKind(symbol, SyntaxKind.SetAccessor); - let type: Type; - // First try to see if the user specified a return type on the get-accessor. let getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -2342,23 +2379,20 @@ module ts { if (compilerOptions.noImplicitAny) { error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); } - type = anyType; } } } - - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - let getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); - error(getter, 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)); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + let getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); + error(getter, 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)); + } } + links.type = type; } + return links.type; } function getTypeOfFuncClassEnumModule(symbol: Symbol): Type { @@ -2451,7 +2485,7 @@ module ts { return result; } - function getBaseTypes(type: InterfaceType): ObjectType[]{ + function getBaseTypes(type: InterfaceType): ObjectType[] { let typeWithBaseTypes = type; if (!typeWithBaseTypes.baseTypes) { if (type.symbol.flags & SymbolFlags.Class) { @@ -2473,7 +2507,7 @@ module ts { let declaration = getDeclarationOfKind(type.symbol, SyntaxKind.ClassDeclaration); let baseTypeNode = getClassExtendsHeritageClauseElement(declaration); if (baseTypeNode) { - let baseType = getTypeFromHeritageClauseElement(baseTypeNode); + let baseType = getTypeFromTypeNode(baseTypeNode); if (baseType !== unknownType) { if (getTargetType(baseType).flags & TypeFlags.Class) { if (type !== baseType && !hasBaseType(baseType, type)) { @@ -2495,7 +2529,7 @@ module ts { for (let declaration of type.symbol.declarations) { if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration)) { for (let node of getInterfaceBaseTypeNodes(declaration)) { - let baseType = getTypeFromHeritageClauseElement(node); + let baseType = getTypeFromTypeNode(node); if (baseType !== unknownType) { if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { @@ -2515,10 +2549,11 @@ module ts { } } - function getDeclaredTypeOfClass(symbol: Symbol): InterfaceType { + function getDeclaredTypeOfClassOrInterface(symbol: Symbol): InterfaceType { let links = getSymbolLinks(symbol); if (!links.declaredType) { - let type = links.declaredType = createObjectType(TypeFlags.Class, symbol); + let kind = symbol.flags & SymbolFlags.Class ? TypeFlags.Class : TypeFlags.Interface; + let type = links.declaredType = createObjectType(kind, symbol); let typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { type.flags |= TypeFlags.Reference; @@ -2528,35 +2563,6 @@ module ts { (type).target = type; (type).typeArguments = type.typeParameters; } - - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); - } - return links.declaredType; - } - - function getDeclaredTypeOfInterface(symbol: Symbol): InterfaceType { - let links = getSymbolLinks(symbol); - if (!links.declaredType) { - let type = links.declaredType = createObjectType(TypeFlags.Interface, symbol); - let typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= TypeFlags.Reference; - type.typeParameters = typeParameters; - (type).instantiations = {}; - (type).instantiations[getTypeListId(type.typeParameters)] = type; - (type).target = type; - (type).typeArguments = type.typeParameters; - } - - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); } return links.declaredType; } @@ -2564,17 +2570,18 @@ module ts { function getDeclaredTypeOfTypeAlias(symbol: Symbol): Type { let links = getSymbolLinks(symbol); if (!links.declaredType) { - links.declaredType = resolvingType; + // Note that we use the links object as the target here because the symbol object is used as the unique + // identity for resolution of the 'type' property in SymbolLinks. + if (!pushTypeResolution(links)) { + return unknownType; + } let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); let type = getTypeFromTypeNode(declaration.type); - if (links.declaredType === resolvingType) { - links.declaredType = type; + if (!popTypeResolution()) { + type = unknownType; + error(declaration.name, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } - } - else if (links.declaredType === resolvingType) { - links.declaredType = unknownType; - let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); - error(declaration.name, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + links.declaredType = type; } return links.declaredType; } @@ -2612,11 +2619,8 @@ module ts { function getDeclaredTypeOfSymbol(symbol: Symbol): Type { Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0); - if (symbol.flags & SymbolFlags.Class) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & SymbolFlags.Interface) { - return getDeclaredTypeOfInterface(symbol); + if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + return getDeclaredTypeOfClassOrInterface(symbol); } if (symbol.flags & SymbolFlags.TypeAlias) { return getDeclaredTypeOfTypeAlias(symbol); @@ -2665,15 +2669,28 @@ module ts { } } + function resolveDeclaredMembers(type: InterfaceType): InterfaceTypeWithDeclaredMembers { + if (!(type).declaredProperties) { + var symbol = type.symbol; + (type).declaredProperties = getNamedMembers(symbol.members); + (type).declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + (type).declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + (type).declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); + (type).declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); + } + return type; + } + function resolveClassOrInterfaceMembers(type: InterfaceType): void { - let members = type.symbol.members; - let callSignatures = type.declaredCallSignatures; - let constructSignatures = type.declaredConstructSignatures; - let stringIndexType = type.declaredStringIndexType; - let numberIndexType = type.declaredNumberIndexType; - let baseTypes = getBaseTypes(type); + let target = resolveDeclaredMembers(type); + let members = target.symbol.members; + let callSignatures = target.declaredCallSignatures; + let constructSignatures = target.declaredConstructSignatures; + let stringIndexType = target.declaredStringIndexType; + let numberIndexType = target.declaredNumberIndexType; + let baseTypes = getBaseTypes(target); if (baseTypes.length) { - members = createSymbolTable(type.declaredProperties); + members = createSymbolTable(target.declaredProperties); for (let baseType of baseTypes) { addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = concatenate(callSignatures, getSignaturesOfType(baseType, SignatureKind.Call)); @@ -2686,7 +2703,7 @@ module ts { } function resolveTypeReferenceMembers(type: TypeReference): void { - let target = type.target; + let target = resolveDeclaredMembers(type.target); let mapper = createTypeMapper(target.typeParameters, type.typeArguments); let members = createInstantiatedSymbolTable(target.declaredProperties, mapper); let callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); @@ -2842,7 +2859,7 @@ module ts { callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & SymbolFlags.Class) { - let classType = getDeclaredTypeOfClass(symbol); + let classType = getDeclaredTypeOfClassOrInterface(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); @@ -2955,7 +2972,7 @@ module ts { let type = getApparentType(current); if (type !== unknownType) { let prop = getPropertyOfType(type, name); - if (!prop) { + if (!prop || getDeclarationFlagsFromSymbol(prop) & (NodeFlags.Private | NodeFlags.Protected)) { return undefined; } if (!props) { @@ -3083,7 +3100,7 @@ module ts { function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature { let links = getNodeLinks(declaration); if (!links.resolvedSignature) { - let classType = declaration.kind === SyntaxKind.Constructor ? getDeclaredTypeOfClass((declaration.parent).symbol) : undefined; + let classType = declaration.kind === SyntaxKind.Constructor ? getDeclaredTypeOfClassOrInterface((declaration.parent).symbol) : undefined; let typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; let parameters: Symbol[] = []; @@ -3168,7 +3185,9 @@ module ts { function getReturnTypeOfSignature(signature: Signature): Type { if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; + if (!pushTypeResolution(signature)) { + return unknownType; + } let type: Type; if (signature.target) { type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); @@ -3179,28 +3198,26 @@ module ts { else { type = getReturnTypeFromBody(signature.declaration); } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - let declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, 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, declarationNameToString(declaration.name)); - } - else { - error(declaration, Diagnostics.Function_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); + if (!popTypeResolution()) { + type = anyType; + if (compilerOptions.noImplicitAny) { + let declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, 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, declarationNameToString(declaration.name)); + } + else { + error(declaration, Diagnostics.Function_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); + } } } + signature.resolvedReturnType = type; } return signature.resolvedReturnType; } function getRestTypeOfSignature(signature: Signature): Type { if (signature.hasRestParameter) { - let type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + let type = getTypeOfSymbol(lastOrUndefined(signature.parameters)); if (type.flags & TypeFlags.Reference && (type).target === globalArrayType) { return (type).typeArguments[0]; } @@ -3328,7 +3345,7 @@ module ts { return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode | HeritageClauseElement, typeParameterSymbol: Symbol): boolean { + function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode | ExpressionWithTypeArguments, typeParameterSymbol: Symbol): boolean { let links = getNodeLinks(typeReferenceNode); if (links.isIllegalTypeReferenceInConstraint !== undefined) { return links.isIllegalTypeReferenceInConstraint; @@ -3377,25 +3394,17 @@ module ts { } } - function getTypeFromTypeReference(node: TypeReferenceNode): Type { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - - function getTypeFromHeritageClauseElement(node: HeritageClauseElement): Type { - return getTypeFromTypeReferenceOrHeritageClauseElement(node); - } - - function getTypeFromTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement): Type { + function getTypeFromTypeReferenceOrExpressionWithTypeArguments(node: TypeReferenceNode | ExpressionWithTypeArguments): Type { let links = getNodeLinks(node); if (!links.resolvedType) { let type: Type; // We don't currently support heritage clauses with complex expressions in them. // For these cases, we just set the type to be the unknownType. - if (node.kind !== SyntaxKind.HeritageClauseElement || isSupportedHeritageClauseElement(node)) { + if (node.kind !== SyntaxKind.ExpressionWithTypeArguments || isSupportedExpressionWithTypeArguments(node)) { let typeNameOrExpression = node.kind === SyntaxKind.TypeReference ? (node).typeName - : (node).expression; + : (node).expression; let symbol = resolveEntityName(typeNameOrExpression, SymbolFlags.Type); if (symbol) { @@ -3685,9 +3694,9 @@ module ts { case SyntaxKind.StringLiteral: return getTypeFromStringLiteral(node); case SyntaxKind.TypeReference: - return getTypeFromTypeReference(node); - case SyntaxKind.HeritageClauseElement: - return getTypeFromHeritageClauseElement(node); + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); + case SyntaxKind.ExpressionWithTypeArguments: + return getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); case SyntaxKind.TypeQuery: return getTypeFromTypeQueryNode(node); case SyntaxKind.ArrayType: @@ -5377,17 +5386,35 @@ module ts { } // Target type is type of prototype property let prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (!prototypeProperty) { - return type; + if (prototypeProperty) { + let targetType = getTypeOfSymbol(prototypeProperty); + if (targetType !== anyType) { + // Narrow to the target type if it's a subtype of the current type + if (isTypeSubtypeOf(targetType, type)) { + return targetType; + } + // If the current type is a union type, remove all constituents that aren't subtypes of the target. + if (type.flags & TypeFlags.Union) { + return getUnionType(filter((type).types, t => isTypeSubtypeOf(t, targetType))); + } + } } - let targetType = getTypeOfSymbol(prototypeProperty); - // Narrow to target type if it is a subtype of current type - if (isTypeSubtypeOf(targetType, type)) { - return targetType; + // Target type is type of construct signature + let constructSignatures: Signature[]; + if (rightType.flags & TypeFlags.Interface) { + constructSignatures = resolveDeclaredMembers(rightType).declaredConstructSignatures; } - // If current type is a union type, remove all constituents that aren't subtypes of target type - if (type.flags & TypeFlags.Union) { - return getUnionType(filter((type).types, t => isTypeSubtypeOf(t, targetType))); + else if (rightType.flags & TypeFlags.Anonymous) { + constructSignatures = getSignaturesOfType(rightType, SignatureKind.Construct); + } + + if (constructSignatures && constructSignatures.length !== 0) { + let instanceType = getUnionType(map(constructSignatures, signature => getReturnTypeOfSignature(getErasedSignature(signature)))); + // Pickup type from union types + if (type.flags & TypeFlags.Union) { + return getUnionType(filter((type).types, t => isTypeSubtypeOf(t, instanceType))); + } + return instanceType; } return type; } @@ -5526,7 +5553,7 @@ module ts { switch (container.kind) { case SyntaxKind.ModuleDeclaration: - error(node, Diagnostics.this_cannot_be_referenced_in_a_module_body); + error(node, 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 SyntaxKind.EnumDeclaration: @@ -5692,7 +5719,7 @@ module ts { // If last parameter is contextually rest parameter get its type if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + return getTypeOfSymbol(lastOrUndefined(contextualSignature.parameters)); } } } @@ -7241,9 +7268,9 @@ module ts { links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - let parameter = signature.parameters[signature.parameters.length - 1]; + let parameter = lastOrUndefined(signature.parameters); let links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + links.type = instantiateType(getTypeOfSymbol(lastOrUndefined(context.parameters)), mapper); } } @@ -7368,10 +7395,9 @@ module ts { if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } - if (!node.type) { - signature.resolvedReturnType = resolvingType; + if (!node.type && !signature.resolvedReturnType) { let returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { + if (!signature.resolvedReturnType) { signature.resolvedReturnType = returnType; } } @@ -8385,8 +8411,7 @@ module ts { } } } - - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); + getTypeOfAccessors(getSymbolOfNode(node)); } checkFunctionLikeDeclaration(node); @@ -8398,20 +8423,20 @@ module ts { function checkTypeReferenceNode(node: TypeReferenceNode) { checkGrammarTypeReferenceInStrictMode(node.typeName); - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkHeritageClauseElement(node: HeritageClauseElement) { - checkGrammarHeritageClauseElementInStrictMode(node.expression); + function checkExpressionWithTypeArguments(node: ExpressionWithTypeArguments) { + checkGrammarExpressionWithTypeArgumentsInStrictMode(node.expression); - return checkTypeReferenceOrHeritageClauseElement(node); + return checkTypeReferenceOrExpressionWithTypeArguments(node); } - function checkTypeReferenceOrHeritageClauseElement(node: TypeReferenceNode | HeritageClauseElement) { + function checkTypeReferenceOrExpressionWithTypeArguments(node: TypeReferenceNode | ExpressionWithTypeArguments) { // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); - let type = getTypeFromTypeReferenceOrHeritageClauseElement(node); + let type = getTypeFromTypeReferenceOrExpressionWithTypeArguments(node); if (type !== unknownType && node.typeArguments) { // Do type argument local checks only if referenced type is successfully resolved let len = node.typeArguments.length; @@ -9097,7 +9122,7 @@ module ts { let parent = getDeclarationContainer(node); if (parent.kind === SyntaxKind.SourceFile && isExternalModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords - error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, + error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name)); } } @@ -9366,7 +9391,7 @@ module ts { } if (node.condition) checkExpression(node.condition); - if (node.iterator) checkExpression(node.iterator); + if (node.incrementor) checkExpression(node.incrementor); checkSourceElement(node.statement); } @@ -9977,12 +10002,12 @@ module ts { let staticType = getTypeOfSymbol(symbol); let baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - if (!isSupportedHeritageClauseElement(baseTypeNode)) { + if (!isSupportedExpressionWithTypeArguments(baseTypeNode)) { error(baseTypeNode.expression, Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); } emitExtends = emitExtends || !isInAmbientContext(node); - checkHeritageClauseElement(baseTypeNode); + checkExpressionWithTypeArguments(baseTypeNode); } let baseTypes = getBaseTypes(type); if (baseTypes.length) { @@ -10009,13 +10034,13 @@ module ts { let implementedTypeNodes = getClassImplementsHeritageClauseElements(node); if (implementedTypeNodes) { forEach(implementedTypeNodes, typeRefNode => { - if (!isSupportedHeritageClauseElement(typeRefNode)) { + if (!isSupportedExpressionWithTypeArguments(typeRefNode)) { error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(typeRefNode); + checkExpressionWithTypeArguments(typeRefNode); if (produceDiagnostics) { - let t = getTypeFromHeritageClauseElement(typeRefNode); + let t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { let declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { @@ -10151,7 +10176,7 @@ module ts { } let seen: Map<{ prop: Symbol; containingType: Type }> = {}; - forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); + forEach(resolveDeclaredMembers(type).declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); let ok = true; for (let base of baseTypes) { @@ -10210,11 +10235,11 @@ module ts { } } forEach(getInterfaceBaseTypeNodes(node), heritageElement => { - if (!isSupportedHeritageClauseElement(heritageElement)) { + if (!isSupportedExpressionWithTypeArguments(heritageElement)) { error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } - checkHeritageClauseElement(heritageElement); + checkExpressionWithTypeArguments(heritageElement); }); forEach(node.members, checkSourceElement); @@ -10512,10 +10537,10 @@ module ts { let firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } @@ -10531,10 +10556,10 @@ module ts { // Checks for ambient external modules. if (node.name.kind === SyntaxKind.StringLiteral) { if (!isGlobalSourceFile(node.parent)) { - error(node.name, Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); } if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); } } } @@ -10566,8 +10591,8 @@ module ts { let inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (node.parent.parent).name.kind === SyntaxKind.StringLiteral; if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) { error(moduleName, node.kind === SyntaxKind.ExportDeclaration ? - Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : + Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative((moduleName).text)) { @@ -10575,7 +10600,7 @@ module ts { // 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_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); return false; } return true; @@ -10669,14 +10694,14 @@ module ts { let inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (node.parent.parent).name.kind === SyntaxKind.StringLiteral; if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) { - error(node, Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); + error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { // export * from "foo" let moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { - error(node.moduleSpecifier, Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); + error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); } } } @@ -10692,7 +10717,7 @@ module ts { function checkExportAssignment(node: ExportAssignment) { let container = node.parent.kind === SyntaxKind.SourceFile ? node.parent : node.parent.parent; if (container.kind === SyntaxKind.ModuleDeclaration && (container).name.kind === SyntaxKind.Identifier) { - error(node, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } // Grammar checking @@ -10707,9 +10732,15 @@ module ts { } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= ScriptTarget.ES6) { - // export assignment is deprecated in es6 or above - grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + if (node.isExportEquals && !isInAmbientContext(node)) { + if (languageVersion >= ScriptTarget.ES6) { + // export assignment is deprecated in es6 or above + grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); + } + else if (compilerOptions.module === ModuleKind.System) { + // system modules does not support export assignment + grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } } } @@ -11166,7 +11197,7 @@ module ts { node = node.parent; } - return node.parent && node.parent.kind === SyntaxKind.HeritageClauseElement; + return node.parent && node.parent.kind === SyntaxKind.ExpressionWithTypeArguments; } function isTypeNode(node: Node): boolean { @@ -11186,7 +11217,7 @@ module ts { case SyntaxKind.StringLiteral: // Specialized signatures can have string literals as their parameters' type names return node.parent.kind === SyntaxKind.Parameter; - case SyntaxKind.HeritageClauseElement: + case SyntaxKind.ExpressionWithTypeArguments: return true; // Identifiers and qualified names may be type nodes, depending on their context. Climb @@ -11220,7 +11251,7 @@ module ts { return true; } switch (parent.kind) { - case SyntaxKind.HeritageClauseElement: + case SyntaxKind.ExpressionWithTypeArguments: return true; case SyntaxKind.TypeParameter: return node === (parent).constraint; @@ -11298,7 +11329,7 @@ module ts { } if (isHeritageClauseElementIdentifier(entityName)) { - let meaning = entityName.parent.kind === SyntaxKind.HeritageClauseElement ? SymbolFlags.Type : SymbolFlags.Namespace; + let meaning = entityName.parent.kind === SyntaxKind.ExpressionWithTypeArguments ? SymbolFlags.Type : SymbolFlags.Namespace; meaning |= SymbolFlags.Alias; return resolveEntityName(entityName, meaning); } @@ -11532,9 +11563,11 @@ module ts { function getExportNameSubstitution(symbol: Symbol, location: Node, getGeneratedNameForNode: (Node: Node) => string): string { if (isExternalModuleSymbol(symbol.parent)) { - // If this is es6 or higher, just use the name of the export + // 1. If this is es6 or higher, just use the name of the export // no need to qualify it. - if (languageVersion >= ScriptTarget.ES6) { + // 2. export mechanism for System modules is different from CJS\AMD + // and it does not need qualifications for exports + if (languageVersion >= ScriptTarget.ES6 || compilerOptions.module === ModuleKind.System) { return undefined; } return "exports." + unescapeIdentifier(symbol.name); @@ -11705,7 +11738,7 @@ module ts { // * The serialized type of a TypeReference with a value declaration is its entity name. // * The serialized type of a TypeReference with a call or construct signature is "Function". // * The serialized type of any other type is "Object". - let type = getTypeFromTypeReference(node); + let type = getTypeFromTypeNode(node); if (type.flags & TypeFlags.Void) { return "void 0"; } @@ -11895,6 +11928,15 @@ module ts { return !!resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined); } + function getReferencedValueDeclaration(reference: Identifier): Declaration { + Debug.assert(!nodeIsSynthesized(reference)); + let symbol = + getNodeLinks(reference).resolvedSymbol || + resolveName(reference, reference.text, SymbolFlags.Value | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined); + + return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } + function getBlockScopedVariableId(n: Identifier): number { Debug.assert(!nodeIsSynthesized(n)); @@ -11953,6 +11995,7 @@ module ts { resolvesToSomeValue, collectLinkedAliases, getBlockScopedVariableId, + getReferencedValueDeclaration, serializeTypeOfNode, serializeParameterTypesOfNode, serializeReturnTypeOfNode, @@ -12117,7 +12160,7 @@ module ts { // public // error at public // public.private.package // error at public // B.private.B // no error - function checkGrammarHeritageClauseElementInStrictMode(expression: Expression) { + function checkGrammarExpressionWithTypeArgumentsInStrictMode(expression: Expression) { // Example: // class C extends public // error at public if (expression && expression.kind === SyntaxKind.Identifier) { @@ -12128,7 +12171,7 @@ module ts { // in PropertyAccessExpression. According to grammar production of MemberExpression, // the left component expression is a PrimaryExpression (i.e. Identifier) while the other // component after dots can be IdentifierName. - checkGrammarHeritageClauseElementInStrictMode((expression).expression); + checkGrammarExpressionWithTypeArgumentsInStrictMode((expression).expression); } } @@ -12837,7 +12880,7 @@ module ts { function checkGrammarBindingElement(node: BindingElement) { if (node.dotDotDotToken) { let elements = (node.parent).elements; - if (node !== elements[elements.length - 1]) { + if (node !== lastOrUndefined(elements)) { return grammarErrorOnNode(node, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 47f0594a76e..6a055aebf6a 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -30,6 +30,14 @@ module ts { type: "boolean", description: Diagnostics.Print_this_message, }, + { + name: "inlineSourceMap", + type: "boolean", + }, + { + name: "inlineSources", + type: "boolean", + }, { name: "listFiles", type: "boolean", @@ -50,17 +58,33 @@ module ts { shortName: "m", type: { "commonjs": ModuleKind.CommonJS, - "amd": ModuleKind.AMD + "amd": ModuleKind.AMD, + "system": ModuleKind.System, + "umd": ModuleKind.UMD, }, - description: Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, + description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd, paramType: Diagnostics.KIND, - error: Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd + error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd + }, + { + name: "newLine", + type: { + "crlf": NewLineKind.CarriageReturnLineFeed, + "lf": NewLineKind.LineFeed + }, + description: Diagnostics.Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + paramType: Diagnostics.NEWLINE, + error: Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF }, { name: "noEmit", type: "boolean", description: Diagnostics.Do_not_emit_outputs, }, + { + name: "noEmitHelpers", + type: "boolean" + }, { name: "noEmitOnError", type: "boolean", @@ -150,7 +174,7 @@ module ts { type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 }, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: Diagnostics.VERSION, - error: Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 + error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 }, { name: "version", @@ -284,12 +308,27 @@ module ts { * Read tsconfig.json file * @param fileName The path to the config file */ - export function readConfigFile(fileName: string): any { + export function readConfigFile(fileName: string): { config?: any; error?: Diagnostic } { try { var text = sys.readFile(fileName); - return /\S/.test(text) ? JSON.parse(text) : {}; } catch (e) { + return { error: createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; + } + return parseConfigFileText(fileName, text); + } + + /** + * Parse the text of the tsconfig.json file + * @param fileName The path to the config file + * @param jsonText The text of the config file + */ + export function parseConfigFileText(fileName: string, jsonText: string): { config?: any; error?: Diagnostic } { + try { + return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} }; + } + catch (e) { + return { error: createCompilerDiagnostic(Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; } } @@ -299,7 +338,7 @@ module ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine { + export function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine { var errors: Diagnostic[] = []; return { @@ -358,7 +397,7 @@ module ts { } } else { - var sysFiles = sys.readDirectory(basePath, ".ts"); + var sysFiles = host.readDirectory(basePath, ".ts"); for (var i = 0; i < sysFiles.length; i++) { var name = sysFiles[i]; if (!fileExtensionIs(name, ".d.ts") || !contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 6383108b0d6..9b987ba77c6 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -470,7 +470,7 @@ module ts { let normalized: string[] = []; for (let part of parts) { if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + if (part === ".." && normalized.length > 0 && lastOrUndefined(normalized) !== "..") { normalized.pop(); } else { @@ -586,7 +586,7 @@ module ts { export function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: (fileName: string) => string, isAbsolutePathAnUrl: boolean) { let pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); let directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.length--; diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 2fb7ad6d93a..5c705f18190 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -37,10 +37,6 @@ module ts { return diagnostics; } - export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { - return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); - } - function emitDeclarations(host: EmitHost, resolver: EmitResolver, diagnostics: Diagnostic[], jsFilePath: string, root?: SourceFile): DeclarationEmit { let newLine = host.getNewLine(); let compilerOptions = host.getCompilerOptions(); @@ -333,8 +329,8 @@ module ts { case SyntaxKind.VoidKeyword: case SyntaxKind.StringLiteral: return writeTextOfNode(currentSourceFile, type); - case SyntaxKind.HeritageClauseElement: - return emitHeritageClauseElement(type); + case SyntaxKind.ExpressionWithTypeArguments: + return emitExpressionWithTypeArguments(type); case SyntaxKind.TypeReference: return emitTypeReference(type); case SyntaxKind.TypeQuery: @@ -380,8 +376,8 @@ module ts { } } - function emitHeritageClauseElement(node: HeritageClauseElement) { - if (isSupportedHeritageClauseElement(node)) { + function emitExpressionWithTypeArguments(node: ExpressionWithTypeArguments) { + if (isSupportedExpressionWithTypeArguments(node)) { Debug.assert(node.expression.kind === SyntaxKind.Identifier || node.expression.kind === SyntaxKind.PropertyAccessExpression); emitEntityName(node.expression); if (node.typeArguments) { @@ -865,14 +861,14 @@ module ts { } } - function emitHeritageClause(typeReferences: HeritageClauseElement[], isImplementsList: boolean) { + function emitHeritageClause(typeReferences: ExpressionWithTypeArguments[], isImplementsList: boolean) { if (typeReferences) { write(isImplementsList ? " implements " : " extends "); emitCommaList(typeReferences, emitTypeOfTypeReference); } - function emitTypeOfTypeReference(node: HeritageClauseElement) { - if (isSupportedHeritageClauseElement(node)) { + function emitTypeOfTypeReference(node: ExpressionWithTypeArguments) { + if (isSupportedExpressionWithTypeArguments(node)) { emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 90f0ed0a0df..1f8edf8fee3 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -46,7 +46,7 @@ module ts { A_get_accessor_cannot_have_parameters: { code: 1054, category: DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: 1061, category: DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, + An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, @@ -107,8 +107,8 @@ module ts { or_expected: { code: 1144, category: DiagnosticCategory.Error, key: "'{' or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: 1146, category: DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in a namespace cannot reference a module." }, + Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile modules unless the '--module' flag is provided." }, File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: DiagnosticCategory.Error, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, var_let_or_const_expected: { code: 1152, category: DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, @@ -150,9 +150,9 @@ module ts { The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, An_import_declaration_cannot_have_modifiers: { code: 1191, category: DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export: { code: 1192, category: DiagnosticCategory.Error, key: "External module '{0}' has no default export." }, + Module_0_has_no_default_export: { code: 1192, category: DiagnosticCategory.Error, key: "Module '{0}' has no default export." }, An_export_declaration_cannot_have_modifiers: { code: 1193, category: DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: DiagnosticCategory.Error, key: "Export declarations are not permitted in an internal module." }, + Export_declarations_are_not_permitted_in_a_namespace: { code: 1194, category: DiagnosticCategory.Error, key: "Export declarations are not permitted in a namespace." }, Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." }, Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." }, Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, @@ -161,28 +161,27 @@ module ts { Line_terminator_not_permitted_before_arrow: { code: 1200, category: DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, - Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, + Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." }, Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." }, Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, - Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." }, + Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." }, Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, + Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, Circular_definition_of_import_alias_0: { code: 2303, category: DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, Cannot_find_name_0: { code: 2304, category: DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, Module_0_has_no_exported_member_1: { code: 2305, category: DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + File_0_is_not_a_module: { code: 2306, category: DiagnosticCategory.Error, key: "File '{0}' is not a module." }, + Cannot_find_module_0: { code: 2307, category: DiagnosticCategory.Error, key: "Cannot find module '{0}'." }, A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, @@ -205,7 +204,7 @@ module ts { Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_module_or_namespace_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module or namespace body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, @@ -297,15 +296,15 @@ module ts { Interface_0_incorrectly_extends_interface_1: { code: 2430, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: DiagnosticCategory.Error, key: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: DiagnosticCategory.Error, key: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_modules_cannot_be_nested_in_other_modules: { code: 2435, category: DiagnosticCategory.Error, key: "Ambient modules cannot be nested in other modules." }, + Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: DiagnosticCategory.Error, key: "Ambient module declaration cannot specify relative module name." }, Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, Import_name_cannot_be_0: { code: 2438, category: DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, @@ -359,11 +358,13 @@ module ts { Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, - External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, - External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, + Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "Module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "Module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." }, + Cannot_find_namespace_0: { code: 2503, category: DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "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: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -439,6 +440,7 @@ module ts { Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.Error, key: "Unsupported file encoding." }, + Failed_to_parse_file_0_Colon_1: { code: 5014, category: DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." }, Unknown_compiler_option_0: { code: 5023, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." }, Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, @@ -452,6 +454,10 @@ module ts { Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." }, Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." }, Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, + Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." }, + Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." }, + Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, Concatenate_and_emit_output_to_single_file: { code: 6001, category: DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, @@ -463,7 +469,7 @@ module ts { Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." }, Do_not_emit_outputs: { code: 6010, category: DiagnosticCategory.Message, key: "Do not emit outputs." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" }, Print_this_message: { code: 6017, category: DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: DiagnosticCategory.Message, key: "Print the compiler's version." }, Compile_the_project_in_the_given_directory: { code: 6020, category: DiagnosticCategory.Message, key: "Compile the project in the given directory." }, @@ -484,8 +490,8 @@ module ts { Generates_corresponding_map_file: { code: 6043, category: DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." }, + Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, @@ -498,6 +504,9 @@ module ts { Preserve_new_lines_when_emitting_code: { code: 6057, category: DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, + Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." }, + NEWLINE: { code: 6061, category: DiagnosticCategory.Message, key: "NEWLINE" }, + Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -510,7 +519,6 @@ module ts { Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, _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: { code: 7023, category: DiagnosticCategory.Error, key: "'{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." }, Function_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: { code: 7024, category: DiagnosticCategory.Error, key: "Function 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." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 48ef245c766..42eae83e269 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -171,7 +171,7 @@ "category": "Error", "code": 1061 }, - "An export assignment cannot be used in an internal module.": { + "An export assignment cannot be used in a namespace.": { "category": "Error", "code": 1063 }, @@ -415,11 +415,11 @@ "category": "Error", "code": 1146 }, - "Import declarations in an internal module cannot reference an external module.": { + "Import declarations in a namespace cannot reference a module.": { "category": "Error", "code": 1147 }, - "Cannot compile external modules unless the '--module' flag is provided.": { + "Cannot compile modules unless the '--module' flag is provided.": { "category": "Error", "code": 1148 }, @@ -587,7 +587,7 @@ "category": "Error", "code": 1191 }, - "External module '{0}' has no default export.": { + "Module '{0}' has no default export.": { "category": "Error", "code": 1192 }, @@ -595,7 +595,7 @@ "category": "Error", "code": 1193 }, - "Export declarations are not permitted in an internal module.": { + "Export declarations are not permitted in a namespace.": { "category": "Error", "code": 1194 }, @@ -631,7 +631,7 @@ "category": "Error", "code": 1203 }, - "Cannot compile external modules into amd or commonjs when targeting es6 or higher.": { + "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher.": { "category": "Error", "code": 1204 }, @@ -647,7 +647,7 @@ "category": "Error", "code": 1207 }, - "Cannot compile non-external modules when the '--separateCompilation' flag is provided.": { + "Cannot compile namespaces when the '--separateCompilation' flag is provided.": { "category": "Error", "code": 1208 }, @@ -671,10 +671,6 @@ "category": "Error", "code": 1213 }, - "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode.": { - "category": "Error", - "code": 1214 - }, "Type expected. '{0}' is a reserved word in strict mode": { "category": "Error", "code": 1215 @@ -683,10 +679,11 @@ "category": "Error", "code": 1216 }, - "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode.": { + "Export assignment is not supported when '--module' flag is 'system'.": { "category": "Error", - "code": 1217 + "code": 1218 }, + "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 @@ -711,11 +708,11 @@ "category": "Error", "code": 2305 }, - "File '{0}' is not an external module.": { + "File '{0}' is not a module.": { "category": "Error", "code": 2306 }, - "Cannot find external module '{0}'.": { + "Cannot find module '{0}'.": { "category": "Error", "code": 2307 }, @@ -807,7 +804,7 @@ "category": "Error", "code": 2330 }, - "'this' cannot be referenced in a module body.": { + "'this' cannot be referenced in a module or namespace body.": { "category": "Error", "code": 2331 }, @@ -1175,19 +1172,19 @@ "category": "Error", "code": 2432 }, - "A module declaration cannot be in a different file from a class or function with which it is merged": { + "A namespace declaration cannot be in a different file from a class or function with which it is merged": { "category": "Error", "code": 2433 }, - "A module declaration cannot be located prior to a class or function with which it is merged": { + "A namespace declaration cannot be located prior to a class or function with which it is merged": { "category": "Error", "code": 2434 }, - "Ambient external modules cannot be nested in other modules.": { + "Ambient modules cannot be nested in other modules.": { "category": "Error", "code": 2435 }, - "Ambient external module declaration cannot specify relative module name.": { + "Ambient module declaration cannot specify relative module name.": { "category": "Error", "code": 2436 }, @@ -1199,7 +1196,7 @@ "category": "Error", "code": 2438 }, - "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name.": { + "Import or export declaration in an ambient module declaration cannot reference module through relative module name.": { "category": "Error", "code": 2439 }, @@ -1207,7 +1204,7 @@ "category": "Error", "code": 2440 }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { + "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module.": { "category": "Error", "code": 2441 }, @@ -1423,11 +1420,11 @@ "category": "Error", "code": 2496 }, - "External module '{0}' resolves to a non-module entity and cannot be imported using this construct.": { + "Module '{0}' resolves to a non-module entity and cannot be imported using this construct.": { "category": "Error", "code": 2497 }, - "External module '{0}' uses 'export =' and cannot be used with 'export *'.": { + "Module '{0}' uses 'export =' and cannot be used with 'export *'.": { "category": "Error", "code": 2498 }, @@ -1443,6 +1440,14 @@ "category": "Error", "code": 2501 }, + "'{0}' is referenced directly or indirectly in its own type annotation.": { + "category": "Error", + "code": 2502 + }, + "Cannot find namespace '{0}'.": { + "category": "Error", + "code": 2503 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -1744,6 +1749,10 @@ "category": "Error", "code": 5013 }, + "Failed to parse file '{0}': {1}.": { + "category": "Error", + "code": 5014 + }, "Unknown compiler option '{0}'.": { "category": "Error", "code": 5023 @@ -1796,6 +1805,23 @@ "category": "Error", "code": 5047 }, + "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.": { + "category": "Error", + "code": 5048 + }, + "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.": { + "category": "Error", + "code": 5049 + }, + "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.": { + "category": "Error", + "code": 5050 + }, + "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.": { + "category": "Error", + "code": 5051 + }, + "Concatenate and emit output to single file.": { "category": "Message", "code": 6001 @@ -1840,7 +1866,7 @@ "category": "Message", "code": 6015 }, - "Specify module code generation: 'commonjs' or 'amd'": { + "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'": { "category": "Message", "code": 6016 }, @@ -1924,11 +1950,11 @@ "category": "Error", "code": 6045 }, - "Argument for '--module' option must be 'commonjs' or 'amd'.": { + "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'.": { "category": "Error", "code": 6046 }, - "Argument for '--target' option must be 'es3', 'es5', or 'es6'.": { + "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'.": { "category": "Error", "code": 6047 }, @@ -1980,6 +2006,18 @@ "category": "Error", "code": 6059 }, + "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).": { + "category": "Message", + "code": 6060 + }, + "NEWLINE": { + "category": "Message", + "code": 6061 + }, + "Argument for '--newLine' option must be 'CRLF' or 'LF'.": { + "category": "Error", + "code": 6062 + }, "Variable '{0}' implicitly has an '{1}' type.": { @@ -2030,10 +2068,6 @@ "category": "Error", "code": 7020 }, - "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.": { - "category": "Error", - "code": 7021 - }, "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer.": { "category": "Error", "code": 7022 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 62af6dedf02..6d5146a6801 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3,6 +3,10 @@ /* @internal */ module ts { + export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { + return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); + } + // Flags enum to track count of temp variables and a few dedicated names const enum TempFlags { Auto = 0x00000000, // No preferred name @@ -14,7 +18,7 @@ module ts { export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult { // emit output for the __extends helper function const extendsHelper = ` -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -23,7 +27,7 @@ var __extends = this.__extends || function (d, b) { // emit output for the __decorate helper function const decorateHelper = ` -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -34,19 +38,19 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target, // emit output for the __metadata helper function const metadataHelper = ` -if (typeof __metadata !== "function") __metadata = function (k, v) { +var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); };`; // emit output for the __param helper function const paramHelper = ` -if (typeof __param !== "function") __param = function (paramIndex, decorator) { +var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } };`; let compilerOptions = host.getCompilerOptions(); let languageVersion = compilerOptions.target || ScriptTarget.ES3; - let sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined; + let sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; let diagnostics: Diagnostic[] = []; let newLine = host.getNewLine(); @@ -111,6 +115,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { let decreaseIndent = writer.decreaseIndent; let currentSourceFile: SourceFile; + // name of an exporter function if file is a System external module + // System.register([...], function () {...}) + // exporting in System modules looks like: + // export var x; ... x = 1 + // => + // var x;... exporter("x", x = 1) + let exportFunctionForFile: string; let generatedNameSet: Map = {}; let nodeToGeneratedName: string[] = []; @@ -135,7 +146,8 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { let writeComment = writeCommentRange; - let emitSourceFileStart = (node: Node) => { } + /** Emit a node */ + let emit = emitNodeWithoutSourceMap; /** Called just before starting emit of a node */ let emitStart = function (node: Node) { }; @@ -162,7 +174,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { /** Sourcemap data that will get encoded */ let sourceMapData: SourceMapData; - if (compilerOptions.sourceMap) { + if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { initializeEmitterWithSourceMaps(); } @@ -184,6 +196,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { function emitSourceFile(sourceFile: SourceFile): void { currentSourceFile = sourceFile; + exportFunctionForFile = undefined; emit(sourceFile); } @@ -323,7 +336,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { let sourceMapNameIndexMap: Map = {}; let sourceMapNameIndices: number[] = []; function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + return sourceMapNameIndices.length ? lastOrUndefined(sourceMapNameIndices) : -1; } // Last recorded and encoded spans @@ -486,6 +499,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // The one that can be used from program to get the actual source file sourceMapData.inputSourceFileNames.push(node.fileName); + + if (compilerOptions.inlineSources) { + if (!sourceMapData.sourceMapSourcesContent) { + sourceMapData.sourceMapSourcesContent = []; + } + sourceMapData.sourceMapSourcesContent.push(node.text); + } } function recordScopeNameOfNode(node: Node, scopeName?: string) { @@ -557,19 +577,25 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { recordSourceMapSpan(comment.end); } - function serializeSourceMapContents(version: number, file: string, sourceRoot: string, sources: string[], names: string[], mappings: string) { + function serializeSourceMapContents(version: number, file: string, sourceRoot: string, sources: string[], names: string[], mappings: string, sourcesContent?: string[]) { if (typeof JSON !== "undefined") { - return JSON.stringify({ - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }); + let map: any = { + version, + file, + sourceRoot, + sources, + names, + mappings + }; + + if (sourcesContent !== undefined) { + map.sourcesContent = sourcesContent; + } + + return JSON.stringify(map); } - return "{\"version\":" + version + ",\"file\":\"" + escapeString(file) + "\",\"sourceRoot\":\"" + escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + escapeString(mappings) + "\"}"; + return "{\"version\":" + version + ",\"file\":\"" + escapeString(file) + "\",\"sourceRoot\":\"" + escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; function serializeStringArray(list: string[]): string { let output = ""; @@ -584,19 +610,33 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } function writeJavaScriptAndSourceMapFile(emitOutput: string, writeByteOrderMark: boolean) { - // Write source map file encodeLastRecordedSourceMapSpan(); - writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents( + + let sourceMapText = serializeSourceMapContents( 3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, - sourceMapData.sourceMapMappings), /*writeByteOrderMark*/ false); + sourceMapData.sourceMapMappings, + sourceMapData.sourceMapSourcesContent); + sourceMapDataList.push(sourceMapData); + let sourceMapUrl: string; + if (compilerOptions.inlineSourceMap) { + // Encode the sourceMap into the sourceMap url + let base64SourceMapText = convertToBase64(sourceMapText); + sourceMapUrl = `//# sourceMappingURL=data:application/json;base64,${base64SourceMapText}`; + } + else { + // Write source map file + writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, /*writeByteOrderMark*/ false); + sourceMapUrl = `//# sourceMappingURL=${sourceMapData.jsSourceMappingURL}`; + } + // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); + writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); } // Initialize source map data @@ -610,6 +650,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { inputSourceFileNames: [], sourceMapNames: [], sourceMapMappings: "", + sourceMapSourcesContent: undefined, sourceMapDecodedMappings: [] }; @@ -646,8 +687,25 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { sourceMapDir = getDirectoryPath(normalizePath(jsFilePath)); } + function emitNodeWithSourceMap(node: Node, allowGeneratedIdentifiers?: boolean) { + if (node) { + if (nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node, /*allowGeneratedIdentifiers*/ false); + } + if (node.kind != SyntaxKind.SourceFile) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); + recordEmitNodeEndSpan(node); + } + else { + recordNewSourceFileStart(node); + emitNodeWithoutSourceMap(node, /*allowGeneratedIdentifiers*/ false); + } + } + } + writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emitSourceFileStart = recordNewSourceFileStart + emit = emitNodeWithSourceMap; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -837,7 +895,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { function emitLiteral(node: LiteralExpression) { let text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) { + if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } // For versions below ES6, emit binary & octal literals in their canonical decimal form. @@ -1113,7 +1171,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - + let generatedName = computedPropertyNamesToGeneratedNames[getNodeId(node)]; if (generatedName) { // we have already generated a variable for this node, write that value instead. @@ -1262,7 +1320,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { function emitBindingElement(node: BindingElement) { if (node.propertyName) { - emitVerbatimDeclarationName(node.propertyName); + emit(node.propertyName, /*allowGeneratedIdentifiers*/ false); write(": "); } if (node.dotDotDotToken) { @@ -1610,7 +1668,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { write("*"); } - emitVerbatimDeclarationName(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); if (languageVersion < ScriptTarget.ES6) { write(": function "); } @@ -1618,13 +1676,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } function emitPropertyAssignment(node: PropertyDeclaration) { - emitVerbatimDeclarationName(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node: ShorthandPropertyAssignment) { - emitVerbatimDeclarationName(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment. For example: // module m { // export let y; @@ -1704,7 +1762,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { let indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); let indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emitVerbatimDeclarationName(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } @@ -1900,7 +1958,35 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emit(node.expression); } + function isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node: Node): boolean { + if (!isCurrentFileSystemExternalModule() || node.kind !== SyntaxKind.Identifier || nodeIsSynthesized(node)) { + return false; + } + + const isVariableDeclarationOrBindingElement = + node.parent && (node.parent.kind === SyntaxKind.VariableDeclaration || node.parent.kind === SyntaxKind.BindingElement); + + const targetDeclaration = + isVariableDeclarationOrBindingElement + ? node.parent + : resolver.getReferencedValueDeclaration(node); + + return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, /*isExported*/ true); + } + function emitPrefixUnaryExpression(node: PrefixUnaryExpression) { + const exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + + if (exportChanged) { + // emit + // ++x + // as + // exports('x', ++x) + write(`${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(node.operand); + write(`", `); + } + write(tokenToString(node.operator)); // In some cases, we need to emit a space between the operator and the operand. One obvious case // is when the operator is an identifier, like delete or typeof. We also need to do this for plus @@ -1924,11 +2010,69 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } } emit(node.operand); + + if (exportChanged) { + write(")"); + } } function emitPostfixUnaryExpression(node: PostfixUnaryExpression) { - emit(node.operand); - write(tokenToString(node.operator)); + const exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); + if (exportChanged) { + // export function returns the value that was passes as the second argument + // however for postfix unary expressions result value should be the value before modification. + // emit 'x++' as '(export('x', ++x) - 1)' and 'x--' as '(export('x', --x) + 1)' + write(`(${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(node.operand); + write(`", `); + + write(tokenToString(node.operator)); + emit(node.operand); + + if (node.operator === SyntaxKind.PlusPlusToken) { + write(") - 1)"); + } + else { + write(") + 1)"); + } + } + else { + emit(node.operand); + write(tokenToString(node.operator)); + } + } + + function shouldHoistDeclarationInSystemJsModule(node: Node): boolean { + return isSourceFileLevelDeclarationInSystemJsModule(node, /*isExported*/ false); + } + + /* + * Checks if given node is a source file level declaration (not nested in module/function). + * If 'isExported' is true - then declaration must also be exported. + * This function is used in two cases: + * - check if node is a exported source file level value to determine + * if we should also export the value after its it changed + * - check if node is a source level declaration to emit it differently, + * i.e non-exported variable statement 'var x = 1' is hoisted so + * we we emit variable statement 'var' should be dropped. + */ + function isSourceFileLevelDeclarationInSystemJsModule(node: Node, isExported: boolean): boolean { + if (!node || languageVersion >= ScriptTarget.ES6 || !isCurrentFileSystemExternalModule()) { + return false; + } + + let current: Node = node; + while (current) { + if (current.kind === SyntaxKind.SourceFile) { + return !isExported || ((getCombinedNodeFlags(node) & NodeFlags.Export) !== 0) + } + else if (isFunctionLike(current) || current.kind === SyntaxKind.ModuleBlock) { + return false; + } + else { + current = current.parent; + } + } } function emitBinaryExpression(node: BinaryExpression) { @@ -1937,12 +2081,26 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitDestructuring(node, node.parent.kind === SyntaxKind.ExpressionStatement); } else { + const exportChanged = + node.operatorToken.kind >= SyntaxKind.FirstAssignment && + node.operatorToken.kind <= SyntaxKind.LastAssignment && + isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.left); + + if (exportChanged) { + // emit assignment 'x y' as 'exports("x", x y)' + write(`${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(node.left); + write(`", `); + } emit(node.left); let indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== SyntaxKind.CommaToken ? " " : undefined); write(tokenToString(node.operatorToken.kind)); let indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); + if (exportChanged) { + write(")"); + } } } @@ -2068,7 +2226,16 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitEmbeddedStatement(node.statement); } - function emitStartOfVariableDeclarationList(decl: Node, startPos?: number): void { + /* Returns true if start of variable declaration list was emitted. + * Return false if nothing was written - this can happen for source file level variable declarations + * in system modules - such variable declarations are hoisted. + */ + function tryEmitStartOfVariableDeclarationList(decl: VariableDeclarationList, startPos?: number): boolean { + if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { + // variables in variable declaration list were already hoisted + return false; + } + let tokenKind = SyntaxKind.VarKeyword; if (decl && languageVersion >= ScriptTarget.ES6) { if (isLet(decl)) { @@ -2081,17 +2248,43 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (startPos !== undefined) { emitToken(tokenKind, startPos); + write(" ") } else { switch (tokenKind) { case SyntaxKind.VarKeyword: - return write("var "); + write("var "); + break; case SyntaxKind.LetKeyword: - return write("let "); + write("let "); + break; case SyntaxKind.ConstKeyword: - return write("const "); + write("const "); + break; } } + + return true; + } + + function emitVariableDeclarationListSkippingUninitializedEntries(list: VariableDeclarationList): boolean { + let started = false; + for (let decl of list.declarations) { + if (!decl.initializer) { + continue; + } + + if (!started) { + started = true; + } + else { + write(", "); + } + + emit(decl); + } + + return started; } function emitForStatement(node: ForStatement) { @@ -2100,10 +2293,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { endPos = emitToken(SyntaxKind.OpenParenToken, endPos); if (node.initializer && node.initializer.kind === SyntaxKind.VariableDeclarationList) { let variableDeclarationList = node.initializer; - let declarations = variableDeclarationList.declarations; - emitStartOfVariableDeclarationList(declarations[0], endPos); - write(" "); - emitCommaList(declarations); + let startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + if (startIsEmitted) { + emitCommaList(variableDeclarationList.declarations); + } + else { + emitVariableDeclarationListSkippingUninitializedEntries(variableDeclarationList); + } } else if (node.initializer) { emit(node.initializer); @@ -2111,7 +2307,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { write(";"); emitOptional(" ", node.condition); write(";"); - emitOptional(" ", node.iterator); + emitOptional(" ", node.incrementor); write(")"); emitEmbeddedStatement(node.statement); } @@ -2127,10 +2323,8 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { let variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - let decl = variableDeclarationList.declarations[0]; - emitStartOfVariableDeclarationList(decl, endPos); - write(" "); - emit(decl); + tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + emit(variableDeclarationList.declarations[0]); } } else { @@ -2193,7 +2387,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { write("var "); // _i = 0 - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); @@ -2201,9 +2395,9 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // , _a = expr write(", "); emitStart(node.expression); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(" = "); - emitWithoutSourceMap(node.expression); + emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } @@ -2211,10 +2405,10 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // _i < _a.length; emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write(" < "); - emitWithoutSourceMap(rhsReference); + emitNodeWithoutSourceMap(rhsReference); write(".length"); emitEnd(node.initializer); @@ -2222,7 +2416,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // _i++) emitStart(node.initializer); - emitWithoutSourceMap(counter); + emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); emitToken(SyntaxKind.CloseParenToken, node.expression.end); @@ -2249,17 +2443,17 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { else { // The following call does not include the initializer, so we have // to emit it separately. - emitWithoutSourceMap(declaration); + emitNodeWithoutSourceMap(declaration); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { // It's an empty declaration list. This can only happen in an error case, if the user wrote // for (let of []) {} - emitWithoutSourceMap(createTempVariable(TempFlags.Auto)); + emitNodeWithoutSourceMap(createTempVariable(TempFlags.Auto)); write(" = "); - emitWithoutSourceMap(rhsIterationValue); + emitNodeWithoutSourceMap(rhsIterationValue); } } else { @@ -2272,7 +2466,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined); } else { - emitWithoutSourceMap(assignmentExpression); + emitNodeWithoutSourceMap(assignmentExpression); } } emitEnd(node.initializer); @@ -2424,11 +2618,11 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < ScriptTarget.ES6) { + else if (languageVersion < ScriptTarget.ES6 && compilerOptions.module !== ModuleKind.System) { write("exports."); } } - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } @@ -2444,18 +2638,35 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (node.flags & NodeFlags.Export) { writeLine(); emitStart(node); - if (node.flags & NodeFlags.Default) { - if (languageVersion === ScriptTarget.ES3) { - write("exports[\"default\"]"); - } else { - write("exports.default"); + + if (compilerOptions.module === ModuleKind.System) { + // emit export default as + // export("default", ) + write(`${exportFunctionForFile}("`); + if (node.flags & NodeFlags.Default) { + write("default"); } + else { + emitNodeWithoutSourceMap(node.name); + } + write(`", `); + emitDeclarationName(node); + write(")") } else { - emitModuleMemberName(node); + if (node.flags & NodeFlags.Default) { + if (languageVersion === ScriptTarget.ES3) { + write("exports[\"default\"]"); + } else { + write("exports.default"); + } + } + else { + emitModuleMemberName(node); + } + write(" = "); + emitDeclarationName(node); } - write(" = "); - emitNameOfDeclaration(node); emitEnd(node); write(";"); } @@ -2465,13 +2676,24 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (!exportEquals && exportSpecifiers && hasProperty(exportSpecifiers, name.text)) { for (let specifier of exportSpecifiers[name.text]) { writeLine(); - emitStart(specifier.name); - emitContainingModuleName(specifier); - write("."); - emitWithoutSourceMap(specifier.name); - emitEnd(specifier.name); - write(" = "); - emitExpressionIdentifier(name); + if (compilerOptions.module === ModuleKind.System) { + emitStart(specifier.name); + write(`${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(specifier.name); + write(`", `); + emitExpressionIdentifier(name); + write(")") + emitEnd(specifier.name); + } + else { + emitStart(specifier.name); + emitContainingModuleName(specifier); + write("."); + emitNodeWithoutSourceMap(specifier.name); + emitEnd(specifier.name); + write(" = "); + emitExpressionIdentifier(name); + } write(";"); } } @@ -2479,9 +2701,21 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; + // An exported declaration is actually emitted as an assignment (to a property on the module object), so // temporary variables in an exported declaration need to have real declarations elsewhere - let isDeclaration = (root.kind === SyntaxKind.VariableDeclaration && !(getCombinedNodeFlags(root) & NodeFlags.Export)) || root.kind === SyntaxKind.Parameter; + // Also temporary variables should be explicitly allocated for source level declarations when module target is system + // because actual variable declarations are hoisted + let canDefineTempVariablesInPlace = false; + if (root.kind === SyntaxKind.VariableDeclaration) { + let isExported = getCombinedNodeFlags(root) & NodeFlags.Export; + let isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); + canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; + } + else if (root.kind === SyntaxKind.Parameter) { + canDefineTempVariablesInPlace = true; + } + if (root.kind === SyntaxKind.BinaryExpression) { emitAssignmentExpression(root); } @@ -2496,20 +2730,37 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement)) { + + const isVariableDeclarationOrBindingElement = + name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); + + let exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); + + if (exportChanged) { + write(`${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(name); + write(`", `); + } + + if (isVariableDeclarationOrBindingElement) { emitModuleMemberName(name.parent); } else { emit(name); } + write(" = "); emit(value); + + if (exportChanged) { + write(")"); + } } function ensureIdentifier(expr: Expression): Expression { if (expr.kind !== SyntaxKind.Identifier) { let identifier = createTempVariable(TempFlags.Auto); - if (!isDeclaration) { + if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -2689,7 +2940,6 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } else { renameNonTopLevelLetAndConst(node.name); - emitModuleMemberName(node); let initializer = node.initializer; if (!initializer && languageVersion < ScriptTarget.ES6) { @@ -2712,7 +2962,20 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } } + let exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.name); + + if (exportChanged) { + write(`${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(node.name); + write(`", `); + } + + emitModuleMemberName(node); emitOptional(" = ", initializer); + + if (exportChanged) { + write(")") + } } } @@ -2792,16 +3055,25 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } function emitVariableStatement(node: VariableStatement) { + let startIsEmitted = true; if (!(node.flags & NodeFlags.Export)) { - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { // Exported ES6 module member write("export "); - emitStartOfVariableDeclarationList(node.declarationList); + startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); + } + if (startIsEmitted) { + emitCommaList(node.declarationList.declarations); + write(";"); + } + else { + let atLeastOneItem = emitVariableDeclarationListSkippingUninitializedEntries(node.declarationList); + if (atLeastOneItem) { + write(";"); + } } - emitCommaList(node.declarationList.declarations); - write(";"); if (languageVersion < ScriptTarget.ES6 && node.parent === currentSourceFile) { forEach(node.declarationList.declarations, emitExportVariableAssignments); } @@ -2851,14 +3123,14 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { writeLine(); emitStart(p); write("if ("); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitWithoutSourceMap(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitWithoutSourceMap(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -2881,7 +3153,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -2902,7 +3174,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { increaseIndent(); writeLine(); emitStart(restParam); - emitWithoutSourceMap(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -2913,7 +3185,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { function emitAccessor(node: AccessorDeclaration) { write(node.kind === SyntaxKind.GetAccessor ? "get " : "set "); - emitVerbatimDeclarationName(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); emitSignatureAndBody(node); } @@ -2921,9 +3193,9 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { return node.kind === SyntaxKind.ArrowFunction && languageVersion >= ScriptTarget.ES6; } - function emitNameOfDeclaration(node: Declaration) { + function emitDeclarationName(node: Declaration) { if (node.name) { - emitWithoutSourceMap(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(getGeneratedNameForNode(node)); @@ -2946,6 +3218,11 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { return emitOnlyPinnedOrTripleSlashComments(node); } + if (node.kind !== SyntaxKind.MethodDeclaration && node.kind !== SyntaxKind.MethodSignature) { + // Methods will emit the comments as part of emitting method declaration + emitLeadingComments(node); + } + // For targeting below es6, emit functions-like declaration including arrow function using function keyword. // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead if (!shouldEmitAsArrowFunction(node)) { @@ -2964,13 +3241,16 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } if (shouldEmitFunctionName(node)) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } emitSignatureAndBody(node); if (languageVersion < ScriptTarget.ES6 && node.kind === SyntaxKind.FunctionDeclaration && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments((node).name); } + if (node.kind !== SyntaxKind.MethodDeclaration && node.kind !== SyntaxKind.MethodSignature) { + emitTrailingComments(node); + } } function emitCaptureThisForNodeIfNecessary(node: Node): void { @@ -3175,7 +3455,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitStart(param); emitStart(param.name); write("this."); - emitWithoutSourceMap(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -3189,7 +3469,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here. if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { write("["); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } else if (memberName.kind === SyntaxKind.ComputedPropertyName) { @@ -3197,14 +3477,14 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } else { write("."); - emitWithoutSourceMap(memberName); + emitNodeWithoutSourceMap(memberName); } } - function getInitializedProperties(node: ClassLikeDeclaration, static: boolean) { + function getInitializedProperties(node: ClassLikeDeclaration, isStatic: boolean) { let properties: PropertyDeclaration[] = []; for (let member of node.members) { - if (member.kind === SyntaxKind.PropertyDeclaration && static === ((member.flags & NodeFlags.Static) !== 0) && (member).initializer) { + if (member.kind === SyntaxKind.PropertyDeclaration && isStatic === ((member.flags & NodeFlags.Static) !== 0) && (member).initializer) { properties.push(member); } } @@ -3228,7 +3508,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } else { if (property.flags & NodeFlags.Static) { - emitNameOfDeclaration(node); + emitDeclarationName(node); } else { write("this"); @@ -3356,7 +3636,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } } - function emitConstructor(node: ClassLikeDeclaration, baseTypeElement: HeritageClauseElement) { + function emitConstructor(node: ClassLikeDeclaration, baseTypeElement: ExpressionWithTypeArguments) { let saveTempFlags = tempFlags; let saveTempVariables = tempVariables; let saveTempParameters = tempParameters; @@ -3371,7 +3651,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { tempParameters = saveTempParameters; } - function emitConstructorWorker(node: ClassLikeDeclaration, baseTypeElement: HeritageClauseElement) { + function emitConstructorWorker(node: ClassLikeDeclaration, baseTypeElement: ExpressionWithTypeArguments) { // Check if we have property assignment inside class declaration. // If there is property assignment, we need to emit constructor whether users define it or not // If there is no property assignment, we can omit constructor if users do not define it @@ -3403,7 +3683,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (languageVersion < ScriptTarget.ES6) { write("function "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitSignatureParameters(ctor); } else { @@ -3559,7 +3839,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } write("let "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = "); } else if (isES6ExportedDeclaration(node)) { @@ -3598,7 +3878,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. if ((node.name || !(node.flags & NodeFlags.Default)) && !thisNodeIsDecorated) { write(" "); - emitNameOfDeclaration(node); + emitDeclarationName(node); } var baseTypeNode = getClassExtendsHeritageClauseElement(node); @@ -3618,6 +3898,8 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitToken(SyntaxKind.CloseBraceToken, node.members.end); scopeEmitEnd(); + // TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now. + // For a decorated class, we need to assign its name (if it has one). This is because we emit // the class as a class expression to avoid the double-binding of the identifier: // @@ -3627,15 +3909,6 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // if (thisNodeIsDecorated) { write(";"); - if (node.name) { - writeLine(); - write("Object.defineProperty("); - emitNameOfDeclaration(node); - write(", \"name\", { value: \""); - emitNameOfDeclaration(node); - write("\", configurable: true });"); - writeLine(); - } } // Emit static property assignment. Because classDeclaration is lexically evaluated, @@ -3669,7 +3942,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitStart(node); emitModuleMemberName(node); write(" = "); - emitNameOfDeclaration(node); + emitDeclarationName(node); emitEnd(node); write(";"); } @@ -3677,15 +3950,18 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // if this is a top level default export of decorated class, write the export after the declaration. writeLine(); write("export default "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(";"); } } function emitClassLikeDeclarationBelowES6(node: ClassLikeDeclaration) { if (node.kind === SyntaxKind.ClassDeclaration) { - write("var "); - emitNameOfDeclaration(node); + // source file level classes in system modules are hoisted so 'var's for them are already defined + if (!shouldHoistDeclarationInSystemJsModule(node)) { + write("var "); + } + emitDeclarationName(node); write(" = "); } @@ -3709,7 +3985,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { writeLine(); emitStart(baseTypeNode); write("__extends("); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(", _super);"); emitEnd(baseTypeNode); } @@ -3722,7 +3998,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { writeLine(); emitToken(SyntaxKind.CloseBraceToken, node.members.end, () => { write("return "); - emitNameOfDeclaration(node); + emitDeclarationName(node); }); write(";"); emitTempDeclarations(/*newLine*/ true); @@ -3755,7 +4031,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } function emitClassMemberPrefix(node: ClassLikeDeclaration, member: Node) { - emitNameOfDeclaration(node); + emitDeclarationName(node); if (!(member.flags & NodeFlags.Static)) { write(".prototype"); } @@ -3790,7 +4066,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { writeLine(); emitStart(node); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(" = __decorate(["); increaseIndent(); writeLine(); @@ -3808,7 +4084,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { decreaseIndent(); writeLine(); write("], "); - emitNameOfDeclaration(node); + emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); @@ -4194,13 +4470,14 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } + let hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); + let emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); - if (!isModuleMergedWithES6Class(node)) { + if (emitVarForModule) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); } - write("var "); emit(node.name); write(";"); @@ -4250,6 +4527,14 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { write(" = {}));"); emitEnd(node); if (!isES6ExportedDeclaration(node) && node.name.kind === SyntaxKind.Identifier && node.parent === currentSourceFile) { + if (compilerOptions.module === ModuleKind.System && (node.flags & NodeFlags.Export)) { + writeLine(); + write(`${exportFunctionForFile}("`); + emitDeclarationName(node); + write(`", `); + emitDeclarationName(node); + write(")"); + } emitExportMemberAssignments(node.name); } } @@ -4426,6 +4711,8 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } function emitExportDeclaration(node: ExportDeclaration) { + Debug.assert(compilerOptions.module !== ModuleKind.System); + if (languageVersion < ScriptTarget.ES6) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); @@ -4445,11 +4732,11 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitWithoutSourceMap(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); } @@ -4485,7 +4772,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } if (node.moduleSpecifier) { write(" from "); - emitWithoutSourceMap(node.moduleSpecifier); + emitNodeWithoutSourceMap(node.moduleSpecifier); } write(";"); emitEnd(node); @@ -4504,10 +4791,10 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } emitStart(specifier); if (specifier.propertyName) { - emitWithoutSourceMap(specifier.propertyName); + emitNodeWithoutSourceMap(specifier.propertyName); write(" as "); } - emitWithoutSourceMap(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier); needsComma = true; } @@ -4531,13 +4818,20 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { else { writeLine(); emitStart(node); - emitContainingModuleName(node); - if (languageVersion === ScriptTarget.ES3) { - write("[\"default\"] = "); - } else { - write(".default = "); + if (compilerOptions.module === ModuleKind.System) { + write(`${exportFunctionForFile}("default",`); + emit(node.expression); + write(")"); + } + else { + emitContainingModuleName(node); + if (languageVersion === ScriptTarget.ES3) { + write("[\"default\"] = "); + } else { + write(".default = "); + } + emit(node.expression); } - emit(node.expression); write(";"); emitEnd(node); } @@ -4610,27 +4904,553 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } } - function emitAMDModule(node: SourceFile, startIndex: number) { - collectExternalModuleInfo(node); + function getLocalNameForExternalImport(importNode: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration): string { + let namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + return getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + return getGeneratedNameForNode(importNode); + } + } + + function getExternalModuleNameText(importNode: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration): string { + let moduleName = getExternalModuleName(importNode); + if (moduleName.kind === SyntaxKind.StringLiteral) { + return getLiteralText(moduleName); + } + + return undefined; + } + + function emitVariableDeclarationsForImports(): void { + if (externalImports.length === 0) { + return; + } + + writeLine(); + let started = false; + for (let importNode of externalImports) { + // do not create variable declaration for exports and imports that lack import clause + let skipNode = + importNode.kind === SyntaxKind.ExportDeclaration || + (importNode.kind === SyntaxKind.ImportDeclaration && !(importNode).importClause) + + if (skipNode) { + continue; + } + + if (!started) { + write("var "); + started = true; + } + else { + write(", "); + } + + write(getLocalNameForExternalImport(importNode)); + } + + if (started) { + write(";"); + } + } + + function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations: (Identifier | Declaration)[]): string { + // when resolving exports local exported entries/indirect exported entries in the module + // should always win over entries with similar names that were added via star exports + // to support this we store names of local/indirect exported entries in a set. + // this set is used to filter names brought by star expors. + if (!hasExportStars) { + // local names set is needed only in presence of star exports + return undefined; + } + + // local names set should only be added if we have anything exported + if (!exportedDeclarations && isEmpty(exportSpecifiers)) { + // no exported declarations (export var ...) or export specifiers (export {x}) + // check if we have any non star export declarations. + let hasExportDeclarationWithExportClause = false; + for (let externalImport of externalImports) { + if (externalImport.kind === SyntaxKind.ExportDeclaration && (externalImport).exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + + if (!hasExportDeclarationWithExportClause) { + // we still need to emit exportStar helper + return emitExportStarFunction(/*localNames*/ undefined); + } + } + + const exportedNamesStorageRef = makeUniqueName("exportedNames"); + + writeLine(); + write(`var ${exportedNamesStorageRef} = {`); + increaseIndent(); + + let started = false; + if (exportedDeclarations) { + for (let i = 0; i < exportedDeclarations.length; ++i) { + // write name of exported declaration, i.e 'export var x...' + writeExportedName(exportedDeclarations[i]); + } + } + + if (exportSpecifiers) { + for (let n in exportSpecifiers) { + for (let specifier of exportSpecifiers[n]) { + // write name of export specified, i.e. 'export {x}' + writeExportedName(specifier.name); + } + } + } + + for (let externalImport of externalImports) { + if (externalImport.kind !== SyntaxKind.ExportDeclaration) { + continue; + } + + let exportDecl = externalImport; + if (!exportDecl.exportClause) { + // export * from ... + continue; + } + + for (let element of exportDecl.exportClause.elements) { + // write name of indirectly exported entry, i.e. 'export {x} from ...' + writeExportedName(element.name || element.propertyName); + } + } + + decreaseIndent(); + writeLine(); + write("};"); + + return emitExportStarFunction(exportedNamesStorageRef); + function emitExportStarFunction(localNames: string): string { + const exportStarFunction = makeUniqueName("exportStar"); + + writeLine(); + + // define an export star helper function + write(`function ${exportStarFunction}(m) {`); + increaseIndent(); + writeLine(); + write(`for(var n in m) {`); + increaseIndent(); + writeLine(); + write(`if (n !== "default"`); + if (localNames) { + write(`&& !${localNames}.hasOwnProperty(n)`); + } + write(`) ${exportFunctionForFile}(n, m[n]);`); + decreaseIndent(); + writeLine(); + write("}"); + decreaseIndent(); + writeLine(); + write("}") + + return exportStarFunction; + } + + function writeExportedName(node: Identifier | Declaration): void { + // do not record default exports + // they are local to module and never overwritten (explicitly skipped) by star export + if (node.kind !== SyntaxKind.Identifier && node.flags & NodeFlags.Default) { + return; + } + + if (started) { + write(","); + } + else { + started = true; + } + + writeLine(); + write("'"); + if (node.kind === SyntaxKind.Identifier) { + emitNodeWithoutSourceMap(node); + } + else { + emitDeclarationName(node); + } + + write("': true"); + } + } + + function processTopLevelVariableAndFunctionDeclarations(node: SourceFile): (Identifier | Declaration)[] { + // per ES6 spec: + // 15.2.1.16.4 ModuleDeclarationInstantiation() Concrete Method + // - var declarations are initialized to undefined - 14.a.ii + // - function/generator declarations are instantiated - 16.a.iv + // this means that after module is instantiated but before its evaluation + // exported functions are already accessible at import sites + // in theory we should hoist only exported functions and its dependencies + // in practice to simplify things we'll hoist all source level functions and variable declaration + // including variables declarations for module and class declarations + let hoistedVars: (Identifier | ClassDeclaration | ModuleDeclaration)[]; + let hoistedFunctionDeclarations: FunctionDeclaration[]; + let exportedDeclarations: (Identifier | Declaration)[]; + + visit(node); + + if (hoistedVars) { + writeLine(); + write("var "); + for (let i = 0; i < hoistedVars.length; ++i) { + let local = hoistedVars[i]; + if (i !== 0) { + write(", "); + } + if (local.kind === SyntaxKind.ClassDeclaration || local.kind === SyntaxKind.ModuleDeclaration) { + emitDeclarationName(local); + } + else { + emit(local); + } + + let flags = getCombinedNodeFlags(local.kind === SyntaxKind.Identifier ? local.parent : local); + if (flags & NodeFlags.Export) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(local); + } + } + write(";") + } + + if (hoistedFunctionDeclarations) { + for (let f of hoistedFunctionDeclarations) { + writeLine(); + emit(f); + + if (f.flags & NodeFlags.Export) { + if (!exportedDeclarations) { + exportedDeclarations = []; + } + exportedDeclarations.push(f); + } + } + } + + return exportedDeclarations; + + function visit(node: Node): void { + if (node.kind === SyntaxKind.FunctionDeclaration) { + if (!hoistedFunctionDeclarations) { + hoistedFunctionDeclarations = []; + } + + hoistedFunctionDeclarations.push(node); + return; + } + + if (node.kind === SyntaxKind.ClassDeclaration) { + // TODO: rename block scoped classes + if (!hoistedVars) { + hoistedVars = []; + } + + hoistedVars.push(node); + return; + } + + if (node.kind === SyntaxKind.ModuleDeclaration && shouldEmitModuleDeclaration(node)) { + if (!hoistedVars) { + hoistedVars = []; + } + + hoistedVars.push(node); + return; + } + + if (node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.BindingElement) { + if (shouldHoistVariable(node, /*checkIfSourceFileLevelDecl*/ false)) { + let name = (node).name; + if (name.kind === SyntaxKind.Identifier) { + if (!hoistedVars) { + hoistedVars = []; + } + + hoistedVars.push(name); + } + else { + forEachChild(name, visit); + } + } + return; + } + + if (isBindingPattern(node)) { + forEach((node).elements, visit); + return; + } + + if (!isDeclaration(node)) { + forEachChild(node, visit); + } + } + } + + function shouldHoistVariable(node: VariableDeclaration | VariableDeclarationList | BindingElement, checkIfSourceFileLevelDecl: boolean): boolean { + if (checkIfSourceFileLevelDecl && !shouldHoistDeclarationInSystemJsModule(node)) { + return false; + } + // hoist variable if + // - it is not block scoped + // - it is top level block scoped + // 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 (getCombinedNodeFlags(node) & NodeFlags.BlockScoped) === 0 || + getEnclosingBlockScopeContainer(node).kind === SyntaxKind.SourceFile; + } + + function isCurrentFileSystemExternalModule() { + return compilerOptions.module === ModuleKind.System && isExternalModule(currentSourceFile); + } + + function emitSystemModuleBody(node: SourceFile, startIndex: number): void { + // shape of the body in system modules: + // function (exports) { + // + // + // + // return { + // setters: [ + // + // ], + // execute: function() { + // + // } + // } + // + // } + // I.e: + // import {x} from 'file1' + // var y = 1; + // export function foo() { return y + x(); } + // console.log(y); + // will be transformed to + // function(exports) { + // var file1; // local alias + // var y; + // function foo() { return y + file1.x(); } + // exports("foo", foo); + // return { + // setters: [ + // function(v) { file1 = v } + // ], + // execute(): function() { + // y = 1; + // console.log(y); + // } + // }; + // } + emitVariableDeclarationsForImports(); + writeLine(); + var exportedDeclarations = processTopLevelVariableAndFunctionDeclarations(node); + let exportStarFunction = emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) + writeLine(); + write("return {"); + increaseIndent(); + writeLine(); + emitSetters(exportStarFunction); + writeLine(); + emitExecute(node, startIndex); + emitTempDeclarations(/*newLine*/ true) + decreaseIndent(); + writeLine(); + write("}"); // return + } + + function emitSetters(exportStarFunction: string) { + write("setters:["); + for (let i = 0; i < externalImports.length; ++i) { + if (i !== 0) { + write(","); + } + + writeLine(); + increaseIndent(); + let importNode = externalImports[i]; + let importVariableName = getLocalNameForExternalImport(importNode) || ""; + let parameterName = "_" + importVariableName; + write(`function (${parameterName}) {`); + + switch (importNode.kind) { + case SyntaxKind.ImportDeclaration: + if (!(importNode).importClause) { + // 'import "..."' case + // module is imported only for side-effects, setter body will be empty + break; + } + // fall-through + case SyntaxKind.ImportEqualsDeclaration: + Debug.assert(importVariableName !== ""); + + increaseIndent(); + writeLine(); + // save import into the local + write(`${importVariableName} = ${parameterName};`); + writeLine(); + + let defaultName = + importNode.kind === SyntaxKind.ImportDeclaration + ? (importNode).importClause.name + : (importNode).name; + + if (defaultName) { + // emit re-export for imported default name + // import n1 from 'foo1' + // import n2 = require('foo2') + // export {n1} + // export {n2} + emitExportMemberAssignments(defaultName); + writeLine(); + } + + if (importNode.kind === SyntaxKind.ImportDeclaration && + (importNode).importClause.namedBindings) { + + let namedBindings = (importNode).importClause.namedBindings; + if (namedBindings.kind === SyntaxKind.NamespaceImport) { + // emit re-export for namespace + // import * as n from 'foo' + // export {n} + emitExportMemberAssignments((namedBindings).name); + writeLine(); + } + else { + // emit re-exports for named imports + // import {a, b} from 'foo' + // export {a, b as c} + for (let element of (namedBindings).elements) { + emitExportMemberAssignments(element.name || element.propertyName); + writeLine() + } + } + } + + decreaseIndent(); + break; + case SyntaxKind.ExportDeclaration: + Debug.assert(importVariableName !== ""); + + increaseIndent(); + + if ((importNode).exportClause) { + // export {a, b as c} from 'foo' + // emit as: + // exports('a', _foo["a"]) + // exports('c', _foo["b"]) + for (let e of (importNode).exportClause.elements) { + writeLine(); + write(`${exportFunctionForFile}("`); + emitNodeWithoutSourceMap(e.name); + write(`", ${parameterName}["`); + emitNodeWithoutSourceMap(e.propertyName || e.name); + write(`"]);`); + } + } + else { + writeLine(); + // export * from 'foo' + // emit as: + // exportStar(_foo); + write(`${exportStarFunction}(${parameterName});`); + } + + writeLine(); + decreaseIndent(); + break; + } + + write("}") + decreaseIndent(); + } + write("],"); + } + + function emitExecute(node: SourceFile, startIndex: number) { + write("execute: function() {"); + increaseIndent(); + writeLine(); + for (let i = startIndex; i < node.statements.length; ++i) { + let statement = node.statements[i]; + // - imports/exports are not emitted for system modules + // - function declarations are not emitted because they were already hoisted + switch (statement.kind) { + case SyntaxKind.ExportDeclaration: + case SyntaxKind.ImportDeclaration: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.FunctionDeclaration: + continue; + } + writeLine(); + emit(statement); + } + decreaseIndent(); + writeLine(); + write("}") // execute + } + + function emitSystemModule(node: SourceFile, startIndex: number): void { + collectExternalModuleInfo(node); + // System modules has the following shape + // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) + // 'exports' here is a function 'exports(name: string, value: T): T' that is used to publish exported values. + // 'exports' returns its 'value' argument so in most cases expressions + // that mutate exported values can be rewritten as: + // expr -> exports('name', expr). + // The only exception in this rule is postfix unary operators, + // see comment to 'emitPostfixUnaryExpression' for more details + Debug.assert(!exportFunctionForFile); + // make sure that name of 'exports' function does not conflict with existing identifiers + exportFunctionForFile = makeUniqueName("exports"); + write("System.register(["); + for (let i = 0; i < externalImports.length; ++i) { + let text = getExternalModuleNameText(externalImports[i]); + if (i !== 0) { + write(", "); + } + write(text); + } + write(`], function(${exportFunctionForFile}) {`); + writeLine(); + increaseIndent(); + emitCaptureThisForNodeIfNecessary(node); + emitSystemModuleBody(node, startIndex); + decreaseIndent(); + writeLine(); + write("});"); + } + + function emitAMDDependencies(node: SourceFile, includeNonAmdDependencies: boolean) { // An AMD define function has the following shape: // define(id?, dependencies?, factory); // // This has the shape of // define(name, ["module1", "module2"], function (module1Alias) { - // The location of the alias in the parameter list in the factory function needs to + // The location of the alias in the parameter list in the factory function needs to // match the position of the module name in the dependency list. // - // To ensure this is true in cases of modules with no aliases, e.g.: - // `import "module"` or `` + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` // we need to add modules without alias names to the end of the dependencies list - - let aliasedModuleNames: string[] = []; // names of modules with corresponding parameter in the + + let aliasedModuleNames: string[] = []; // names of modules with corresponding parameter in the // factory function. let unaliasedModuleNames: string[] = []; // names of modules with no corresponding parameters in // factory function. let importAliasNames: string[] = []; // names of the parameters in the factory function; these - // paramters need to match the indexes of the corresponding + // parameters need to match the indexes of the corresponding // module names in aliasedModuleNames. // Fill in amd-dependency tags @@ -4646,23 +5466,11 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { for (let importNode of externalImports) { // Find the name of the external module - let externalModuleName = ""; - let moduleName = getExternalModuleName(importNode); - if (moduleName.kind === SyntaxKind.StringLiteral) { - externalModuleName = getLiteralText(moduleName); - } + let externalModuleName = getExternalModuleNameText(importNode); - // Find the name of the module alais, if there is one - let importAliasName: string; - let namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - importAliasName = getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); - } - else { - importAliasName = getGeneratedNameForNode(importNode); - } - - if (importAliasName) { + // Find the name of the module alias, if there is one + let importAliasName = getLocalNameForExternalImport(importNode); + if (includeNonAmdDependencies && importAliasName) { aliasedModuleNames.push(externalModuleName); importAliasNames.push(importAliasName); } @@ -4670,12 +5478,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { unaliasedModuleNames.push(externalModuleName); } } - - writeLine(); - write("define("); - if (node.amdModuleName) { - write("\"" + node.amdModuleName + "\", "); - } + write("[\"require\", \"exports\""); if (aliasedModuleNames.length) { write(", "); @@ -4690,6 +5493,17 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { write(", "); write(importAliasNames.join(", ")); } + } + + function emitAMDModule(node: SourceFile, startIndex: number) { + collectExternalModuleInfo(node); + + writeLine(); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + emitAMDDependencies(node, /*includeNonAmdDependencies*/ true); write(") {"); increaseIndent(); emitExportStarHelper(); @@ -4711,6 +5525,31 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitExportEquals(/*emitAsReturn*/ false); } + function emitUMDModule(node: SourceFile, startIndex: number) { + collectExternalModuleInfo(node); + + // Module is detected first to support Browserify users that load into a browser with an AMD loader + writeLines(`(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(`); + emitAMDDependencies(node, false); + write(") {"); + increaseIndent(); + emitExportStarHelper(); + emitCaptureThisForNodeIfNecessary(node); + emitLinesStartingAt(node.statements, startIndex); + emitTempDeclarations(/*newLine*/ true); + emitExportEquals(/*emitAsReturn*/ true); + decreaseIndent(); + writeLine(); + write("});"); + } + function emitES6Module(node: SourceFile, startIndex: number) { externalImports = undefined; exportSpecifiers = undefined; @@ -4768,33 +5607,43 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // emit prologue directives prior to __extends var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false); - // 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)) { - writeLines(extendsHelper); - extendsEmitted = true; - } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) { - writeLines(decorateHelper); - if (compilerOptions.emitDecoratorMetadata) { - writeLines(metadataHelper); + // Only emit helpers if the user did not say otherwise. + 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)) { + writeLines(extendsHelper); + extendsEmitted = true; + } + + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } + decorateEmitted = true; + } + + if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) { + writeLines(paramHelper); + paramEmitted = true; } - decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) { - writeLines(paramHelper); - paramEmitted = true; - } - - if (isExternalModule(node)) { + if (isExternalModule(node) || compilerOptions.separateCompilation) { if (languageVersion >= ScriptTarget.ES6) { emitES6Module(node, startIndex); } else if (compilerOptions.module === ModuleKind.AMD) { emitAMDModule(node, startIndex); } + else if (compilerOptions.module === ModuleKind.System) { + emitSystemModule(node, startIndex); + } + else if (compilerOptions.module === ModuleKind.UMD) { + emitUMDModule(node, startIndex); + } else { emitCommonJSModule(node, startIndex); } @@ -4812,76 +5661,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitLeadingComments(node.endOfFileToken); } - /** - * The standard function to emit on any Node. - * This will take care of leading/trailing comments, and sourcemaps if applicable. - */ - function emit(node: Node): void { - emitNodeWorker(node, /*shouldEmitSourceMap*/ true, /*allowGeneratedIdentifiers*/ true); - } - - /** - * A function to be called in the case where sourcemaps should not be tracked for a single node. - * This will still take care of leading/trailing comments. - * - * Note, however, that sourcemap tracking may resume for child nodes within the given - * node depending on the specifics of how the given node will be emitted. - * - * For instance, if this function is called with the node 'a + b', then we will not track - * the sourcemap for 'a + b' itself, but if 'emit' is called instead for nodes 'a' and 'b', - * then both 'a' and 'b' will have sourcemaps recorded if appropriate. - */ - function emitWithoutSourceMap(node: Node): void { - emitNodeWorker(node, /*shouldEmitSourceMap*/ false, /*allowGeneratedIdentifiers*/ true); - } - - /** - * Emits a node with comments and tracks sourcemaps for said node, disallowing the renaming - * of identifiers to be *for this node*. - * - * This is useful in scenarios when a name's usage can be non-local and it is not feasible to - * rename it (e.g. the declaration name of a property for a shorthand property). - * - * Note that preventing generated identifier renaming only applies if the given node is an - * identifier. If it is not an identifier, contained identifiers may still be replaced - * by their generated counterparts. - * - * For instance, given an the computed property '[a + b]' from below : - * var x = { - * [a + b]() { - * } - * } - * Both 'a' and 'b' may be replaced by generated counterparts in '[a + b]'. - */ - function emitVerbatimDeclarationName(node: DeclarationName) { - emitNodeWorker(node, /*shouldEmitSourceMap*/ true, /*allowGeneratedIdentifiers*/ false); - } - - /** - * Do not call this function directly. - * - * This function acts as a common path to 'emit' and 'emitNodeWithoutSourceMap' - * that is aware of ordering between comments and sourcemap spans. - */ - function emitNodeWorker(node: Node, shouldEmitSourceMap: boolean, allowGeneratedIdentifiers: boolean): void { + function emitNodeWithoutSourceMap(node: Node, allowGeneratedIdentifiers?: boolean): void { if (!node) { return; } if (node.flags & NodeFlags.Ambient) { - emitOnlyPinnedOrTripleSlashComments(node); - return; - } - - // Emitting on a SourceFile is a special case; there is not necessarily - // a corresponding start/end we're interested in, and comments will be - // emitted for the end-of-file - if (node.kind === SyntaxKind.SourceFile) { - if (shouldEmitSourceMap) { - emitSourceFileStart(node); - } - emitBareNode(node, allowGeneratedIdentifiers); - return; + return emitOnlyPinnedOrTripleSlashComments(node); } let emitComments = shouldEmitLeadingAndTrailingComments(node); @@ -4889,16 +5675,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { emitLeadingComments(node); } - // Only track sourcemaps on *parsed* nodes when requested. - // Synthesized nodes do not correspond to text in the original source. - if (shouldEmitSourceMap && !nodeIsSynthesized(node)) { - emitStart(node); - emitBareNode(node, allowGeneratedIdentifiers); - emitEnd(node); - } - else { - emitBareNode(node, allowGeneratedIdentifiers); - } + emitJavaScriptWorker(node, allowGeneratedIdentifiers); if (emitComments) { emitTrailingComments(node); @@ -4910,15 +5687,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // 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 SyntaxKind.InterfaceDeclaration: + case SyntaxKind.FunctionDeclaration: case SyntaxKind.ImportDeclaration: case SyntaxKind.ImportEqualsDeclaration: case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.ExportAssignment: return false; - case SyntaxKind.FunctionDeclaration: - return !!(node).body; - case SyntaxKind.ModuleDeclaration: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. @@ -4947,10 +5722,7 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { return true; } - /** - * Emits a node without emitting comments or tracking sourcemap information. - */ - function emitBareNode(node: Node, allowGeneratedIdentifiers: boolean) { + function emitJavaScriptWorker(node: Node, allowGeneratedIdentifiers: boolean = true) { // Check if the node can be emitted regardless of the ScriptTarget switch (node.kind) { case SyntaxKind.Identifier: @@ -5111,13 +5883,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { } function hasDetachedComments(pos: number) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; + return detachedCommentsInfo !== undefined && lastOrUndefined(detachedCommentsInfo).nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos let leadingComments = getLeadingCommentRanges(currentSourceFile.text, - detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -5238,13 +6010,13 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) { // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - let lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + let lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastOrUndefined(detachedComments).end); let nodeLine = getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { // Valid detachedComments emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); emitComments(currentSourceFile, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); - let currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + let currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: lastOrUndefined(detachedComments).end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 6ad38ac73c1..055fc1b6f74 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -194,7 +194,7 @@ module ts { case SyntaxKind.ForStatement: return visitNode(cbNode, (node).initializer) || visitNode(cbNode, (node).condition) || - visitNode(cbNode, (node).iterator) || + visitNode(cbNode, (node).incrementor) || visitNode(cbNode, (node).statement); case SyntaxKind.ForInStatement: return visitNode(cbNode, (node).initializer) || @@ -308,9 +308,9 @@ module ts { return visitNode(cbNode, (node).expression); case SyntaxKind.HeritageClause: return visitNodes(cbNodes, (node).types); - case SyntaxKind.HeritageClauseElement: - return visitNode(cbNode, (node).expression) || - visitNodes(cbNodes, (node).typeArguments); + case SyntaxKind.ExpressionWithTypeArguments: + return visitNode(cbNode, (node).expression) || + visitNodes(cbNodes, (node).typeArguments); case SyntaxKind.ExternalModuleReference: return visitNode(cbNode, (node).expression); case SyntaxKind.MissingDeclaration: @@ -1691,7 +1691,7 @@ module ts { do { templateSpans.push(parseTemplateSpan()); } - while (templateSpans[templateSpans.length - 1].literal.kind === SyntaxKind.TemplateMiddle) + while (lastOrUndefined(templateSpans).literal.kind === SyntaxKind.TemplateMiddle) templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; @@ -3497,7 +3497,7 @@ module ts { } parseExpected(SyntaxKind.SemicolonToken); if (token !== SyntaxKind.CloseParenToken) { - forStatement.iterator = allowInAnd(parseExpression); + forStatement.incrementor = allowInAnd(parseExpression); } parseExpected(SyntaxKind.CloseParenToken); forOrForInOrForOfStatement = forStatement; @@ -3704,6 +3704,7 @@ module ts { return !isConstEnum; case SyntaxKind.InterfaceKeyword: case SyntaxKind.ModuleKeyword: + case SyntaxKind.NamespaceKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.TypeKeyword: // When followed by an identifier, these do not start a statement but might @@ -4283,15 +4284,15 @@ module ts { let node = createNode(SyntaxKind.HeritageClause); node.token = token; nextToken(); - node.types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseHeritageClauseElement); + node.types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); return finishNode(node); } return undefined; } - function parseHeritageClauseElement(): HeritageClauseElement { - let node = createNode(SyntaxKind.HeritageClauseElement); + function parseExpressionWithTypeArguments(): ExpressionWithTypeArguments { + let node = createNode(SyntaxKind.ExpressionWithTypeArguments); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === SyntaxKind.LessThanToken) { node.typeArguments = parseBracketedList(ParsingContext.TypeArguments, parseType, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); @@ -4371,14 +4372,14 @@ module ts { return finishNode(node); } - function parseInternalModuleTail(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, flags: NodeFlags): ModuleDeclaration { + function parseModuleOrNamespaceDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray, flags: NodeFlags): ModuleDeclaration { let node = createNode(SyntaxKind.ModuleDeclaration, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); node.body = parseOptional(SyntaxKind.DotToken) - ? parseInternalModuleTail(getNodePos(), /*decorators*/ undefined, /*modifiers:*/undefined, NodeFlags.Export) + ? parseModuleOrNamespaceDeclaration(getNodePos(), /*decorators*/ undefined, /*modifiers:*/undefined, NodeFlags.Export) : parseModuleBlock(); return finishNode(node); } @@ -4393,10 +4394,17 @@ module ts { } function parseModuleDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray): ModuleDeclaration { - parseExpected(SyntaxKind.ModuleKeyword); - return token === SyntaxKind.StringLiteral - ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) - : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); + let flags = modifiers ? modifiers.flags : 0; + if (parseOptional(SyntaxKind.NamespaceKeyword)) { + flags |= NodeFlags.Namespace; + } + else { + parseExpected(SyntaxKind.ModuleKeyword); + if (token === SyntaxKind.StringLiteral) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + } + return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); } function isExternalModuleReference() { @@ -4631,6 +4639,7 @@ module ts { // Not true keywords so ensure an identifier follows or is string literal or asterisk or open brace return lookAhead(nextTokenCanFollowImportKeyword); case SyntaxKind.ModuleKeyword: + case SyntaxKind.NamespaceKeyword: // Not a true keyword so ensure an identifier or string literal follows return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); case SyntaxKind.ExportKeyword: @@ -4715,6 +4724,7 @@ module ts { case SyntaxKind.EnumKeyword: return parseEnumDeclaration(fullStart, decorators, modifiers); case SyntaxKind.ModuleKeyword: + case SyntaxKind.NamespaceKeyword: return parseModuleDeclaration(fullStart, decorators, modifiers); case SyntaxKind.ImportKeyword: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 2b43f330273..8fc45121b64 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -10,6 +10,9 @@ module ts { /** The version of the TypeScript compiler release */ export const version = "1.5.0-beta"; + const carriageReturnLineFeed = "\r\n"; + const lineFeed = "\n"; + export function findConfigFile(searchPath: string): string { var fileName = "tsconfig.json"; while (true) { @@ -91,6 +94,11 @@ module ts { } } + let newLine = + options.newLine === NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed : + options.newLine === NewLineKind.LineFeed ? lineFeed : + sys.newLine; + return { getSourceFile, getDefaultLibFileName: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)), @@ -98,15 +106,15 @@ module ts { getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()), useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, getCanonicalFileName, - getNewLine: () => sys.newLine + getNewLine: () => newLine }; } - export function getPreEmitDiagnostics(program: Program): Diagnostic[] { - let diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[] { + let diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics()); + diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); } return sortAndDeduplicateDiagnostics(diagnostics); @@ -534,6 +542,25 @@ module ts { } } + if (options.inlineSourceMap) { + if (options.sourceMap) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.mapRoot) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + if (options.sourceRoot) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap)); + } + } + + + if (options.inlineSources) { + if (!options.sourceMap && !options.inlineSourceMap) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); + } + } + if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { @@ -556,18 +583,18 @@ module ts { let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined); if (firstNonExternalModuleSourceFile) { let span = getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided)); + diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided)); } } else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && !options.module) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet let span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); + diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); } // Cannot specify module gen target when in es6 or above if (options.module && languageVersion >= ScriptTarget.ES6) { - diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); + diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher)); } // there has to be common source directory if user specified --outdir || --sourceRoot diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index c2b693d6772..1fc8bff92e6 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -2,12 +2,10 @@ /// module ts { - /* @internal */ export interface ErrorCallback { (message: DiagnosticMessage, length: number): void; } - /* @internal */ export interface Scanner { getStartPos(): number; getToken(): SyntaxKind; @@ -76,6 +74,7 @@ module ts { "interface": SyntaxKind.InterfaceKeyword, "let": SyntaxKind.LetKeyword, "module": SyntaxKind.ModuleKeyword, + "namespace": SyntaxKind.NamespaceKeyword, "new": SyntaxKind.NewKeyword, "null": SyntaxKind.NullKeyword, "number": SyntaxKind.NumberKeyword, @@ -352,7 +351,7 @@ module ts { export function isLineBreak(ch: number): boolean { // ES5 7.3: // The ECMAScript line terminator characters are listed in Table 3. - // Table 3 Line Terminator Characters + // Table 3: Line Terminator Characters // Code Unit Value Name Formal Name // \u000A Line Feed // \u000D Carriage Return @@ -521,7 +520,7 @@ module ts { } collecting = true; if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; + lastOrUndefined(result).hasTrailingNewLine = true; } continue; case CharacterCodes.tab: @@ -568,7 +567,7 @@ module ts { default: if (ch > CharacterCodes.maxAsciiCharacter && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; + lastOrUndefined(result).hasTrailingNewLine = true; } pos++; continue; @@ -599,8 +598,7 @@ module ts { ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion); } - // Creates a scanner over a (possibly unspecified) range of a piece of text. - /* @internal */ + /** Creates a scanner over a (possibly unspecified) range of a piece of text. */ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner { let pos: number; // Current position (end position of text of current token) let end: number; // end of text diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 0cbeff8204a..15cc665e351 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -208,12 +208,15 @@ module ts { if (!cachedProgram) { if (configFileName) { - var configObject = readConfigFile(configFileName); - if (!configObject) { - reportDiagnostic(createCompilerDiagnostic(Diagnostics.Unable_to_open_file_0, configFileName)); + + let result = readConfigFile(configFileName); + if (result.error) { + reportDiagnostic(result.error); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } - var configParseResult = parseConfigFile(configObject, getDirectoryPath(configFileName)); + + let configObject = result.config; + let configParseResult = parseConfigFile(configObject, sys, getDirectoryPath(configFileName)); if (configParseResult.errors.length > 0) { reportDiagnostics(configParseResult.errors); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); @@ -230,7 +233,7 @@ module ts { compilerHost.getSourceFile = getSourceFile; } - var compileResult = compile(rootFileNames, compilerOptions, compilerHost); + let compileResult = compile(rootFileNames, compilerOptions, compilerHost); if (!compilerOptions.watch) { return sys.exit(compileResult.exitStatus); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index bff15a1ab9d..86e680ca8b0 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -138,6 +138,7 @@ module ts { DeclareKeyword, GetKeyword, ModuleKeyword, + NamespaceKeyword, RequireKeyword, NumberKeyword, SetKeyword, @@ -205,9 +206,9 @@ module ts { SpreadElementExpression, ClassExpression, OmittedExpression, + ExpressionWithTypeArguments, // Misc TemplateSpan, - HeritageClauseElement, SemicolonClassElement, // Element Block, @@ -312,8 +313,9 @@ module ts { DeclarationFile = 0x00000800, // Node is a .d.ts file Let = 0x00001000, // Variable declaration Const = 0x00002000, // Variable declaration - OctalLiteral = 0x00004000, - ExportContext = 0x00008000, // Export context (initialized by binding) + OctalLiteral = 0x00004000, // Octal numeric literal + Namespace = 0x00008000, // Namespace declaration + ExportContext = 0x00010000, // Export context (initialized by binding) Modifier = Export | Ambient | Public | Private | Protected | Static | Default, AccessibilityModifier = Public | Private | Protected, @@ -739,7 +741,7 @@ module ts { arguments: NodeArray; } - export interface HeritageClauseElement extends TypeNode { + export interface ExpressionWithTypeArguments extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -795,7 +797,7 @@ module ts { export interface ForStatement extends IterationStatement { initializer?: VariableDeclarationList | Expression; condition?: Expression; - iterator?: Expression; + incrementor?: Expression; } export interface ForInStatement extends IterationStatement { @@ -891,7 +893,7 @@ module ts { export interface HeritageClause extends Node { token: SyntaxKind; - types?: NodeArray; + types?: NodeArray; } export interface TypeAliasDeclaration extends Declaration, ModuleElement { @@ -1032,6 +1034,10 @@ module ts { getCurrentDirectory(): string; } + export interface ParseConfigHost { + readDirectory(rootDir: string, extension: string): string[]; + } + export interface WriteFileCallback { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; } @@ -1092,14 +1098,15 @@ module ts { } export interface SourceMapData { - sourceMapFilePath: string; // Where the sourcemap file is written - jsSourceMappingURL: string; // source map URL written in the .js file - sourceMapFile: string; // Source map's file field - .js file name - sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not "" - sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map - inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list - sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map - sourceMapMappings: string; // Source map's mapping field - encoded source map spans + sourceMapFilePath: string; // Where the sourcemap file is written + jsSourceMappingURL: string; // source map URL written in the .js file + sourceMapFile: string; // Source map's file field - .js file name + sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not "" + sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map + sourceMapSourcesContent?: string[]; // Source map's sourcesContent field - list of the sources' text to be embedded in the source map + inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list + sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map + sourceMapMappings: string; // Source map's mapping field - encoded source map spans sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings } @@ -1273,6 +1280,7 @@ module ts { getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; resolvesToSomeValue(location: Node, name: string): boolean; getBlockScopedVariableId(node: Identifier): number; + getReferencedValueDeclaration(reference: Identifier): Declaration; serializeTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[]; serializeParameterTypesOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): (string | string[])[]; serializeReturnTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[]; @@ -1485,6 +1493,13 @@ module ts { // Class and interface types (TypeFlags.Class and TypeFlags.Interface) export interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic) + } + + export interface InterfaceTypeWithBaseTypes extends InterfaceType { + baseTypes: ObjectType[]; + } + + export interface InterfaceTypeWithDeclaredMembers extends InterfaceType { declaredProperties: Symbol[]; // Declared members declaredCallSignatures: Signature[]; // Declared call signatures declaredConstructSignatures: Signature[]; // Declared construct signatures @@ -1492,10 +1507,6 @@ module ts { declaredNumberIndexType: Type; // Declared numeric index type } - export interface InterfaceTypeWithBaseTypes extends InterfaceType { - baseTypes: ObjectType[]; - } - // Type references (TypeFlags.Reference) export interface TypeReference extends ObjectType { target: GenericType; // Type reference target @@ -1639,11 +1650,15 @@ module ts { diagnostics?: boolean; emitBOM?: boolean; help?: boolean; + inlineSourceMap?: boolean; + inlineSources?: boolean; listFiles?: boolean; locale?: string; mapRoot?: string; module?: ModuleKind; + newLine?: NewLineKind; noEmit?: boolean; + noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; noImplicitAny?: boolean; @@ -1671,8 +1686,15 @@ module ts { None = 0, CommonJS = 1, AMD = 2, + UMD = 3, + System = 4, } + export const enum NewLineKind { + CarriageReturnLineFeed = 0, + LineFeed = 1, + } + export interface LineAndCharacter { line: number; /* diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index b1aa59be323..0bb0065d1b0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -775,7 +775,7 @@ module ts { let forStatement = parent; return (forStatement.initializer === node && forStatement.initializer.kind !== SyntaxKind.VariableDeclarationList) || forStatement.condition === node || - forStatement.iterator === node; + forStatement.incrementor === node; case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: let forInStatement = parent; @@ -856,7 +856,7 @@ module ts { } export function hasRestParameters(s: SignatureDeclaration): boolean { - return s.parameters.length > 0 && s.parameters[s.parameters.length - 1].dotDotDotToken !== undefined; + return s.parameters.length > 0 && lastOrUndefined(s.parameters).dotDotDotToken !== undefined; } export function isLiteralKind(kind: SyntaxKind): boolean { @@ -1362,7 +1362,7 @@ module ts { let lineStartsOfS = computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + linePos = output.length - s.length + lastOrUndefined(lineStartsOfS); } } } @@ -1435,8 +1435,10 @@ module ts { export function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean { if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out) && !fileExtensionIs(sourceFile.fileName, ".js")) { - return true; + if ((isExternalModule(sourceFile) || !compilerOptions.out)) { + // 1. in-browser single file compilation scenario + // 2. non .js file + return compilerOptions.separateCompilation || !fileExtensionIs(sourceFile.fileName, ".js"); } return false; } @@ -1671,16 +1673,16 @@ module ts { // Returns false if this heritage clause element's expression contains something unsupported // (i.e. not a name or dotted name). - export function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean { - return isSupportedHeritageClauseElementExpression(node.expression); + export function isSupportedExpressionWithTypeArguments(node: ExpressionWithTypeArguments): boolean { + return isSupportedExpressionWithTypeArgumentsRest(node.expression); } - function isSupportedHeritageClauseElementExpression(node: Expression): boolean { + function isSupportedExpressionWithTypeArgumentsRest(node: Expression): boolean { if (node.kind === SyntaxKind.Identifier) { return true; } else if (node.kind === SyntaxKind.PropertyAccessExpression) { - return isSupportedHeritageClauseElementExpression((node).expression); + return isSupportedExpressionWithTypeArgumentsRest((node).expression); } else { return false; @@ -1693,7 +1695,84 @@ module ts { } export function getLocalSymbolForExportDefault(symbol: Symbol) { - return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined; + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined; + } + + /** + * Replace each instance of non-ascii characters by one, two, three, or four escape sequences + * representing the UTF-8 encoding of the character, and return the expanded char code list. + */ + function getExpandedCharCodes(input: string): number[] { + let output: number[] = []; + let length = input.length; + let leadSurrogate: number = undefined; + + for (let i = 0; i < length; i++) { + let charCode = input.charCodeAt(i); + + // handel utf8 + if (charCode < 0x80) { + output.push(charCode); + } + else if (charCode < 0x800) { + output.push((charCode >> 6) | 0B11000000); + output.push((charCode & 0B00111111) | 0B10000000); + } + else if (charCode < 0x10000) { + output.push((charCode >> 12) | 0B11100000); + output.push(((charCode >> 6) & 0B00111111) | 0B10000000); + output.push((charCode & 0B00111111) | 0B10000000); + } + else if (charCode < 0x20000) { + output.push((charCode >> 18) | 0B11110000); + output.push(((charCode >> 12) & 0B00111111) | 0B10000000); + output.push(((charCode >> 6) & 0B00111111) | 0B10000000); + output.push((charCode & 0B00111111) | 0B10000000); + } + else { + Debug.assert(false, "Unexpected code point"); + } + } + + return output; + } + + const base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + /** + * Converts a string to a base-64 encoded ASCII string. + */ + export function convertToBase64(input: string): string { + var result = ""; + let charCodes = getExpandedCharCodes(input); + let i = 0; + let length = charCodes.length; + let byte1: number, byte2: number, byte3: number, byte4: number; + + while (i < length) { + // Convert every 6-bits in the input 3 character points + // into a base64 digit + byte1 = charCodes[i] >> 2; + byte2 = (charCodes[i] & 0B00000011) << 4 | charCodes[i + 1] >> 4; + byte3 = (charCodes[i + 1] & 0B00001111) << 2 | charCodes[i + 2] >> 6; + byte4 = charCodes[i + 2] & 0B00111111; + + // We are out of characters in the input, set the extra + // digits to 64 (padding character). + if (i + 1 >= length) { + byte3 = byte4 = 64; + } + else if (i + 2 >= length) { + byte4 = 64; + } + + // Write to the ouput + result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + + i += 3; + } + + return result; } } diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 42a0cabe48c..b6997e705b9 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -97,7 +97,7 @@ class CompilerBaselineRunner extends RunnerBase { program = _program; }, function (settings) { harnessCompiler.setCompilerSettings(tcSettings); - }); + }); }); beforeEach(() => { @@ -159,7 +159,7 @@ class CompilerBaselineRunner extends RunnerBase { // Source maps? it('Correct sourcemap content for ' + fileName, () => { - if (options.sourceMap) { + if (options.sourceMap || options.inlineSourceMap) { Harness.Baseline.runBaseline('Correct sourcemap content for ' + fileName, justName.replace(/\.ts$/, '.sourcemap.txt'), () => { var record = result.getSourceMapRecord(); if (options.noEmitOnError && result.errors.length !== 0 && record === undefined) { @@ -228,7 +228,13 @@ class CompilerBaselineRunner extends RunnerBase { }); it('Correct Sourcemap output for ' + fileName, () => { - if (options.sourceMap) { + if (options.inlineSourceMap) { + if (result.sourceMaps.length > 0) { + throw new Error('No sourcemap files should be generated if inlineSourceMaps was set.'); + } + return null; + } + else if (options.sourceMap) { if (result.sourceMaps.length !== result.files.length) { throw new Error('Number of sourcemap files should be same as js files.'); } @@ -252,7 +258,7 @@ class CompilerBaselineRunner extends RunnerBase { } }); - it('Correct type baselines for ' + fileName, () => { + it('Correct type/symbol baselines for ' + fileName, () => { if (fileName.indexOf("APISample") >= 0) { return; } @@ -289,8 +295,26 @@ class CompilerBaselineRunner extends RunnerBase { // Produce baselines. The first gives the types for all expressions. // The second gives symbols for all identifiers. - checkBaseLines(/*isSymbolBaseLine:*/ false); - checkBaseLines(/*isSymbolBaseLine:*/ true); + var e1: Error, e2: Error; + try { + checkBaseLines(/*isSymbolBaseLine:*/ false); + } + catch (e) { + e1 = e; + } + + try { + checkBaseLines(/*isSymbolBaseLine:*/ true); + } + catch (e) { + e2 = e; + } + + if (e1 || e2) { + throw e1 || e2; + } + + return; function checkBaseLines(isSymbolBaseLine: boolean) { let fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine); diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 7269b2db75d..1f5807c1249 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1570,6 +1570,28 @@ module FourSlash { this.currentCaretPosition = definition.textSpan.start; } + public goToTypeDefinition(definitionIndex: number) { + if (definitionIndex === 0) { + this.scenarioActions.push(''); + } + else { + this.taoInvalidReason = 'GoToTypeDefinition not supported for non-zero definition indices'; + } + + var definitions = this.languageService.getTypeDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); + if (!definitions || !definitions.length) { + this.raiseError('goToTypeDefinition failed - expected to at least one definition location but got 0'); + } + + if (definitionIndex >= definitions.length) { + this.raiseError('goToTypeDefinition failed - definitionIndex value (' + definitionIndex + ') exceeds definition list size (' + definitions.length + ')'); + } + + var definition = definitions[definitionIndex]; + this.openFile(definition.fileName); + this.currentCaretPosition = definition.textSpan.start; + } + public verifyDefinitionLocationExists(negative: boolean) { this.taoInvalidReason = 'verifyDefinitionLocationExists NYI'; @@ -1589,8 +1611,18 @@ module FourSlash { var assertFn = negative ? assert.notEqual : assert.equal; var definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var actualCount = definitions && definitions.length || 0; - assertFn(definitions.length, expectedCount, this.messageAtLastKnownMarker("Definitions Count")); + assertFn(actualCount, expectedCount, this.messageAtLastKnownMarker("Definitions Count")); + } + + public verifyTypeDefinitionsCount(negative: boolean, expectedCount: number) { + var assertFn = negative ? assert.notEqual : assert.equal; + + var definitions = this.languageService.getTypeDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var actualCount = definitions && definitions.length || 0; + + assertFn(actualCount, expectedCount, this.messageAtLastKnownMarker("Type definitions Count")); } public verifyDefinitionsName(negative: boolean, expectedName: string, expectedContainerName: string) { @@ -2192,38 +2224,62 @@ module FourSlash { xmlData.push(xml); } + // We don't want to recompile 'fourslash.ts' for every test, so + // here we cache the JS output and reuse it for every test. + let fourslashJsOutput: string; + { + let host = Harness.Compiler.createCompilerHost([{ unitName: Harness.Compiler.fourslashFileName, content: undefined }], + (fn, contents) => fourslashJsOutput = contents, + ts.ScriptTarget.Latest, + ts.sys.useCaseSensitiveFileNames); + + let program = ts.createProgram([Harness.Compiler.fourslashFileName], { noResolve: true, target: ts.ScriptTarget.ES3 }, host); + + program.emit(host.getSourceFile(Harness.Compiler.fourslashFileName, ts.ScriptTarget.ES3)); + } + + export function runFourSlashTestContent(basePath: string, testType: FourSlashTestType, content: string, fileName: string): TestXmlData { // Parse out the files and their metadata - var testData = parseTestData(basePath, content, fileName); + let testData = parseTestData(basePath, content, fileName); currentTestState = new TestState(basePath, testType, testData); - var result = ''; - var host = Harness.Compiler.createCompilerHost([{ unitName: Harness.Compiler.fourslashFileName, content: undefined }, - { unitName: fileName, content: content }], + let result = ''; + let host = Harness.Compiler.createCompilerHost( + [ + { unitName: Harness.Compiler.fourslashFileName, content: undefined }, + { unitName: fileName, content: content } + ], (fn, contents) => result = contents, ts.ScriptTarget.Latest, ts.sys.useCaseSensitiveFileNames); - // TODO (drosen): We need to enforce checking on these tests. - var program = ts.createProgram([Harness.Compiler.fourslashFileName, fileName], { out: "fourslashTestOutput.js", noResolve: true, target: ts.ScriptTarget.ES3 }, host); - var diagnostics = ts.getPreEmitDiagnostics(program); + let program = ts.createProgram([Harness.Compiler.fourslashFileName, fileName], { out: "fourslashTestOutput.js", noResolve: true, target: ts.ScriptTarget.ES3 }, host); + + let sourceFile = host.getSourceFile(fileName, ts.ScriptTarget.ES3); + + let diagnostics = ts.getPreEmitDiagnostics(program, sourceFile); if (diagnostics.length > 0) { throw new Error('Error compiling ' + fileName + ': ' + diagnostics.map(e => ts.flattenDiagnosticMessageText(e.messageText, ts.sys.newLine)).join('\r\n')); } - program.emit(); + + program.emit(sourceFile); result = result || ''; // Might have an empty fourslash file + result = fourslashJsOutput + "\r\n" + result; + // Compile and execute the test try { eval(result); - } catch (err) { + } + catch (err) { // Debugging: FourSlash.currentTestState.printCurrentFileState(); throw err; } - var xmlData = currentTestState.getTestXmlData(); + let xmlData = currentTestState.getTestXmlData(); xmlData.originalName = fileName; return xmlData; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 784d8312d69..97d53a6b75e 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -45,10 +45,10 @@ module Utils { export function getExecutionEnvironment() { if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { return ExecutionEnvironment.CScript; - } else if (process && process.execPath && process.execPath.indexOf("node") !== -1) { - return ExecutionEnvironment.Node; - } else { + } else if (typeof window !== "undefined") { return ExecutionEnvironment.Browser; + } else { + return ExecutionEnvironment.Node; } } @@ -805,6 +805,9 @@ module Harness { return result; } + const carriageReturnLineFeed = "\r\n"; + const lineFeed = "\n"; + export var defaultLibFileName = 'lib.d.ts'; export var defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + 'lib.core.d.ts'), /*languageVersion*/ ts.ScriptTarget.Latest); export var defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + 'lib.core.es6.d.ts'), /*languageVersion*/ ts.ScriptTarget.Latest); @@ -822,7 +825,8 @@ module Harness { scriptTarget: ts.ScriptTarget, useCaseSensitiveFileNames: boolean, // the currentDirectory is needed for rwcRunner to passed in specified current directory to compiler host - currentDirectory?: string): ts.CompilerHost { + currentDirectory?: string, + newLineKind?: ts.NewLineKind): ts.CompilerHost { // Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames function getCanonicalFileName(fileName: string): string { @@ -841,6 +845,11 @@ module Harness { }; inputFiles.forEach(register); + let newLine = + newLineKind === ts.NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed : + newLineKind === ts.NewLineKind.LineFeed ? lineFeed : + ts.sys.newLine; + return { getCurrentDirectory, getSourceFile: (fn, languageVersion) => { @@ -869,7 +878,7 @@ module Harness { writeFile, getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, - getNewLine: () => ts.sys.newLine + getNewLine: () => newLine }; } @@ -957,8 +966,12 @@ module Harness { if (typeof setting.value === 'string') { if (setting.value.toLowerCase() === 'amd') { options.module = ts.ModuleKind.AMD; + } else if (setting.value.toLowerCase() === 'umd') { + options.module = ts.ModuleKind.UMD; } else if (setting.value.toLowerCase() === 'commonjs') { options.module = ts.ModuleKind.CommonJS; + } else if (setting.value.toLowerCase() === 'system') { + options.module = ts.ModuleKind.System; } else if (setting.value.toLowerCase() === 'unspecified') { options.module = ts.ModuleKind.None; } else { @@ -986,6 +999,14 @@ module Harness { } break; + case 'emitdecoratormetadata': + options.emitDecoratorMetadata = setting.value === 'true'; + break; + + case 'noemithelpers': + options.noEmitHelpers = setting.value === 'true'; + break; + case 'noemitonerror': options.noEmitOnError = !!setting.value; break; @@ -1016,6 +1037,10 @@ module Harness { options.sourceRoot = setting.value; break; + case 'maproot': + options.mapRoot = setting.value; + break; + case 'sourcemap': options.sourceMap = !!setting.value; break; @@ -1025,7 +1050,18 @@ module Harness { break; case 'newline': - case 'newlines': + if (setting.value.toLowerCase() === 'crlf') { + options.newLine = ts.NewLineKind.CarriageReturnLineFeed; + } + else if (setting.value.toLowerCase() === 'lf') { + options.newLine = ts.NewLineKind.LineFeed; + } + else { + throw new Error('Unknown option for newLine: ' + setting.value); + } + break; + + case 'normalizenewline': newLine = setting.value; break; @@ -1069,6 +1105,14 @@ module Harness { includeBuiltFiles.push({ unitName: builtFileName, content: normalizeLineEndings(IO.readFile(builtFileName), newLine) }); break; + case 'inlinesourcemap': + options.inlineSourceMap = setting.value === 'true'; + break; + + case 'inlinesources': + options.inlineSources = setting.value === 'true'; + break; + default: throw new Error('Unsupported compiler setting ' + setting.flag); } @@ -1079,7 +1123,7 @@ module Harness { var programFiles = inputFiles.concat(includeBuiltFiles).map(file => file.unitName); var program = ts.createProgram(programFiles, options, createCompilerHost(inputFiles.concat(includeBuiltFiles).concat(otherFiles), (fn, contents, writeByteOrderMark) => fileOutputs.push({ fileName: fn, code: contents, writeByteOrderMark: writeByteOrderMark }), - options.target, useCaseSensitiveFileNames, currentDirectory)); + options.target, useCaseSensitiveFileNames, currentDirectory, options.newLine)); var emitResult = program.emit(); @@ -1461,11 +1505,12 @@ module Harness { // List of allowed metadata names var fileMetadataNames = ["filename", "comments", "declaration", "module", - "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", - "noimplicitany", "noresolve", "newline", "newlines", "emitbom", + "nolib", "sourcemap", "target", "out", "outdir", "noemithelpers", "noemitonerror", + "noimplicitany", "noresolve", "newline", "normalizenewline", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums", "includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal", - "separatecompilation"]; + "separatecompilation", "inlinesourcemap", "maproot", "sourceroot", + "inlinesources", "emitdecoratormetadata"]; function extractCompilerSettings(content: string): CompilerSetting[] { @@ -1565,7 +1610,6 @@ module Harness { export module Baseline { export interface BaselineOptions { - LineEndingSensitive?: boolean; Subfolder?: string; Baselinefolder?: string; } @@ -1657,13 +1701,6 @@ module Harness { expected = IO.readFile(refFileName); } - var lineEndingSensitive = opts && opts.LineEndingSensitive; - - if (!lineEndingSensitive) { - expected = expected.replace(/\r\n?/g, '\n'); - actual = actual.replace(/\r\n?/g, '\n'); - } - return { expected, actual }; } @@ -1719,4 +1756,4 @@ module Harness { } // TODO: not sure why Utils.evalFile isn't working with this, eventually will concat it like old compiler instead of eval -eval(Harness.tcServicesFile); \ No newline at end of file +eval(Harness.tcServicesFile); diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 77ea76266a6..0e0b8d82918 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -186,6 +186,7 @@ module Harness.LanguageService { var script = this.getScriptInfo(fileName); return script ? script.version.toString() : undefined; } + log(s: string): void { } trace(s: string): void { } error(s: string): void { } @@ -203,7 +204,7 @@ module Harness.LanguageService { } /// Shim adapter - class ShimLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceShimHost { + class ShimLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceShimHost, ts.CoreServicesShimHost { private nativeHost: NativeLanguageServiceHost; constructor(cancellationToken?: ts.CancellationToken, options?: ts.CompilerOptions) { super(cancellationToken, options); @@ -227,6 +228,11 @@ module Harness.LanguageService { } getScriptVersion(fileName: string): string { return this.nativeHost.getScriptVersion(fileName); } getLocalizedDiagnosticMessages(): string { return JSON.stringify({}); } + + readDirectory(rootDir: string, extension: string): string { + throw new Error("NYI"); + } + log(s: string): void { this.nativeHost.log(s); } trace(s: string): void { this.nativeHost.trace(s); } error(s: string): void { this.nativeHost.error(s); } @@ -336,6 +342,9 @@ module Harness.LanguageService { getDefinitionAtPosition(fileName: string, position: number): ts.DefinitionInfo[] { return unwrapJSONCallResult(this.shim.getDefinitionAtPosition(fileName, position)); } + getTypeDefinitionAtPosition(fileName: string, position: number): ts.DefinitionInfo[]{ + return unwrapJSONCallResult(this.shim.getTypeDefinitionAtPosition(fileName, position)); + } getReferencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] { return unwrapJSONCallResult(this.shim.getReferencesAtPosition(fileName, position)); } diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 6823bfafac2..39221d55b29 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -328,8 +328,10 @@ class ProjectRunner extends RunnerBase { return Harness.Compiler.getErrorBaseline(inputFiles, diagnostics); } - describe('Compiling project for ' + testCase.scenario + ': testcase ' + testCaseFileName, () => { - function verifyCompilerResults(compilerResult: BatchCompileProjectTestCaseResult) { + var name = 'Compiling project for ' + testCase.scenario + ': testcase ' + testCaseFileName; + + describe(name, () => { + function verifyCompilerResults(moduleKind: ts.ModuleKind) { function getCompilerResolutionInfo() { var resolutionInfo: ProjectRunnerTestCaseResolutionInfo = { scenario: testCase.scenario, @@ -354,23 +356,33 @@ class ProjectRunner extends RunnerBase { return resolutionInfo; } - it('Resolution information of (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { + var compilerResult: BatchCompileProjectTestCaseResult; + + it(name + ": " + moduleNameToString(moduleKind) , () => { + // Compile using node + compilerResult = batchCompilerProjectTestCase(moduleKind); + }); + + it('Resolution information of (' + moduleNameToString(moduleKind) + '): ' + testCaseFileName, () => { Harness.Baseline.runBaseline('Resolution information of (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.json', () => { return JSON.stringify(getCompilerResolutionInfo(), undefined, " "); }); }); - if (compilerResult.errors.length) { - it('Errors for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { + + it('Errors for (' + moduleNameToString(moduleKind) + '): ' + testCaseFileName, () => { + if (compilerResult.errors.length) { Harness.Baseline.runBaseline('Errors for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.errors.txt', () => { return getErrorsBaseline(compilerResult); }); - }); - } + } + }); + + + it('Baseline of emitted result (' + moduleNameToString(moduleKind) + '): ' + testCaseFileName, () => { + if (testCase.baselineCheck) { + ts.forEach(compilerResult.outputFiles, outputFile => { - if (testCase.baselineCheck) { - ts.forEach(compilerResult.outputFiles, outputFile => { - it('Baseline of emitted result (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { Harness.Baseline.runBaseline('Baseline of emitted result (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + outputFile.fileName, () => { try { return ts.sys.readFile(getProjectOutputFolder(outputFile.fileName, compilerResult.moduleKind)); @@ -380,76 +392,42 @@ class ProjectRunner extends RunnerBase { } }); }); - }); + } + }); + + it('SourceMapRecord for (' + moduleNameToString(moduleKind) + '): ' + testCaseFileName, () => { if (compilerResult.sourceMapData) { - it('SourceMapRecord for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { - Harness.Baseline.runBaseline('SourceMapRecord for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.sourcemap.txt', () => { - return Harness.SourceMapRecoder.getSourceMapRecord(compilerResult.sourceMapData, compilerResult.program, - ts.filter(compilerResult.outputFiles, outputFile => Harness.Compiler.isJS(outputFile.emittedFileName))); - }); + Harness.Baseline.runBaseline('SourceMapRecord for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.sourcemap.txt', () => { + return Harness.SourceMapRecoder.getSourceMapRecord(compilerResult.sourceMapData, compilerResult.program, + ts.filter(compilerResult.outputFiles, outputFile => Harness.Compiler.isJS(outputFile.emittedFileName))); }); } + }); - // Verify that all the generated .d.ts files compile + // Verify that all the generated .d.ts files compile + + it('Errors in generated Dts files for (' + moduleNameToString(moduleKind) + '): ' + testCaseFileName, () => { if (!compilerResult.errors.length && testCase.declaration) { var dTsCompileResult = compileCompileDTsFiles(compilerResult); if (dTsCompileResult.errors.length) { - it('Errors in generated Dts files for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { - Harness.Baseline.runBaseline('Errors in generated Dts files for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.dts.errors.txt', () => { - return getErrorsBaseline(dTsCompileResult); - }); + Harness.Baseline.runBaseline('Errors in generated Dts files for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.dts.errors.txt', () => { + return getErrorsBaseline(dTsCompileResult); }); } } - } + }); + after(() => { + compilerResult = undefined; + }); } - // Compile using node - var nodeCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.CommonJS); - verifyCompilerResults(nodeCompilerResult); - - // Compile using amd - var amdCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.AMD); - verifyCompilerResults(amdCompilerResult); - - if (testCase.runTest) { - //TODO(ryanca/danquirk): Either support this or remove this option from the interface as well as test case json files - // Node results - assert.isTrue(!nodeCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path"); - //it("runs without error: (" + moduleNameToString(nodeCompilerResult.moduleKind) + ')', function (done: any) { - // Exec.exec("node.exe", ['"' + baseLineLocalPath(nodeCompilerResult.outputFiles[0].diskRelativeName, nodeCompilerResult.moduleKind) + '"'], function (res) { - // Harness.Assert.equal(res.stdout, ""); - // Harness.Assert.equal(res.stderr, ""); - // done(); - // }) - //}); - - // Amd results - assert.isTrue(!amdCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path"); - //var amdDriverTemplate = "var requirejs = require('../r.js');\n\n" + - // "requirejs.config({\n" + - // " nodeRequire: require\n" + - // "});\n\n" + - // "requirejs(['{0}'],\n" + - // "function ({0}) {\n" + - // "});"; - //var moduleName = baseLineLocalPath(amdCompilerResult.outputFiles[0].diskRelativeName, amdCompilerResult.moduleKind).replace(/\.js$/, ""); - //sys.writeFile(testCase.projectRoot + '/driver.js', amdDriverTemplate.replace(/\{0}/g, moduleName)); - //it("runs without error (" + moduleNameToString(amdCompilerResult.moduleKind) + ')', function (done: any) { - // Exec.exec("node.exe", ['"' + testCase.projectRoot + '/driver.js"'], function (res) { - // Harness.Assert.equal(res.stdout, ""); - // Harness.Assert.equal(res.stderr, ""); - // done(); - // }) - //}); - } + verifyCompilerResults(ts.ModuleKind.CommonJS); + verifyCompilerResults(ts.ModuleKind.AMD); after(() => { // Mocha holds onto the closure environment of the describe callback even after the test is done. // Therefore we have to clean out large objects after the test is done. - nodeCompilerResult = undefined; - amdCompilerResult = undefined; testCase = undefined; testFileText = undefined; testCaseJustName = undefined; diff --git a/src/harness/runner.ts b/src/harness/runner.ts index e1e5429b007..37451639d75 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -20,9 +20,6 @@ /// function runTests(runners: RunnerBase[]) { - if (reverse) { - runners = runners.reverse(); - } for (var i = iterations; i > 0; i--) { for (var j = 0; j < runners.length; j++) { runners[j].initializeTests(); @@ -31,8 +28,6 @@ function runTests(runners: RunnerBase[]) { } var runners: RunnerBase[] = []; -global.runners = runners; -var reverse: boolean = false; var iterations: number = 1; // users can define tests to run in mytest.config that will override cmd line args, otherwise use cmd line args (test.config), otherwise no options @@ -78,9 +73,6 @@ if (testConfigFile !== '') { case 'test262': runners.push(new Test262BaselineRunner()); break; - case 'reverse': - reverse = true; - break; } } } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index f7d6bcfeaa1..528e6ddd52b 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -237,6 +237,9 @@ module Harness.SourceMapRecoder { sourceMapRecoder.WriteLine("mapUrl: " + sourceMapData.jsSourceMappingURL); sourceMapRecoder.WriteLine("sourceRoot: " + sourceMapData.sourceMapSourceRoot); sourceMapRecoder.WriteLine("sources: " + sourceMapData.sourceMapSources); + if (sourceMapData.sourceMapSourcesContent) { + sourceMapRecoder.WriteLine("sourcesContent: " + JSON.stringify(sourceMapData.sourceMapSourcesContent)); + } sourceMapRecoder.WriteLine("==================================================================="); } diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 822b7ca5202..c03ab344ab2 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -546,7 +546,7 @@ interface Math { */ atan(x: number): number; /** - * Returns the angle (in radians) from the X axis to a point (y,x). + * Returns the angle (in radians) from the X axis to a point. * @param y A numeric expression representing the cartesian y-coordinate. * @param x A numeric expression representing the cartesian x-coordinate. */ diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 1958bf55439..5a4151c0c1c 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -3697,6 +3697,8 @@ interface HTMLCanvasElement extends HTMLElement { * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. @@ -12178,6 +12180,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { overrideMimeType(mime: string): void; send(data?: Document): void; send(data?: string): void; + send(data?: any): void; setRequestHeader(header: string, value: string): void; DONE: number; HEADERS_RECEIVED: number; @@ -12332,11 +12335,13 @@ interface DocumentEvent { createEvent(eventInterface:"CloseEvent"): CloseEvent; createEvent(eventInterface:"CommandEvent"): CommandEvent; createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; createEvent(eventInterface:"DragEvent"): DragEvent; createEvent(eventInterface:"ErrorEvent"): ErrorEvent; createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; createEvent(eventInterface:"FocusEvent"): FocusEvent; createEvent(eventInterface:"GamepadEvent"): GamepadEvent; createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; @@ -12351,8 +12356,12 @@ interface DocumentEvent { createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; createEvent(eventInterface:"MessageEvent"): MessageEvent; createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; createEvent(eventInterface:"NavigationEvent"): NavigationEvent; createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; @@ -12363,6 +12372,7 @@ interface DocumentEvent { createEvent(eventInterface:"PopStateEvent"): PopStateEvent; createEvent(eventInterface:"ProgressEvent"): ProgressEvent; createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; createEvent(eventInterface:"StorageEvent"): StorageEvent; createEvent(eventInterface:"TextEvent"): TextEvent; @@ -12370,6 +12380,7 @@ interface DocumentEvent { createEvent(eventInterface:"TrackEvent"): TrackEvent; createEvent(eventInterface:"TransitionEvent"): TransitionEvent; createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; createEvent(eventInterface:"WheelEvent"): WheelEvent; diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index b81a3341a6c..fb0c64f8495 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -51,11 +51,41 @@ interface SymbolConstructor { isConcatSpreadable: symbol; /** - * A method that returns the default iterator for an object.Called by the semantics of the + * A method that returns the default iterator for an object. Called by the semantics of the * for-of statement. */ iterator: symbol; + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + split: symbol; + /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive * abstract operation. @@ -442,7 +472,7 @@ interface IteratorResult { } interface Iterator { - next(): IteratorResult; + next(value?: any): IteratorResult; return?(value?: any): IteratorResult; throw?(e?: any): IteratorResult; } @@ -3542,6 +3572,16 @@ declare module Reflect { function setPrototypeOf(target: any, proto: any): boolean; } +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; +} + /** * Represents the completion of an asynchronous operation */ @@ -3552,14 +3592,16 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: (value: T) => TResult | Promise, onrejected?: (reason: any) => TResult | Promise): Promise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: (reason: any) => T | Promise): Promise; + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; + + [Symbol.toStringTag]: string; } interface PromiseConstructor { @@ -3570,13 +3612,11 @@ interface PromiseConstructor { /** * Creates a new Promise. - * @param init A callback used to initialize the promise. This callback is passed two arguments: + * @param executor A callback used to initialize the promise. This callback is passed two arguments: * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; - - (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -3584,15 +3624,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: (T | Promise)[]): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of values. - * @returns A new Promise. - */ - all(values: Promise[]): Promise; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -3600,7 +3632,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: (T | Promise)[]): Promise; + race(values: Iterable>): Promise; /** * Creates a new rejected promise for the provided reason. @@ -3621,13 +3653,15 @@ interface PromiseConstructor { * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | Promise): Promise; + resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise . * @returns A resolved promise. */ resolve(): Promise; + + [Symbol.species]: Function; } declare var Promise: PromiseConstructor; diff --git a/src/lib/extensions.d.ts b/src/lib/extensions.d.ts index 8ce4198551d..8c67c7e826f 100644 --- a/src/lib/extensions.d.ts +++ b/src/lib/extensions.d.ts @@ -45,6 +45,139 @@ interface ArrayBufferView { byteOffset: number; } +interface DataView { + buffer: ArrayBuffer; + byteLength: number; + byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian: boolean): void; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare var DataView: DataViewConstructor; + /** * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested * number of bytes could not be allocated an exception is raised. diff --git a/src/server/client.ts b/src/server/client.ts index eab42abd0e1..3582d508322 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -300,6 +300,32 @@ module ts.server { }); } + getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] { + var lineOffset = this.positionToOneBasedLineOffset(fileName, position); + var args: protocol.FileLocationRequestArgs = { + file: fileName, + line: lineOffset.line, + offset: lineOffset.offset, + }; + + var request = this.processRequest(CommandNames.TypeDefinition, args); + var response = this.processResponse(request); + + return response.body.map(entry => { + var fileName = entry.file; + var start = this.lineOffsetToPosition(fileName, entry.start); + var end = this.lineOffsetToPosition(fileName, entry.end); + return { + containerKind: "", + containerName: "", + fileName: fileName, + textSpan: ts.createTextSpanFromBounds(start, end), + kind: "", + name: "" + }; + }); + } + findReferences(fileName: string, position: number): ReferencedSymbol[]{ // Not yet implemented. return []; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 8b4ab2cffa8..9c87a20c851 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -398,7 +398,7 @@ module ts.server { export class ProjectService { filenameToScriptInfo: ts.Map = {}; - // open, non-configured root files + // open, non-configured root files openFileRoots: ScriptInfo[] = []; // projects built from openFileRoots inferredProjects: Project[] = []; @@ -421,10 +421,10 @@ module ts.server { hostInfo: "Unknown host" } } - + getFormatCodeOptions(file?: string) { if (file) { - var info = this.filenameToScriptInfo[file]; + var info = this.filenameToScriptInfo[file]; if (info) { return info.formatCodeOptions; } @@ -448,7 +448,7 @@ module ts.server { } } } - + log(msg: string, type = "Err") { this.psLogger.msg(msg, type); } @@ -457,17 +457,17 @@ module ts.server { if (args.file) { var info = this.filenameToScriptInfo[args.file]; if (info) { - info.setFormatOptions(args.formatOptions); + info.setFormatOptions(args.formatOptions); this.log("Host configuration update for file " + args.file, "Info"); } } else { if (args.hostInfo !== undefined) { this.hostConfiguration.hostInfo = args.hostInfo; - this.log("Host information " + args.hostInfo, "Info"); + this.log("Host information " + args.hostInfo, "Info"); } if (args.formatOptions) { - mergeFormatOptions(this.hostConfiguration.formatCodeOptions, args.formatOptions); + mergeFormatOptions(this.hostConfiguration.formatCodeOptions, args.formatOptions); this.log("Format host information updated", "Info"); } } @@ -487,7 +487,7 @@ module ts.server { fileDeletedInFilesystem(info: ScriptInfo) { this.psLogger.info(info.fileName + " deleted"); - + if (info.fileWatcher) { info.fileWatcher.close(); info.fileWatcher = undefined; @@ -537,7 +537,7 @@ module ts.server { } return false; } - + addOpenFile(info: ScriptInfo) { if (this.setConfiguredProjectRoot(info)) { this.openFileRootsConfigured.push(info); @@ -561,7 +561,7 @@ module ts.server { copyListRemovingItem(r.defaultProject, this.inferredProjects); // put r in referenced open file list this.openFilesReferenced.push(r); - // set default project of r to the new project + // set default project of r to the new project r.defaultProject = info.defaultProject; } else { @@ -694,7 +694,7 @@ module ts.server { this.openFilesReferenced = openFilesReferenced; // Then, loop through all of the open files that are project roots. - // For each root file, note the project that it roots. Then see if + // For each root file, note the project that it roots. Then see if // any other projects newly reference the file. If zero projects // newly reference the file, keep it as a root. If one or more // projects newly references the file, remove its project from the @@ -719,7 +719,7 @@ module ts.server { // Finally, if we found any open, referenced files that are no longer // referenced by their default project, treat them as newly opened - // by the editor. + // by the editor. for (var i = 0, len = unattachedOpenFiles.length; i < len; i++) { this.addOpenFile(unattachedOpenFiles[i]); } @@ -750,6 +750,7 @@ module ts.server { if (content !== undefined) { var indentSize: number; info = new ScriptInfo(this.host, fileName, content, openedByClient); + info.setFormatOptions(this.getFormatCodeOptions()); this.filenameToScriptInfo[fileName] = info; if (!info.isOpen) { info.fileWatcher = this.host.watchFile(fileName, _ => { this.watchedFileChanged(fileName); }); @@ -772,7 +773,7 @@ module ts.server { findConfigFile(searchPath: string): string { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); - if (sys.fileExists(fileName)) { + if (this.host.fileExists(fileName)) { return fileName; } var parentPath = ts.getDirectoryPath(searchPath); @@ -808,7 +809,7 @@ module ts.server { } else { this.log("Opened configuration file " + configFileName,"Info"); - this.configuredProjects.push(configResult.project); + this.configuredProjects.push(configResult.project); } } var info = this.openFile(fileName, true); @@ -900,29 +901,29 @@ module ts.server { } return false; } - + openConfigFile(configFilename: string, clientFileName?: string): ProjectOpenResult { configFilename = ts.normalizePath(configFilename); // file references will be relative to dirPath (or absolute) var dirPath = ts.getDirectoryPath(configFilename); - var rawConfig = ts.readConfigFile(configFilename); - if (!rawConfig) { - return { errorMsg: "tsconfig syntax error" }; + var rawConfig: { config?: ProjectOptions; error?: Diagnostic; } = ts.readConfigFile(configFilename); + if (rawConfig.error) { + return rawConfig.error; } else { - var parsedCommandLine = ts.parseConfigFile(rawConfig, dirPath); + var parsedCommandLine = ts.parseConfigFile(rawConfig.config, ts.sys, dirPath); if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) { return { errorMsg: "tsconfig option errors" }; } else if (parsedCommandLine.fileNames) { - var projectOptions: ProjectOptions = { + var projectOptions: ProjectOptions = { files: parsedCommandLine.fileNames, compilerOptions: parsedCommandLine.options }; var proj = this.createProject(configFilename, projectOptions); for (var i = 0, len = parsedCommandLine.fileNames.length; i < len; i++) { var rootFilename = parsedCommandLine.fileNames[i]; - if (ts.sys.fileExists(rootFilename)) { + if (this.host.fileExists(rootFilename)) { var info = this.openFile(rootFilename, clientFileName == rootFilename); proj.addRoot(info); } @@ -1039,7 +1040,7 @@ module ts.server { startPath: LineCollection[]; endBranch: LineCollection[] = []; branchNode: LineNode; - // path to current node + // path to current node stack: LineNode[]; state = CharRangeSection.Entire; lineCollectionAtBranch: LineCollection; @@ -1241,7 +1242,7 @@ module ts.server { } } - // text change information + // text change information class TextChange { constructor(public pos: number, public deleteLen: number, public insertedText?: string) { } @@ -1289,7 +1290,7 @@ module ts.server { if (cb) cb(); } - + // reload whole script, leaving no change history behind reload reload(script: string) { this.currentVersion++; @@ -1299,7 +1300,7 @@ module ts.server { snap.index = new LineIndex(); var lm = LineIndex.linesFromText(script); snap.index.load(lm.lines); - // REVIEW: could use linked list + // REVIEW: could use linked list for (var i = this.minVersion; i < this.currentVersion; i++) { this.versions[i] = undefined; } @@ -1380,7 +1381,7 @@ module ts.server { return this.index.root.charCount(); } - // this requires linear space so don't hold on to these + // this requires linear space so don't hold on to these getLineStartPositions(): number[] { var starts: number[] = [-1]; var count = 1; @@ -1642,7 +1643,7 @@ module ts.server { } walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker) { - // assume (rangeStart < this.totalChars) && (rangeLength <= this.totalChars) + // assume (rangeStart < this.totalChars) && (rangeLength <= this.totalChars) var childIndex = 0; var child = this.children[0]; var childCharCount = child.charCount(); @@ -1728,7 +1729,7 @@ module ts.server { line: lineNumber, offset: charOffset } - } + } else if (childInfo.child.isLeaf()) { return { line: lineNumber, @@ -1916,4 +1917,4 @@ module ts.server { return 1; } } -} \ No newline at end of file +} diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 5bc1ffbe4dc..b95d5e99864 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -125,6 +125,14 @@ declare module ts.server.protocol { export interface DefinitionRequest extends FileLocationRequest { } + /** + * Go to type request; value of command field is + * "typeDefinition". Return response giving the file locations that + * define the type for the symbol found in file at location line, col. + */ + export interface TypeDefinitionRequest extends FileLocationRequest { + } + /** * Location in source code expressed as (one-based) line and character offset. */ @@ -165,6 +173,13 @@ declare module ts.server.protocol { body?: FileSpan[]; } + /** + * Definition response message. Gives text range for definition. + */ + export interface TypeDefinitionResponse extends Response { + body?: FileSpan[]; + } + /** * Get occurrences request; value of command field is * "occurrences". Return response giving spans that are relevant diff --git a/src/server/session.ts b/src/server/session.ts index 52d33234636..baf0a085ad4 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -97,6 +97,7 @@ module ts.server { export var Rename = "rename"; export var Saveto = "saveto"; export var SignatureHelp = "signatureHelp"; + export var TypeDefinition = "typeDefinition"; export var Unknown = "unknown"; } @@ -285,7 +286,29 @@ module ts.server { })); } - getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[] { + getTypeDefinition(line: number, offset: number, fileName: string): protocol.FileSpan[] { + var file = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(file); + if (!project) { + throw Errors.NoProject; + } + + var compilerService = project.compilerService; + var position = compilerService.host.lineOffsetToPosition(file, line, offset); + + var definitions = compilerService.languageService.getTypeDefinitionAtPosition(file, position); + if (!definitions) { + return undefined; + } + + return definitions.map(def => ({ + file: def.fileName, + start: compilerService.host.positionToLineOffset(def.fileName, def.textSpan.start), + end: compilerService.host.positionToLineOffset(def.fileName, ts.textSpanEnd(def.textSpan)) + })); + } + + getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[]{ fileName = ts.normalizePath(fileName); let project = this.projectService.getProjectForFile(fileName); @@ -519,7 +542,7 @@ module ts.server { IndentSize: formatOptions.IndentSize, TabSize: formatOptions.TabSize, NewLineCharacter: "\n", - ConvertTabsToSpaces: true, + ConvertTabsToSpaces: formatOptions.ConvertTabsToSpaces, }; var indentPosition = compilerService.languageService.getIndentationAtPosition(file, position, editorOptions); @@ -817,6 +840,11 @@ module ts.server { response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); break; } + case CommandNames.TypeDefinition: { + var defArgs = request.arguments; + response = this.getTypeDefinition(defArgs.line, defArgs.offset, defArgs.file); + break; + } case CommandNames.References: { var refArgs = request.arguments; response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file); diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index caed0582c33..41079c08201 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -401,8 +401,8 @@ module ts.BreakpointResolver { if (forStatement.condition) { return textSpan(forStatement.condition); } - if (forStatement.iterator) { - return textSpan(forStatement.iterator); + if (forStatement.incrementor) { + return textSpan(forStatement.incrementor); } } @@ -446,14 +446,14 @@ module ts.BreakpointResolver { // fall through. case SyntaxKind.CatchClause: - return spanInNode((node.parent).statements[(node.parent).statements.length - 1]);; + return spanInNode(lastOrUndefined((node.parent).statements));; case SyntaxKind.CaseBlock: // breakpoint in last statement of the last clause let caseBlock = node.parent; - let lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; + let lastClause = lastOrUndefined(caseBlock.clauses); if (lastClause) { - return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + return spanInNode(lastOrUndefined(lastClause.statements)); } return undefined; diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 751f1a94027..ef25d23a5c9 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -323,6 +323,9 @@ module ts.formatting { let previousParent: Node; let previousRangeStartLine: number; + let lastIndentedLine: number; + let indentationOnLastIndentedLine: number; + let edits: TextChange[] = []; formattingScanner.advance(); @@ -416,7 +419,9 @@ module ts.formatting { // if node is located on the same line with the parent // - inherit indentation from the parent // - push children if either parent of node itself has non-zero delta - indentation = parentDynamicIndentation.getIndentation(); + indentation = startLine === lastIndentedLine + ? indentationOnLastIndentedLine + : parentDynamicIndentation.getIndentation(); delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { @@ -716,7 +721,6 @@ module ts.formatting { continue; } - let triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { case SyntaxKind.MultiLineCommentTrivia: let commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); @@ -741,6 +745,9 @@ module ts.formatting { if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { let tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + + lastIndentedLine = tokenStart.line; + indentationOnLastIndentedLine = tokenIndentation; } } diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts index 388d9428ffc..e09b5dfba92 100644 --- a/src/services/formatting/formattingScanner.ts +++ b/src/services/formatting/formattingScanner.ts @@ -51,7 +51,7 @@ module ts.formatting { if (isStarted) { if (trailingTrivia) { Debug.assert(trailingTrivia.length !== 0); - wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === SyntaxKind.NewLineTrivia; + wasNewLine = lastOrUndefined(trailingTrivia).kind === SyntaxKind.NewLineTrivia; } else { wasNewLine = false; diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 73b586e3706..0b6a6ad0bdc 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -312,7 +312,7 @@ module ts.formatting { this.NoSpaceAfterModuleImport = new Rule(RuleDescriptor.create2(Shared.TokenRange.FromTokens([SyntaxKind.ModuleKeyword, SyntaxKind.RequireKeyword]), SyntaxKind.OpenParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new Rule(RuleDescriptor.create4(Shared.TokenRange.FromTokens([SyntaxKind.ClassKeyword, SyntaxKind.DeclareKeyword, SyntaxKind.EnumKeyword, SyntaxKind.ExportKeyword, SyntaxKind.ExtendsKeyword, SyntaxKind.GetKeyword, SyntaxKind.ImplementsKeyword, SyntaxKind.ImportKeyword, SyntaxKind.InterfaceKeyword, SyntaxKind.ModuleKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.PublicKeyword, SyntaxKind.SetKeyword, SyntaxKind.StaticKeyword]), Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); + this.SpaceAfterCertainTypeScriptKeywords = new Rule(RuleDescriptor.create4(Shared.TokenRange.FromTokens([SyntaxKind.ClassKeyword, SyntaxKind.DeclareKeyword, SyntaxKind.EnumKeyword, SyntaxKind.ExportKeyword, SyntaxKind.ExtendsKeyword, SyntaxKind.GetKeyword, SyntaxKind.ImplementsKeyword, SyntaxKind.ImportKeyword, SyntaxKind.InterfaceKeyword, SyntaxKind.ModuleKeyword, SyntaxKind.NamespaceKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.PublicKeyword, SyntaxKind.SetKeyword, SyntaxKind.StaticKeyword]), Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); this.SpaceBeforeCertainTypeScriptKeywords = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.ExtendsKeyword, SyntaxKind.ImplementsKeyword])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { @@ -458,7 +458,11 @@ module ts.formatting { case SyntaxKind.BinaryExpression: case SyntaxKind.ConditionalExpression: return true; - + + // equals in binding elements: function foo([[x, y] = [1, 2]]) + case SyntaxKind.BindingElement: + // equals in type X = ... + case SyntaxKind.TypeAliasDeclaration: // equal in import a = module('a'); case SyntaxKind.ImportEqualsDeclaration: // equal in let a = 0; @@ -475,8 +479,6 @@ module ts.formatting { // Technically, "of" is not a binary operator, but format it the same way as "in" case SyntaxKind.ForOfStatement: return context.currentTokenSpan.kind === SyntaxKind.OfKeyword || context.nextTokenSpan.kind === SyntaxKind.OfKeyword; - case SyntaxKind.BindingElement: - return context.currentTokenSpan.kind === SyntaxKind.EqualsToken || context.nextTokenSpan.kind === SyntaxKind.EqualsToken; } return false; } diff --git a/src/services/services.ts b/src/services/services.ts index 92610969722..ede6fb8ca7b 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1001,6 +1001,8 @@ module ts { findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; findReferences(fileName: string, position: number): ReferencedSymbol[]; getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; @@ -1630,7 +1632,7 @@ module ts { private fileNameToEntry: Map; private _compilationSettings: CompilerOptions; - constructor(private host: LanguageServiceHost) { + constructor(private host: LanguageServiceHost, private getCanonicalFileName: (fileName: string) => string) { // script id => script index this.fileNameToEntry = {}; @@ -1648,6 +1650,10 @@ module ts { return this._compilationSettings; } + private normalizeFileName(fileName: string): string { + return this.getCanonicalFileName(normalizeSlashes(fileName)); + } + private createEntry(fileName: string) { let entry: HostFileInformation; let scriptSnapshot = this.host.getScriptSnapshot(fileName); @@ -1659,15 +1665,15 @@ module ts { }; } - return this.fileNameToEntry[normalizeSlashes(fileName)] = entry; + return this.fileNameToEntry[this.normalizeFileName(fileName)] = entry; } - public getEntry(fileName: string): HostFileInformation { - return lookUp(this.fileNameToEntry, normalizeSlashes(fileName)); + private getEntry(fileName: string): HostFileInformation { + return lookUp(this.fileNameToEntry, this.normalizeFileName(fileName)); } - public contains(fileName: string): boolean { - return hasProperty(this.fileNameToEntry, normalizeSlashes(fileName)); + private contains(fileName: string): boolean { + return hasProperty(this.fileNameToEntry, this.normalizeFileName(fileName)); } public getOrCreateEntry(fileName: string): HostFileInformation { @@ -1682,8 +1688,10 @@ module ts { let fileNames: string[] = []; forEachKey(this.fileNameToEntry, key => { - if (hasProperty(this.fileNameToEntry, key) && this.fileNameToEntry[key]) - fileNames.push(key); + let entry = this.getEntry(key); + if (entry) { + fileNames.push(entry.hostFileName); + } }); return fileNames; @@ -2385,7 +2393,7 @@ module ts { function synchronizeHostData(): void { // Get a fresh cache of the host information - let hostCache = new HostCache(host); + let hostCache = new HostCache(host, getCanonicalFileName); // If the program is already up-to-date, we can reuse it if (programUpToDate()) { @@ -2406,7 +2414,7 @@ module ts { let newProgram = createProgram(hostCache.getRootFileNames(), newSettings, { getSourceFile: getOrCreateSourceFile, getCancellationToken: () => cancellationToken, - getCanonicalFileName: (fileName) => useCaseSensitivefileNames ? fileName : fileName.toLowerCase(), + getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitivefileNames, getNewLine: () => host.getNewLine ? host.getNewLine() : "\r\n", getDefaultLibFileName: (options) => host.getDefaultLibFileName(options), @@ -3033,7 +3041,8 @@ module ts { case SyntaxKind.OpenBracketToken: return containingNodeKind === SyntaxKind.ArrayLiteralExpression; // [ | - case SyntaxKind.ModuleKeyword: // module | + case SyntaxKind.ModuleKeyword: // module | + case SyntaxKind.NamespaceKeyword: // namespace | return true; case SyntaxKind.DotToken: @@ -3501,19 +3510,6 @@ module ts { return ScriptElementKind.unknown; } - function getTypeKind(type: Type): string { - let flags = type.getFlags(); - - if (flags & TypeFlags.Enum) return ScriptElementKind.enumElement; - if (flags & TypeFlags.Class) return ScriptElementKind.classElement; - if (flags & TypeFlags.Interface) return ScriptElementKind.interfaceElement; - if (flags & TypeFlags.TypeParameter) return ScriptElementKind.typeParameterElement; - if (flags & TypeFlags.Intrinsic) return ScriptElementKind.primitiveType; - if (flags & TypeFlags.StringLiteral) return ScriptElementKind.primitiveType; - - return ScriptElementKind.unknown; - } - function getSymbolModifiers(symbol: Symbol): string { return symbol && symbol.declarations && symbol.declarations.length > 0 ? getNodeModifiers(symbol.declarations[0]) @@ -3686,7 +3682,9 @@ module ts { } if (symbolFlags & SymbolFlags.Module) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(SyntaxKind.ModuleKeyword)); + let declaration = getDeclarationOfKind(symbol, SyntaxKind.ModuleDeclaration); + let isNamespace = declaration && declaration.name && declaration.name.kind === SyntaxKind.Identifier; + displayParts.push(keywordPart(isNamespace ? SyntaxKind.NamespaceKeyword : SyntaxKind.ModuleKeyword)); displayParts.push(spacePart()); addFullSymbolName(symbol); } @@ -3926,6 +3924,71 @@ module ts { }; } + function getDefinitionFromSymbol(symbol: Symbol, node: Node): DefinitionInfo[] { + let typeChecker = program.getTypeChecker(); + let result: DefinitionInfo[] = []; + let declarations = symbol.getDeclarations(); + let symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + let symbolKind = getSymbolKind(symbol, node); + let containerSymbol = symbol.parent; + let containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; + + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && + !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + // Just add all the declarations. + forEach(declarations, declaration => { + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + }); + } + + return result; + + function tryAddConstructSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { + // Applicable only if we are in a new expression, or we are on a constructor declaration + // and in either case the symbol has a construct signature definition, i.e. class + if (isNewExpressionTarget(location) || location.kind === SyntaxKind.ConstructorKeyword) { + if (symbol.flags & SymbolFlags.Class) { + let classDeclaration = symbol.getDeclarations()[0]; + Debug.assert(classDeclaration && classDeclaration.kind === SyntaxKind.ClassDeclaration); + + return tryAddSignature(classDeclaration.members, /*selectConstructors*/ true, symbolKind, symbolName, containerName, result); + } + } + return false; + } + + function tryAddCallSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { + if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { + return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); + } + return false; + } + + function tryAddSignature(signatureDeclarations: Declaration[], selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { + let declarations: Declaration[] = []; + let definition: Declaration; + + forEach(signatureDeclarations, d => { + if ((selectConstructors && d.kind === SyntaxKind.Constructor) || + (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.MethodDeclaration || d.kind === SyntaxKind.MethodSignature))) { + declarations.push(d); + if ((d).body) definition = d; + } + }); + + if (definition) { + result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); + return true; + } + else if (declarations.length) { + result.push(createDefinitionInfo(lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + return true; + } + + return false; + } + } + /// Goto definition function getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] { synchronizeHostData(); @@ -4000,67 +4063,47 @@ module ts { declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); } - let result: DefinitionInfo[] = []; - let declarations = symbol.getDeclarations(); - let symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol - let symbolKind = getSymbolKind(symbol, node); - let containerSymbol = symbol.parent; - let containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; + return getDefinitionFromSymbol(symbol, node); + } - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - forEach(declarations, declaration => { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); + /// Goto type + function getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] { + synchronizeHostData(); + + let sourceFile = getValidSourceFile(fileName); + + let node = getTouchingPropertyName(sourceFile, position); + if (!node) { + return undefined; } - return result; + let typeChecker = program.getTypeChecker(); - function tryAddConstructSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { - // Applicable only if we are in a new expression, or we are on a constructor declaration - // and in either case the symbol has a construct signature definition, i.e. class - if (isNewExpressionTarget(location) || location.kind === SyntaxKind.ConstructorKeyword) { - if (symbol.flags & SymbolFlags.Class) { - let classDeclaration = symbol.getDeclarations()[0]; - Debug.assert(classDeclaration && classDeclaration.kind === SyntaxKind.ClassDeclaration); - - return tryAddSignature(classDeclaration.members, /*selectConstructors*/ true, symbolKind, symbolName, containerName, result); - } - } - return false; + let symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + return undefined; } - function tryAddCallSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); - } - return false; + let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + if (!type) { + return undefined; } - function tryAddSignature(signatureDeclarations: Declaration[], selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { - let declarations: Declaration[] = []; - let definition: Declaration; - - forEach(signatureDeclarations, d => { - if ((selectConstructors && d.kind === SyntaxKind.Constructor) || - (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.MethodDeclaration || d.kind === SyntaxKind.MethodSignature))) { - declarations.push(d); - if ((d).body) definition = d; + if (type.flags & TypeFlags.Union) { + var result: DefinitionInfo[] = []; + forEach((type).types, t => { + if (t.symbol) { + result.push(...getDefinitionFromSymbol(t.symbol, node)); } }); - - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(createDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - - return false; + return result; } + + if (!type.symbol) { + return undefined; + } + + return getDefinitionFromSymbol(type.symbol, node); } function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { @@ -5412,7 +5455,7 @@ module ts { } return; - function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) { + function getPropertySymbolFromTypeReference(typeReference: ExpressionWithTypeArguments) { if (typeReference) { let type = typeChecker.getTypeAtLocation(typeReference); if (type) { @@ -5673,7 +5716,7 @@ module ts { node = node.parent; } - return node.parent.kind === SyntaxKind.TypeReference || node.parent.kind === SyntaxKind.HeritageClauseElement; + return node.parent.kind === SyntaxKind.TypeReference || node.parent.kind === SyntaxKind.ExpressionWithTypeArguments; } function isNamespaceReference(node: Node): boolean { @@ -5691,7 +5734,7 @@ module ts { isLastClause = (root).name === node; } - if (!isLastClause && root.parent.kind === SyntaxKind.HeritageClauseElement && root.parent.parent.kind === SyntaxKind.HeritageClause) { + if (!isLastClause && root.parent.kind === SyntaxKind.ExpressionWithTypeArguments && root.parent.parent.kind === SyntaxKind.HeritageClause) { let decl = root.parent.parent.parent; return (decl.kind === SyntaxKind.ClassDeclaration && (root.parent.parent).token === SyntaxKind.ImplementsKeyword) || (decl.kind === SyntaxKind.InterfaceDeclaration && (root.parent.parent).token === SyntaxKind.ExtendsKeyword); @@ -6493,6 +6536,7 @@ module ts { getSignatureHelpItems, getQuickInfoAtPosition, getDefinitionAtPosition, + getTypeDefinitionAtPosition, getReferencesAtPosition, findReferences, getOccurrencesAtPosition, diff --git a/src/services/shims.ts b/src/services/shims.ts index 62606b741e6..dc19b8eb79b 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -1,6 +1,6 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -57,6 +57,12 @@ module ts { getNewLine?(): string; } + /** Public interface of the the of a config service shim instance.*/ + export interface CoreServicesShimHost extends Logger { + /** Returns a JSON-encoded value of the type: string[] */ + readDirectory(rootDir: string, extension: string): string; + } + /// /// Pre-processing /// @@ -126,12 +132,20 @@ module ts { */ getDefinitionAtPosition(fileName: string, position: number): string; + /** + * Returns a JSON-encoded value of the type: + * { fileName: string; textSpan: { start: number; length: number}; kind: string; name: string; containerKind: string; containerName: string } + * + * Or undefined value if no definition can be found. + */ + getTypeDefinitionAtPosition(fileName: string, position: number): string; + /** * Returns a JSON-encoded value of the type: * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] */ getReferencesAtPosition(fileName: string, position: number): string; - + /** * Returns a JSON-encoded value of the type: * { definition: ; references: [] }[] @@ -148,8 +162,8 @@ module ts { /** * Returns a JSON-encoded value of the type: * { fileName: string; highlights: { start: number; length: number, isDefinition: boolean }[] }[] - * - * @param fileToSearch A JSON encoded string[] containing the file names that should be + * + * @param fileToSearch A JSON encoded string[] containing the file names that should be * considered when searching. */ getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string; @@ -191,6 +205,7 @@ module ts { export interface CoreServicesShim extends Shim { getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string; + getTSConfigFileInfo(fileName: string, sourceText: IScriptSnapshot): string; getDefaultCompilationSettings(): string; } @@ -229,7 +244,7 @@ module ts { export class LanguageServiceShimHostAdapter implements LanguageServiceHost { private files: string[]; - + constructor(private shimHost: LanguageServiceShimHost) { } @@ -240,7 +255,7 @@ module ts { public trace(s: string): void { this.shimHost.trace(s); } - + public error(s: string): void { this.shimHost.error(s); } @@ -308,6 +323,17 @@ module ts { } } + export class CoreServicesShimHostAdapter implements ParseConfigHost { + + constructor(private shimHost: CoreServicesShimHost) { + } + + public readDirectory(rootDir: string, extension: string): string[] { + var encoded = this.shimHost.readDirectory(rootDir, extension); + return JSON.parse(encoded); + } + } + function simpleForwardCall(logger: Logger, actionDescription: string, action: () => any, noPerfLogging: boolean): any { if (!noPerfLogging) { logger.log(actionDescription); @@ -561,7 +587,7 @@ module ts { /** * Computes the definition location and file for the symbol - * at the requested position. + * at the requested position. */ public getDefinitionAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( @@ -571,6 +597,20 @@ module ts { }); } + /// GOTO Type + + /** + * Computes the definition location of the type of the symbol + * at the requested position. + */ + public getTypeDefinitionAtPosition(fileName: string, position: number): string { + return this.forwardJSONCall( + "getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", + () => { + return this.languageService.getTypeDefinitionAtPosition(fileName, position); + }); + } + public getRenameInfo(fileName: string, position: number): string { return this.forwardJSONCall( "getRenameInfo('" + fileName + "', " + position + ")", @@ -644,8 +684,8 @@ module ts { /// COMPLETION LISTS /** - * Get a string based representation of the completions - * to provide at the given source position and providing a member completion + * Get a string based representation of the completions + * to provide at the given source position and providing a member completion * list if requested. */ public getCompletionsAtPosition(fileName: string, position: number) { @@ -783,7 +823,8 @@ module ts { } class CoreServicesShimObject extends ShimBase implements CoreServicesShim { - constructor(factory: ShimFactory, public logger: Logger) { + + constructor(factory: ShimFactory, public logger: Logger, private host: CoreServicesShimHostAdapter) { super(factory); } @@ -821,6 +862,32 @@ module ts { }); } + public getTSConfigFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string { + return this.forwardJSONCall( + "getTSConfigFileInfo('" + fileName + "')", + () => { + let text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); + + let result = parseConfigFileText(fileName, text); + + if (result.error) { + return { + options: {}, + files: [], + errors: [realizeDiagnostic(result.error, '\r\n')] + }; + } + + var configFile = parseConfigFile(result.config, this.host, getDirectoryPath(normalizeSlashes(fileName))); + + return { + options: configFile.options, + files: configFile.fileNames, + errors: [realizeDiagnostics(configFile.errors, '\r\n')] + }; + }); + } + public getDefaultCompilationSettings(): string { return this.forwardJSONCall( "getDefaultCompilationSettings()", @@ -863,12 +930,13 @@ module ts { } } - public createCoreServicesShim(logger: Logger): CoreServicesShim { + public createCoreServicesShim(host: CoreServicesShimHost): CoreServicesShim { try { - return new CoreServicesShimObject(this, logger); + var adapter = new CoreServicesShimHostAdapter(host); + return new CoreServicesShimObject(this, host, adapter); } catch (err) { - logInternalError(logger, err); + logInternalError(host, err); throw err; } } @@ -911,4 +979,4 @@ module TypeScript.Services { } /* @internal */ -const toolsVersion = "1.5"; +let toolsVersion = "1.4"; diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index 296e65965d5..5dcee789243 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -18,11 +18,14 @@ "../compiler/checker.ts", "../compiler/emitter.ts", "../compiler/program.ts", - "../compiler/commandLineParser.ts", + "../compiler/declarationEmitter.ts", "../compiler/diagnosticInformationMap.generated.ts", + "../compiler/commandLineParser.ts", "breakpoints.ts", + "navigateTo.ts", "navigationBar.ts", "outliningElementsCollector.ts", + "patternMatcher.ts", "services.ts", "shims.ts", "signatureHelp.ts", diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 5e1460bbdcd..f2074d43ec9 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -200,7 +200,7 @@ module ts { function nodeEndsWith(n: Node, expectedLastToken: SyntaxKind, sourceFile: SourceFile): boolean { let children = n.getChildren(sourceFile); if (children.length) { - let last = children[children.length - 1]; + let last = lastOrUndefined(children); if (last.kind === expectedLastToken) { return true; } diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index 17061add038..cd2df23ffbf 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -75,26 +75,26 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 186 /* ForStatement */: - case 187 /* ForInStatement */: - case 185 /* WhileStatement */: - case 184 /* DoStatement */: - if (node.statement.kind !== 179 /* Block */) { + case 187 /* ForStatement */: + case 188 /* ForInStatement */: + case 186 /* WhileStatement */: + case 185 /* DoStatement */: + if (node.statement.kind !== 180 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 183 /* IfStatement */: + case 184 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 179 /* Block */) { + if (ifStatement.thenStatement.kind !== 180 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } if (ifStatement.elseStatement && - ifStatement.elseStatement.kind !== 179 /* Block */ && - ifStatement.elseStatement.kind !== 183 /* IfStatement */) { + ifStatement.elseStatement.kind !== 180 /* Block */ && + ifStatement.elseStatement.kind !== 184 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 169 /* BinaryExpression */: + case 170 /* BinaryExpression */: var op = node.operatorToken.kind; if (op === 28 /* EqualsEqualsToken */ || op == 29 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt index 4c707dfd861..6e65d46b9be 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged ==== tests/cases/conformance/internalModules/DeclarationMerging/class.ts (0 errors) ==== @@ -17,7 +17,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): erro module X.Y { export module Point { ~~~~~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var Origin = new Point(0, 0); } } diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt index 4c707dfd861..6e65d46b9be 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged ==== tests/cases/conformance/internalModules/DeclarationMerging/class.ts (0 errors) ==== @@ -17,7 +17,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): erro module X.Y { export module Point { ~~~~~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var Origin = new Point(0, 0); } } diff --git a/tests/baselines/reference/ExportAssignment7.errors.txt b/tests/baselines/reference/ExportAssignment7.errors.txt index b72ca2d4a72..83651e10b8e 100644 --- a/tests/baselines/reference/ExportAssignment7.errors.txt +++ b/tests/baselines/reference/ExportAssignment7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/ExportAssignment7.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/ExportAssignment7.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. tests/cases/compiler/ExportAssignment7.ts(4,10): error TS2304: Cannot find name 'B'. @@ -6,7 +6,7 @@ tests/cases/compiler/ExportAssignment7.ts(4,10): error TS2304: Cannot find name ==== tests/cases/compiler/ExportAssignment7.ts (3 errors) ==== export class C { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. } export = B; diff --git a/tests/baselines/reference/ExportAssignment8.errors.txt b/tests/baselines/reference/ExportAssignment8.errors.txt index 4536f37bb81..d1a285cfe51 100644 --- a/tests/baselines/reference/ExportAssignment8.errors.txt +++ b/tests/baselines/reference/ExportAssignment8.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/ExportAssignment8.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/ExportAssignment8.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. tests/cases/compiler/ExportAssignment8.ts(1,10): error TS2304: Cannot find name 'B'. @@ -6,7 +6,7 @@ tests/cases/compiler/ExportAssignment8.ts(1,10): error TS2304: Cannot find name ==== tests/cases/compiler/ExportAssignment8.ts (3 errors) ==== export = B; ~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~~~~~ !!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~ diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index bfa243937d6..ec30d5b4dc7 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -21,7 +21,7 @@ module A { //// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index 71a43788c55..4d296bf9ea5 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -25,7 +25,7 @@ module A { //// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt index df266681812..4f08e30cd46 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. @@ -14,7 +14,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T module A { export module Point { ~~~~~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var Origin = { x: 0, y: 0 }; } } diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt index 15a0e5b4334..ca840a719c0 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged -tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(1,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(1,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged ==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (1 errors) ==== module X.Y { export module Point { ~~~~~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var Origin = new Point(0, 0); } } @@ -27,7 +27,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(1,8): error ==== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts (1 errors) ==== module A { ~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged export var Instance = new A(); } diff --git a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt index 7c521c8be95..963ddf1ef93 100644 --- a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged -tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(3,19): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(3,19): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged ==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (1 errors) ==== module A { export module Point { ~~~~~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var Origin = { x: 0, y: 0 }; } } @@ -24,7 +24,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(3,19): erro export module Point { ~~~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged export var Origin = { x: 0, y: 0 }; } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt index 8a4962c23c7..fefdcd8f6f5 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/internalModules/DeclarationMerging/part1.ts(1,15): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/internalModules/DeclarationMerging/part1.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(3,24): error TS2304: Cannot find name 'Point'. tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,36): error TS2304: Cannot find name 'Point'. tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,54): error TS2304: Cannot find name 'Point'. @@ -7,7 +7,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,54): error ==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (1 errors) ==== export module A { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export interface Point { x: number; y: number; diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index b6817ed7621..f6d3f29f1ab 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -16,7 +16,7 @@ class ColoredPoint extends Point { //// [accessOverriddenBaseClassMember1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.js b/tests/baselines/reference/accessors_spec_section-4.5_inference.js index 9aa7ce2f408..8b75e27031a 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -25,7 +25,7 @@ class LanguageSpec_section_4_5_inference { } //// [accessors_spec_section-4.5_inference.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasErrors.errors.txt b/tests/baselines/reference/aliasErrors.errors.txt index ffc114f80e3..c74649618ba 100644 --- a/tests/baselines/reference/aliasErrors.errors.txt +++ b/tests/baselines/reference/aliasErrors.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/aliasErrors.ts(11,12): error TS2304: Cannot find name 'no'. -tests/cases/compiler/aliasErrors.ts(12,13): error TS2304: Cannot find name 'no'. +tests/cases/compiler/aliasErrors.ts(11,12): error TS2503: Cannot find namespace 'no'. +tests/cases/compiler/aliasErrors.ts(12,13): error TS2503: Cannot find namespace 'no'. tests/cases/compiler/aliasErrors.ts(13,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(14,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(15,12): error TS1003: Identifier expected. -tests/cases/compiler/aliasErrors.ts(16,12): error TS2304: Cannot find name 'undefined'. +tests/cases/compiler/aliasErrors.ts(16,12): error TS2503: Cannot find namespace 'undefined'. tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. @@ -20,10 +20,10 @@ tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' h import m = no; ~~ -!!! error TS2304: Cannot find name 'no'. +!!! error TS2503: Cannot find namespace 'no'. import m2 = no.mod; ~~ -!!! error TS2304: Cannot find name 'no'. +!!! error TS2503: Cannot find namespace 'no'. import n = 5; ~ !!! error TS1003: Identifier expected. @@ -35,7 +35,7 @@ tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' h !!! error TS1003: Identifier expected. import r = undefined; ~~~~~~~~~ -!!! error TS2304: Cannot find name 'undefined'. +!!! error TS2503: Cannot find namespace 'undefined'. var p = new provide.Provide(); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index 485aedc971d..06c8b55e23d 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -35,7 +35,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsage1_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index 5712abf3443..e5d44320c7d 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -29,7 +29,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInArray_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index 661c8fd91e7..b7b95661ac8 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -28,7 +28,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInFunctionExpression_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index 1070036adea..856e6ddb43e 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -32,7 +32,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInGenericFunction_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index 7b2907681e0..e05f5e4f5cd 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -34,7 +34,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInIndexerOfClass_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index 50ccfaf944d..cc4b8273e84 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -29,7 +29,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInObjectLiteral_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index 07a382ebca1..f382ee2f617 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -32,7 +32,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInOrExpression_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 7161d065528..39ff58a5322 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -32,7 +32,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInTypeArgumentOfExtendsClause_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -48,7 +48,7 @@ var VisualizationModel = (function (_super) { })(Backbone.Model); exports.VisualizationModel = VisualizationModel; //// [aliasUsageInTypeArgumentOfExtendsClause_main.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index 31d976f6ef2..2de34f00566 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -28,7 +28,7 @@ var Model = (function () { })(); exports.Model = Model; //// [aliasUsageInVarAssignment_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/ambientDeclarationsExternal.errors.txt b/tests/baselines/reference/ambientDeclarationsExternal.errors.txt index 124bf928699..d05dfe813fd 100644 --- a/tests/baselines/reference/ambientDeclarationsExternal.errors.txt +++ b/tests/baselines/reference/ambientDeclarationsExternal.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/ambient/consumer.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/ambient/consumer.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/ambient/consumer.ts (1 errors) ==== /// import imp1 = require('equ'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. // Ambient external module members are always exported with or without export keyword when module lacks export assignment diff --git a/tests/baselines/reference/ambientEnumDeclaration1.errors.txt b/tests/baselines/reference/ambientEnumDeclaration1.errors.txt new file mode 100644 index 00000000000..419f7e184ac --- /dev/null +++ b/tests/baselines/reference/ambientEnumDeclaration1.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(5,5): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(6,5): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(7,5): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(8,5): error TS1066: Ambient enum elements can only have integer literal initializers. + + +==== tests/cases/conformance/ambient/ambientEnumDeclaration1.ts (4 errors) ==== + // In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. + + declare enum E { + a = 10, + b = 10 + 1, + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + c = b, + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + d = (c) + 1, + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + e = 10 << 2 * 8, + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientEnumDeclaration1.js b/tests/baselines/reference/ambientEnumDeclaration1.js new file mode 100644 index 00000000000..dcdb100e906 --- /dev/null +++ b/tests/baselines/reference/ambientEnumDeclaration1.js @@ -0,0 +1,13 @@ +//// [ambientEnumDeclaration1.ts] +// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. + +declare enum E { + a = 10, + b = 10 + 1, + c = b, + d = (c) + 1, + e = 10 << 2 * 8, +} + +//// [ambientEnumDeclaration1.js] +// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. diff --git a/tests/baselines/reference/ambientEnumDeclaration2.js b/tests/baselines/reference/ambientEnumDeclaration2.js new file mode 100644 index 00000000000..8ef6facfe6d --- /dev/null +++ b/tests/baselines/reference/ambientEnumDeclaration2.js @@ -0,0 +1,17 @@ +//// [ambientEnumDeclaration2.ts] +// In ambient enum declarations that specify no const modifier, enum member declarations +// that omit a value are considered computed members (as opposed to having auto- incremented values assigned). + +declare enum E { + a, // E.a + b, // E.b +} + +declare const enum E1 { + a, // E.a = 0 + b, // E.b = 1 +} + +//// [ambientEnumDeclaration2.js] +// In ambient enum declarations that specify no const modifier, enum member declarations +// that omit a value are considered computed members (as opposed to having auto- incremented values assigned). diff --git a/tests/baselines/reference/ambientEnumDeclaration2.symbols b/tests/baselines/reference/ambientEnumDeclaration2.symbols new file mode 100644 index 00000000000..7c4975f5878 --- /dev/null +++ b/tests/baselines/reference/ambientEnumDeclaration2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/ambient/ambientEnumDeclaration2.ts === +// In ambient enum declarations that specify no const modifier, enum member declarations +// that omit a value are considered computed members (as opposed to having auto- incremented values assigned). + +declare enum E { +>E : Symbol(E, Decl(ambientEnumDeclaration2.ts, 0, 0)) + + a, // E.a +>a : Symbol(E.a, Decl(ambientEnumDeclaration2.ts, 3, 16)) + + b, // E.b +>b : Symbol(E.b, Decl(ambientEnumDeclaration2.ts, 4, 6)) +} + +declare const enum E1 { +>E1 : Symbol(E1, Decl(ambientEnumDeclaration2.ts, 6, 1)) + + a, // E.a = 0 +>a : Symbol(E1.a, Decl(ambientEnumDeclaration2.ts, 8, 23)) + + b, // E.b = 1 +>b : Symbol(E1.b, Decl(ambientEnumDeclaration2.ts, 9, 6)) +} diff --git a/tests/baselines/reference/ambientEnumDeclaration2.types b/tests/baselines/reference/ambientEnumDeclaration2.types new file mode 100644 index 00000000000..af66e4ac0c5 --- /dev/null +++ b/tests/baselines/reference/ambientEnumDeclaration2.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/ambient/ambientEnumDeclaration2.ts === +// In ambient enum declarations that specify no const modifier, enum member declarations +// that omit a value are considered computed members (as opposed to having auto- incremented values assigned). + +declare enum E { +>E : E + + a, // E.a +>a : E + + b, // E.b +>b : E +} + +declare const enum E1 { +>E1 : E1 + + a, // E.a = 0 +>a : E1 + + b, // E.b = 1 +>b : E1 +} diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index a741536e078..16ce79a05dd 100644 --- a/tests/baselines/reference/ambientErrors.errors.txt +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -11,8 +11,8 @@ tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializ tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1184: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1184: An implementation cannot be declared in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient external module declaration cannot specify relative module name. +tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name. tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements. @@ -91,13 +91,13 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export module M2 { declare module 'nope' { } ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } // Ambient external module with a string literal name that isn't a top level external module name declare module '../foo' { } ~~~~~~~~ -!!! error TS2436: Ambient external module declaration cannot specify relative module name. +!!! error TS2436: Ambient module declaration cannot specify relative module name. // Ambient external module with export assignment and other exported members declare module 'bar' { diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt index fb988131df0..79f37c4764e 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find external module 'ext'. +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find module 'ext'. ==== tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts (2 errors) ==== @@ -9,12 +9,12 @@ tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): err declare module "ext" { ~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export class C { } } // Cannot resolve this ext module reference import ext = require("ext"); ~~~~~ -!!! error TS2307: Cannot find external module 'ext'. +!!! error TS2307: Cannot find module 'ext'. var x = ext; \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt index e23f96803ba..87aae44840e 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules. ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts (1 errors) ==== module M { export declare module "M" { } ~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt index 92f01832926..763317ecc0c 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient modules cannot be nested in other modules. ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (1 errors) ==== export declare module "M" { } ~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. \ No newline at end of file +!!! error TS2435: Ambient modules cannot be nested in other modules. \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt index 72d7145969f..b7ccdc8df92 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,5): error TS2439: Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name. -tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,25): error TS2307: Cannot find external module './SubModule'. +tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,5): error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. +tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,25): error TS2307: Cannot find module './SubModule'. ==== tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts (2 errors) ==== declare module "OuterModule" { import m2 = require("./SubModule"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2439: Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name. +!!! error TS2439: Import or export declaration in an ambient module declaration cannot reference module through relative module name. ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './SubModule'. +!!! error TS2307: Cannot find module './SubModule'. class SubModule { public static StaticVar: number; public InstanceVar: number; diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt index 7f6c0ff5b14..b85a7ad11a9 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts(1,16): error TS2436: Ambient external module declaration cannot specify relative module name. -tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts(5,16): error TS2436: Ambient external module declaration cannot specify relative module name. +tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts(1,16): error TS2436: Ambient module declaration cannot specify relative module name. +tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts(5,16): error TS2436: Ambient module declaration cannot specify relative module name. ==== tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts (2 errors) ==== declare module "./relativeModule" { ~~~~~~~~~~~~~~~~~~ -!!! error TS2436: Ambient external module declaration cannot specify relative module name. +!!! error TS2436: Ambient module declaration cannot specify relative module name. var x: string; } declare module ".\\relativeModule" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2436: Ambient external module declaration cannot specify relative module name. +!!! error TS2436: Ambient module declaration cannot specify relative module name. var x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 2d817ba1385..8c2ceb055c7 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -9,7 +9,7 @@ var x: B; var t: number = f(x, x); // Not an error //// [ambiguousOverloadResolution.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/amdDependencyComment1.errors.txt b/tests/baselines/reference/amdDependencyComment1.errors.txt index 8e436a56547..f3b5a5c06cc 100644 --- a/tests/baselines/reference/amdDependencyComment1.errors.txt +++ b/tests/baselines/reference/amdDependencyComment1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/amdDependencyComment1.ts(3,21): error TS2307: Cannot find external module 'm2'. +tests/cases/compiler/amdDependencyComment1.ts(3,21): error TS2307: Cannot find module 'm2'. ==== tests/cases/compiler/amdDependencyComment1.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/amdDependencyComment1.ts(3,21): error TS2307: Cannot find e import m1 = require("m2") ~~~~ -!!! error TS2307: Cannot find external module 'm2'. +!!! error TS2307: Cannot find module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyComment2.errors.txt b/tests/baselines/reference/amdDependencyComment2.errors.txt index bddd4e334e6..e7d81514b90 100644 --- a/tests/baselines/reference/amdDependencyComment2.errors.txt +++ b/tests/baselines/reference/amdDependencyComment2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/amdDependencyComment2.ts(3,21): error TS2307: Cannot find external module 'm2'. +tests/cases/compiler/amdDependencyComment2.ts(3,21): error TS2307: Cannot find module 'm2'. ==== tests/cases/compiler/amdDependencyComment2.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/amdDependencyComment2.ts(3,21): error TS2307: Cannot find e import m1 = require("m2") ~~~~ -!!! error TS2307: Cannot find external module 'm2'. +!!! error TS2307: Cannot find module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyCommentName1.errors.txt b/tests/baselines/reference/amdDependencyCommentName1.errors.txt index 6ba879abc72..f9e29ffe4c9 100644 --- a/tests/baselines/reference/amdDependencyCommentName1.errors.txt +++ b/tests/baselines/reference/amdDependencyCommentName1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/amdDependencyCommentName1.ts(3,21): error TS2307: Cannot find external module 'm2'. +tests/cases/compiler/amdDependencyCommentName1.ts(3,21): error TS2307: Cannot find module 'm2'. ==== tests/cases/compiler/amdDependencyCommentName1.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/amdDependencyCommentName1.ts(3,21): error TS2307: Cannot fi import m1 = require("m2") ~~~~ -!!! error TS2307: Cannot find external module 'm2'. +!!! error TS2307: Cannot find module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyCommentName2.errors.txt b/tests/baselines/reference/amdDependencyCommentName2.errors.txt index e3d6b8d16ec..de9350187ea 100644 --- a/tests/baselines/reference/amdDependencyCommentName2.errors.txt +++ b/tests/baselines/reference/amdDependencyCommentName2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/amdDependencyCommentName2.ts(3,21): error TS2307: Cannot find external module 'm2'. +tests/cases/compiler/amdDependencyCommentName2.ts(3,21): error TS2307: Cannot find module 'm2'. ==== tests/cases/compiler/amdDependencyCommentName2.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/amdDependencyCommentName2.ts(3,21): error TS2307: Cannot fi import m1 = require("m2") ~~~~ -!!! error TS2307: Cannot find external module 'm2'. +!!! error TS2307: Cannot find module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyCommentName3.errors.txt b/tests/baselines/reference/amdDependencyCommentName3.errors.txt index a9342218c2c..6c3f1583314 100644 --- a/tests/baselines/reference/amdDependencyCommentName3.errors.txt +++ b/tests/baselines/reference/amdDependencyCommentName3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/amdDependencyCommentName3.ts(5,21): error TS2307: Cannot find external module 'm2'. +tests/cases/compiler/amdDependencyCommentName3.ts(5,21): error TS2307: Cannot find module 'm2'. ==== tests/cases/compiler/amdDependencyCommentName3.ts (1 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/amdDependencyCommentName3.ts(5,21): error TS2307: Cannot fi import m1 = require("m2") ~~~~ -!!! error TS2307: Cannot find external module 'm2'. +!!! error TS2307: Cannot find module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyCommentName4.errors.txt b/tests/baselines/reference/amdDependencyCommentName4.errors.txt index 6b32830e51c..8031a651d0a 100644 --- a/tests/baselines/reference/amdDependencyCommentName4.errors.txt +++ b/tests/baselines/reference/amdDependencyCommentName4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/amdDependencyCommentName4.ts(8,21): error TS2307: Cannot find external module 'aliasedModule1'. -tests/cases/compiler/amdDependencyCommentName4.ts(11,26): error TS2307: Cannot find external module 'aliasedModule2'. -tests/cases/compiler/amdDependencyCommentName4.ts(14,15): error TS2307: Cannot find external module 'aliasedModule3'. -tests/cases/compiler/amdDependencyCommentName4.ts(17,21): error TS2307: Cannot find external module 'aliasedModule4'. +tests/cases/compiler/amdDependencyCommentName4.ts(8,21): error TS2307: Cannot find module 'aliasedModule1'. +tests/cases/compiler/amdDependencyCommentName4.ts(11,26): error TS2307: Cannot find module 'aliasedModule2'. +tests/cases/compiler/amdDependencyCommentName4.ts(14,15): error TS2307: Cannot find module 'aliasedModule3'. +tests/cases/compiler/amdDependencyCommentName4.ts(17,21): error TS2307: Cannot find module 'aliasedModule4'. ==== tests/cases/compiler/amdDependencyCommentName4.ts (4 errors) ==== @@ -14,22 +14,22 @@ tests/cases/compiler/amdDependencyCommentName4.ts(17,21): error TS2307: Cannot f import r1 = require("aliasedModule1"); ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'aliasedModule1'. +!!! error TS2307: Cannot find module 'aliasedModule1'. r1; import {p1, p2, p3} from "aliasedModule2"; ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'aliasedModule2'. +!!! error TS2307: Cannot find module 'aliasedModule2'. p1; import d from "aliasedModule3"; ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'aliasedModule3'. +!!! error TS2307: Cannot find module 'aliasedModule3'. d; import * as ns from "aliasedModule4"; ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'aliasedModule4'. +!!! error TS2307: Cannot find module 'aliasedModule4'. ns; import "unaliasedModule2"; \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index fd01d0df2ba..087a91fb02c 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -24,7 +24,7 @@ class Derived2 extends Base2 { // error because of the prototy //// [apparentTypeSubtyping.js] // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index 75703fbd06b..0b4462bebe7 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -14,7 +14,7 @@ class Derived extends Base { // error //// [apparentTypeSupertype.js] // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt b/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt new file mode 100644 index 00000000000..c1bac0fb1ff --- /dev/null +++ b/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt @@ -0,0 +1,38 @@ +tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(16,5): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. + Property '0' is missing in type '(string | number | boolean)[]'. +tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(17,5): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(18,5): error TS2345: Argument of type '{ x: (string | number)[]; y: { c: boolean; d: string; e: number; }; }' is not assignable to parameter of type '{ x: [any, any]; y: { c: any; d: any; e: any; }; }'. + Types of property 'x' are incompatible. + Type '(string | number)[]' is not assignable to type '[any, any]'. + Property '0' is missing in type '(string | number)[]'. + + +==== tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts (3 errors) ==== + // In a typed function call, argument expressions are contextually typed by their corresponding parameter types. + function foo({x: [a, b], y: {c, d, e}}) { } + function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { } + function baz(x: [string, number, boolean]) { } + + var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; + var o1: { x: [string, number], y: { c: boolean, d: string, e: number } } = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; + foo(o1); // Not error since x has contextual type of tuple namely [string, number] + foo({ x: ["string", 1], y: { c: true, d: "world", e: 3 } }); // Not error + + var array = ["string", 1, true]; + var tuple: [string, number, boolean] = ["string", 1, true]; + baz(tuple); + baz(["string", 1, true]); + + baz(array); // Error + ~~~~~ +!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Property '0' is missing in type '(string | number | boolean)[]'. + baz(["string", 1, true, ...array]); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. + foo(o); // Error because x has an array type namely (string|number)[] + ~ +!!! error TS2345: Argument of type '{ x: (string | number)[]; y: { c: boolean; d: string; e: number; }; }' is not assignable to parameter of type '{ x: [any, any]; y: { c: any; d: any; e: any; }; }'. +!!! error TS2345: Types of property 'x' are incompatible. +!!! error TS2345: Type '(string | number)[]' is not assignable to type '[any, any]'. +!!! error TS2345: Property '0' is missing in type '(string | number)[]'. \ No newline at end of file diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.js b/tests/baselines/reference/argumentExpressionContextualTyping.js new file mode 100644 index 00000000000..d3383612327 --- /dev/null +++ b/tests/baselines/reference/argumentExpressionContextualTyping.js @@ -0,0 +1,40 @@ +//// [argumentExpressionContextualTyping.ts] +// In a typed function call, argument expressions are contextually typed by their corresponding parameter types. +function foo({x: [a, b], y: {c, d, e}}) { } +function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { } +function baz(x: [string, number, boolean]) { } + +var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; +var o1: { x: [string, number], y: { c: boolean, d: string, e: number } } = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; +foo(o1); // Not error since x has contextual type of tuple namely [string, number] +foo({ x: ["string", 1], y: { c: true, d: "world", e: 3 } }); // Not error + +var array = ["string", 1, true]; +var tuple: [string, number, boolean] = ["string", 1, true]; +baz(tuple); +baz(["string", 1, true]); + +baz(array); // Error +baz(["string", 1, true, ...array]); // Error +foo(o); // Error because x has an array type namely (string|number)[] + +//// [argumentExpressionContextualTyping.js] +// In a typed function call, argument expressions are contextually typed by their corresponding parameter types. +function foo(_a) { + var _b = _a.x, a = _b[0], b = _b[1], _c = _a.y, c = _c.c, d = _c.d, e = _c.e; +} +function bar(_a) { + var _b = _a.x, a = _b[0], _c = _b[1], b = _c === void 0 ? 10 : _c, _d = _a.y, c = _d.c, d = _d.d, _e = _d.e, e = _e === void 0 ? { f: 1 } : _e; +} +function baz(x) { } +var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; +var o1 = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; +foo(o1); // Not error since x has contextual type of tuple namely [string, number] +foo({ x: ["string", 1], y: { c: true, d: "world", e: 3 } }); // Not error +var array = ["string", 1, true]; +var tuple = ["string", 1, true]; +baz(tuple); +baz(["string", 1, true]); +baz(array); // Error +baz(["string", 1, true].concat(array)); // Error +foo(o); // Error because x has an array type namely (string|number)[] diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index 0abfa889bed..43aad9921bb 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -86,7 +86,7 @@ arr_any = c3; // should be an error - is arr_any = i1; // should be an error - is //// [arrayAssignmentTest1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index 977862866ed..5aeb74114bc 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -60,7 +60,7 @@ arr_any = i1; // should be an error - is //// [arrayAssignmentTest2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index f8e158e5b02..8d2445e2739 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -108,7 +108,7 @@ module NonEmptyTypes { //// [arrayBestCommonTypes.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt new file mode 100644 index 00000000000..3e9777aea7c --- /dev/null +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. + Property '0' is missing in type 'number[]'. + + +==== tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts (2 errors) ==== + // In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by + // the type of the property with the numeric name N in the contextual type, if any, or otherwise + // the numeric index type of the contextual type, if any. + var array = [1, 2, 3]; + var array1 = [true, 2, 3]; // Contextual type by the numeric index type of the contextual type + var tup: [number, number, number] = [1, 2, 3, 4]; + var tup1: [number|string, number|string, number|string] = [1, 2, 3, "string"]; + var tup2: [number, number, number] = [1, 2, 3, "string"]; // Error + ~~~~ +!!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + + // In a contextually typed array literal expression containing one or more spread elements, + // an element expression at index N is contextually typed by the numeric index type of the contextual type, if any. + var spr = [1, 2, 3, ...array]; + var spr1 = [1, 2, 3, ...tup]; + var spr2:[number, number, number] = [1, 2, 3, ...tup]; // Error + ~~~~ +!!! error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. +!!! error TS2322: Property '0' is missing in type 'number[]'. + \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js new file mode 100644 index 00000000000..852a632f361 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js @@ -0,0 +1,31 @@ +//// [arrayLiteralExpressionContextualTyping.ts] +// In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by +// the type of the property with the numeric name N in the contextual type, if any, or otherwise +// the numeric index type of the contextual type, if any. +var array = [1, 2, 3]; +var array1 = [true, 2, 3]; // Contextual type by the numeric index type of the contextual type +var tup: [number, number, number] = [1, 2, 3, 4]; +var tup1: [number|string, number|string, number|string] = [1, 2, 3, "string"]; +var tup2: [number, number, number] = [1, 2, 3, "string"]; // Error + +// In a contextually typed array literal expression containing one or more spread elements, +// an element expression at index N is contextually typed by the numeric index type of the contextual type, if any. +var spr = [1, 2, 3, ...array]; +var spr1 = [1, 2, 3, ...tup]; +var spr2:[number, number, number] = [1, 2, 3, ...tup]; // Error + + +//// [arrayLiteralExpressionContextualTyping.js] +// In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by +// the type of the property with the numeric name N in the contextual type, if any, or otherwise +// the numeric index type of the contextual type, if any. +var array = [1, 2, 3]; +var array1 = [true, 2, 3]; // Contextual type by the numeric index type of the contextual type +var tup = [1, 2, 3, 4]; +var tup1 = [1, 2, 3, "string"]; +var tup2 = [1, 2, 3, "string"]; // Error +// In a contextually typed array literal expression containing one or more spread elements, +// an element expression at index N is contextually typed by the numeric index type of the contextual type, if any. +var spr = [1, 2, 3].concat(array); +var spr1 = [1, 2, 3].concat(tup); +var spr2 = [1, 2, 3].concat(tup); // Error diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index 28aa143fa61..dfd662bbf1c 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -52,7 +52,7 @@ var z3: { id: number }[] = //// [arrayLiteralTypeInference.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 16e5ec7eee4..cb1d25258f2 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -38,7 +38,7 @@ var context4: Base[] = [new Derived1(), new Derived1()]; //// [arrayLiterals.js] // Empty array literal with no contextual type has type Undefined[] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/arrayLiterals2ES5.js b/tests/baselines/reference/arrayLiterals2ES5.js new file mode 100644 index 00000000000..0ff82e90970 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals2ES5.js @@ -0,0 +1,104 @@ +//// [arrayLiterals2ES5.ts] +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [,, 2, 3, 4] +var a1 = ["hello", "world"] +var a2 = [, , , ...a0, "hello"]; +var a3 = [,, ...a0] +var a4 = [() => 1, ]; +var a5 = [...a0, , ] + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +var temp3 = [undefined, null, undefined]; +var temp4 = []; + +interface myArray extends Array { } +interface myArray2 extends Array { } +var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] +var d1 = [...temp]; // has type string[] +var d2: number[] = [...temp1]; +var d3: myArray = [...temp1]; +var d4: myArray2 = [...temp, ...temp1]; +var d5 = [...temp3]; +var d6 = [...temp4]; +var d7 = [...[...temp1]]; +var d8: number[][] = [[...temp1]] +var d9 = [[...temp1], ...["hello"]]; + +//// [arrayLiterals2ES5.js] +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement +// SpreadElement: +// ... AssignmentExpression +var a0 = [, , 2, 3, 4]; +var a1 = ["hello", "world"]; +var a2 = [, , ].concat(a0, ["hello"]); +var a3 = [, ].concat(a0); +var a4 = [function () { return 1; },]; +var a5 = a0.concat([,]); +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. +var b0 = [undefined, null, undefined]; +var b1 = [[1, 2, 3], ["hello", "string"]]; +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. +var _a = [1, 2], c0 = _a[0], c1 = _a[1]; // tuple type [number, number] +var _b = [1, 2, true], c2 = _b[0], c3 = _b[1]; // tuple type [number, number, boolean] +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2 = [[1, 2, 3], ["hello", "string"]]; +var temp3 = [undefined, null, undefined]; +var temp4 = []; +var d0 = [1, true].concat(temp); // has type (string|number|boolean)[] +var d1 = temp; // has type string[] +var d2 = temp1; +var d3 = temp1; +var d4 = temp.concat(temp1); +var d5 = temp3; +var d6 = temp4; +var d7 = temp1; +var d8 = [temp1]; +var d9 = [temp1].concat(["hello"]); diff --git a/tests/baselines/reference/arrayLiterals2ES5.symbols b/tests/baselines/reference/arrayLiterals2ES5.symbols new file mode 100644 index 00000000000..c69b79de272 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals2ES5.symbols @@ -0,0 +1,134 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts === +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [,, 2, 3, 4] +>a0 : Symbol(a0, Decl(arrayLiterals2ES5.ts, 9, 3)) + +var a1 = ["hello", "world"] +>a1 : Symbol(a1, Decl(arrayLiterals2ES5.ts, 10, 3)) + +var a2 = [, , , ...a0, "hello"]; +>a2 : Symbol(a2, Decl(arrayLiterals2ES5.ts, 11, 3)) +>a0 : Symbol(a0, Decl(arrayLiterals2ES5.ts, 9, 3)) + +var a3 = [,, ...a0] +>a3 : Symbol(a3, Decl(arrayLiterals2ES5.ts, 12, 3)) +>a0 : Symbol(a0, Decl(arrayLiterals2ES5.ts, 9, 3)) + +var a4 = [() => 1, ]; +>a4 : Symbol(a4, Decl(arrayLiterals2ES5.ts, 13, 3)) + +var a5 = [...a0, , ] +>a5 : Symbol(a5, Decl(arrayLiterals2ES5.ts, 14, 3)) +>a0 : Symbol(a0, Decl(arrayLiterals2ES5.ts, 9, 3)) + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +>b0 : Symbol(b0, Decl(arrayLiterals2ES5.ts, 25, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>b1 : Symbol(b1, Decl(arrayLiterals2ES5.ts, 26, 3)) + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +>c0 : Symbol(c0, Decl(arrayLiterals2ES5.ts, 32, 5)) +>c1 : Symbol(c1, Decl(arrayLiterals2ES5.ts, 32, 8)) + +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] +>c2 : Symbol(c2, Decl(arrayLiterals2ES5.ts, 33, 5)) +>c3 : Symbol(c3, Decl(arrayLiterals2ES5.ts, 33, 8)) + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +>temp : Symbol(temp, Decl(arrayLiterals2ES5.ts, 38, 3)) + +var temp1 = [1, 2, 3]; +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>temp2 : Symbol(temp2, Decl(arrayLiterals2ES5.ts, 40, 3)) + +var temp3 = [undefined, null, undefined]; +>temp3 : Symbol(temp3, Decl(arrayLiterals2ES5.ts, 41, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var temp4 = []; +>temp4 : Symbol(temp4, Decl(arrayLiterals2ES5.ts, 42, 3)) + +interface myArray extends Array { } +>myArray : Symbol(myArray, Decl(arrayLiterals2ES5.ts, 42, 15)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +interface myArray2 extends Array { } +>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES5.ts, 44, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] +>d0 : Symbol(d0, Decl(arrayLiterals2ES5.ts, 46, 3)) +>temp : Symbol(temp, Decl(arrayLiterals2ES5.ts, 38, 3)) + +var d1 = [...temp]; // has type string[] +>d1 : Symbol(d1, Decl(arrayLiterals2ES5.ts, 47, 3)) +>temp : Symbol(temp, Decl(arrayLiterals2ES5.ts, 38, 3)) + +var d2: number[] = [...temp1]; +>d2 : Symbol(d2, Decl(arrayLiterals2ES5.ts, 48, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + +var d3: myArray = [...temp1]; +>d3 : Symbol(d3, Decl(arrayLiterals2ES5.ts, 49, 3)) +>myArray : Symbol(myArray, Decl(arrayLiterals2ES5.ts, 42, 15)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + +var d4: myArray2 = [...temp, ...temp1]; +>d4 : Symbol(d4, Decl(arrayLiterals2ES5.ts, 50, 3)) +>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES5.ts, 44, 43)) +>temp : Symbol(temp, Decl(arrayLiterals2ES5.ts, 38, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + +var d5 = [...temp3]; +>d5 : Symbol(d5, Decl(arrayLiterals2ES5.ts, 51, 3)) +>temp3 : Symbol(temp3, Decl(arrayLiterals2ES5.ts, 41, 3)) + +var d6 = [...temp4]; +>d6 : Symbol(d6, Decl(arrayLiterals2ES5.ts, 52, 3)) +>temp4 : Symbol(temp4, Decl(arrayLiterals2ES5.ts, 42, 3)) + +var d7 = [...[...temp1]]; +>d7 : Symbol(d7, Decl(arrayLiterals2ES5.ts, 53, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + +var d8: number[][] = [[...temp1]] +>d8 : Symbol(d8, Decl(arrayLiterals2ES5.ts, 54, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + +var d9 = [[...temp1], ...["hello"]]; +>d9 : Symbol(d9, Decl(arrayLiterals2ES5.ts, 55, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES5.ts, 39, 3)) + diff --git a/tests/baselines/reference/arrayLiterals2ES5.types b/tests/baselines/reference/arrayLiterals2ES5.types new file mode 100644 index 00000000000..6eae997f465 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals2ES5.types @@ -0,0 +1,225 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts === +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [,, 2, 3, 4] +>a0 : number[] +>[,, 2, 3, 4] : number[] +> : undefined +> : undefined +>2 : number +>3 : number +>4 : number + +var a1 = ["hello", "world"] +>a1 : string[] +>["hello", "world"] : string[] +>"hello" : string +>"world" : string + +var a2 = [, , , ...a0, "hello"]; +>a2 : (string | number)[] +>[, , , ...a0, "hello"] : (string | number)[] +> : undefined +> : undefined +> : undefined +>...a0 : number +>a0 : number[] +>"hello" : string + +var a3 = [,, ...a0] +>a3 : number[] +>[,, ...a0] : number[] +> : undefined +> : undefined +>...a0 : number +>a0 : number[] + +var a4 = [() => 1, ]; +>a4 : (() => number)[] +>[() => 1, ] : (() => number)[] +>() => 1 : () => number +>1 : number + +var a5 = [...a0, , ] +>a5 : number[] +>[...a0, , ] : number[] +>...a0 : number +>a0 : number[] +> : undefined + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +>b0 : [any, any, any] +>[undefined, null, undefined] : [undefined, null, undefined] +>undefined : undefined +>null : null +>undefined : undefined + +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>b1 : [number[], string[]] +>[[1, 2, 3], ["hello", "string"]] : [number[], string[]] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number +>["hello", "string"] : string[] +>"hello" : string +>"string" : string + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +>c0 : number +>c1 : number +>[1, 2] : [number, number] +>1 : number +>2 : number + +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] +>c2 : number +>c3 : number +>[1, 2, true] : [number, number, boolean] +>1 : number +>2 : number +>true : boolean + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +>temp : string[] +>["s", "t", "r"] : string[] +>"s" : string +>"t" : string +>"r" : string + +var temp1 = [1, 2, 3]; +>temp1 : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>temp2 : [number[], string[]] +>[[1, 2, 3], ["hello", "string"]] : [number[], string[]] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number +>["hello", "string"] : string[] +>"hello" : string +>"string" : string + +var temp3 = [undefined, null, undefined]; +>temp3 : any[] +>[undefined, null, undefined] : null[] +>undefined : undefined +>null : null +>undefined : undefined + +var temp4 = []; +>temp4 : any[] +>[] : undefined[] + +interface myArray extends Array { } +>myArray : myArray +>Array : T[] +>Number : Number + +interface myArray2 extends Array { } +>myArray2 : myArray2 +>Array : T[] +>Number : Number +>String : String + +var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] +>d0 : (string | number | boolean)[] +>[1, true, ...temp,] : (string | number | boolean)[] +>1 : number +>true : boolean +>...temp : string +>temp : string[] + +var d1 = [...temp]; // has type string[] +>d1 : string[] +>[...temp] : string[] +>...temp : string +>temp : string[] + +var d2: number[] = [...temp1]; +>d2 : number[] +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d3: myArray = [...temp1]; +>d3 : myArray +>myArray : myArray +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d4: myArray2 = [...temp, ...temp1]; +>d4 : myArray2 +>myArray2 : myArray2 +>[...temp, ...temp1] : (string | number)[] +>...temp : string +>temp : string[] +>...temp1 : number +>temp1 : number[] + +var d5 = [...temp3]; +>d5 : any[] +>[...temp3] : any[] +>...temp3 : any +>temp3 : any[] + +var d6 = [...temp4]; +>d6 : any[] +>[...temp4] : any[] +>...temp4 : any +>temp4 : any[] + +var d7 = [...[...temp1]]; +>d7 : number[] +>[...[...temp1]] : number[] +>...[...temp1] : number +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d8: number[][] = [[...temp1]] +>d8 : number[][] +>[[...temp1]] : number[][] +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d9 = [[...temp1], ...["hello"]]; +>d9 : (string | number[])[] +>[[...temp1], ...["hello"]] : (string | number[])[] +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] +>...["hello"] : string +>["hello"] : string[] +>"hello" : string + diff --git a/tests/baselines/reference/arrayLiterals2ES6.js b/tests/baselines/reference/arrayLiterals2ES6.js new file mode 100644 index 00000000000..cb6bf2684e8 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals2ES6.js @@ -0,0 +1,100 @@ +//// [arrayLiterals2ES6.ts] +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [, , 2, 3, 4] +var a1 = ["hello", "world"] +var a2 = [, , , ...a0, "hello"]; +var a3 = [, , ...a0] +var a4 = [() => 1, ]; +var a5 = [...a0, , ] + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +interface myArray extends Array { } +interface myArray2 extends Array { } +var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] +var d1 = [...temp]; // has type string[] +var d2: number[] = [...temp1]; +var d3: myArray = [...temp1]; +var d4: myArray2 = [...temp, ...temp1]; +var d5 = [...a2]; +var d6 = [...a3]; +var d7 = [...a4]; +var d8: number[][] = [[...temp1]] +var d9 = [[...temp1], ...["hello"]]; + +//// [arrayLiterals2ES6.js] +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement +// SpreadElement: +// ... AssignmentExpression +var a0 = [, , 2, 3, 4]; +var a1 = ["hello", "world"]; +var a2 = [, , , ...a0, "hello"]; +var a3 = [, , ...a0]; +var a4 = [() => 1,]; +var a5 = [...a0, ,]; +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. +var b0 = [undefined, null, undefined]; +var b1 = [[1, 2, 3], ["hello", "string"]]; +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. +var [c0, c1] = [1, 2]; // tuple type [number, number] +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2 = [[1, 2, 3], ["hello", "string"]]; +var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] +var d1 = [...temp]; // has type string[] +var d2 = [...temp1]; +var d3 = [...temp1]; +var d4 = [...temp, ...temp1]; +var d5 = [...a2]; +var d6 = [...a3]; +var d7 = [...a4]; +var d8 = [[...temp1]]; +var d9 = [[...temp1], ...["hello"]]; diff --git a/tests/baselines/reference/arrayLiterals2ES6.symbols b/tests/baselines/reference/arrayLiterals2ES6.symbols new file mode 100644 index 00000000000..3b435de2e51 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals2ES6.symbols @@ -0,0 +1,126 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES6.ts === +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [, , 2, 3, 4] +>a0 : Symbol(a0, Decl(arrayLiterals2ES6.ts, 9, 3)) + +var a1 = ["hello", "world"] +>a1 : Symbol(a1, Decl(arrayLiterals2ES6.ts, 10, 3)) + +var a2 = [, , , ...a0, "hello"]; +>a2 : Symbol(a2, Decl(arrayLiterals2ES6.ts, 11, 3)) +>a0 : Symbol(a0, Decl(arrayLiterals2ES6.ts, 9, 3)) + +var a3 = [, , ...a0] +>a3 : Symbol(a3, Decl(arrayLiterals2ES6.ts, 12, 3)) +>a0 : Symbol(a0, Decl(arrayLiterals2ES6.ts, 9, 3)) + +var a4 = [() => 1, ]; +>a4 : Symbol(a4, Decl(arrayLiterals2ES6.ts, 13, 3)) + +var a5 = [...a0, , ] +>a5 : Symbol(a5, Decl(arrayLiterals2ES6.ts, 14, 3)) +>a0 : Symbol(a0, Decl(arrayLiterals2ES6.ts, 9, 3)) + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +>b0 : Symbol(b0, Decl(arrayLiterals2ES6.ts, 25, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>b1 : Symbol(b1, Decl(arrayLiterals2ES6.ts, 26, 3)) + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +>c0 : Symbol(c0, Decl(arrayLiterals2ES6.ts, 32, 5)) +>c1 : Symbol(c1, Decl(arrayLiterals2ES6.ts, 32, 8)) + +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] +>c2 : Symbol(c2, Decl(arrayLiterals2ES6.ts, 33, 5)) +>c3 : Symbol(c3, Decl(arrayLiterals2ES6.ts, 33, 8)) + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +>temp : Symbol(temp, Decl(arrayLiterals2ES6.ts, 38, 3)) + +var temp1 = [1, 2, 3]; +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES6.ts, 39, 3)) + +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>temp2 : Symbol(temp2, Decl(arrayLiterals2ES6.ts, 40, 3)) + +interface myArray extends Array { } +>myArray : Symbol(myArray, Decl(arrayLiterals2ES6.ts, 40, 67)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +interface myArray2 extends Array { } +>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES6.ts, 42, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] +>d0 : Symbol(d0, Decl(arrayLiterals2ES6.ts, 44, 3)) +>temp : Symbol(temp, Decl(arrayLiterals2ES6.ts, 38, 3)) + +var d1 = [...temp]; // has type string[] +>d1 : Symbol(d1, Decl(arrayLiterals2ES6.ts, 45, 3)) +>temp : Symbol(temp, Decl(arrayLiterals2ES6.ts, 38, 3)) + +var d2: number[] = [...temp1]; +>d2 : Symbol(d2, Decl(arrayLiterals2ES6.ts, 46, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES6.ts, 39, 3)) + +var d3: myArray = [...temp1]; +>d3 : Symbol(d3, Decl(arrayLiterals2ES6.ts, 47, 3)) +>myArray : Symbol(myArray, Decl(arrayLiterals2ES6.ts, 40, 67)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES6.ts, 39, 3)) + +var d4: myArray2 = [...temp, ...temp1]; +>d4 : Symbol(d4, Decl(arrayLiterals2ES6.ts, 48, 3)) +>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES6.ts, 42, 43)) +>temp : Symbol(temp, Decl(arrayLiterals2ES6.ts, 38, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES6.ts, 39, 3)) + +var d5 = [...a2]; +>d5 : Symbol(d5, Decl(arrayLiterals2ES6.ts, 49, 3)) +>a2 : Symbol(a2, Decl(arrayLiterals2ES6.ts, 11, 3)) + +var d6 = [...a3]; +>d6 : Symbol(d6, Decl(arrayLiterals2ES6.ts, 50, 3)) +>a3 : Symbol(a3, Decl(arrayLiterals2ES6.ts, 12, 3)) + +var d7 = [...a4]; +>d7 : Symbol(d7, Decl(arrayLiterals2ES6.ts, 51, 3)) +>a4 : Symbol(a4, Decl(arrayLiterals2ES6.ts, 13, 3)) + +var d8: number[][] = [[...temp1]] +>d8 : Symbol(d8, Decl(arrayLiterals2ES6.ts, 52, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES6.ts, 39, 3)) + +var d9 = [[...temp1], ...["hello"]]; +>d9 : Symbol(d9, Decl(arrayLiterals2ES6.ts, 53, 3)) +>temp1 : Symbol(temp1, Decl(arrayLiterals2ES6.ts, 39, 3)) + diff --git a/tests/baselines/reference/arrayLiterals2ES6.types b/tests/baselines/reference/arrayLiterals2ES6.types new file mode 100644 index 00000000000..f05b0ca9282 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals2ES6.types @@ -0,0 +1,212 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES6.ts === +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [, , 2, 3, 4] +>a0 : number[] +>[, , 2, 3, 4] : number[] +> : undefined +> : undefined +>2 : number +>3 : number +>4 : number + +var a1 = ["hello", "world"] +>a1 : string[] +>["hello", "world"] : string[] +>"hello" : string +>"world" : string + +var a2 = [, , , ...a0, "hello"]; +>a2 : (string | number)[] +>[, , , ...a0, "hello"] : (string | number)[] +> : undefined +> : undefined +> : undefined +>...a0 : number +>a0 : number[] +>"hello" : string + +var a3 = [, , ...a0] +>a3 : number[] +>[, , ...a0] : number[] +> : undefined +> : undefined +>...a0 : number +>a0 : number[] + +var a4 = [() => 1, ]; +>a4 : (() => number)[] +>[() => 1, ] : (() => number)[] +>() => 1 : () => number +>1 : number + +var a5 = [...a0, , ] +>a5 : number[] +>[...a0, , ] : number[] +>...a0 : number +>a0 : number[] +> : undefined + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +>b0 : [any, any, any] +>[undefined, null, undefined] : [undefined, null, undefined] +>undefined : undefined +>null : null +>undefined : undefined + +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>b1 : [number[], string[]] +>[[1, 2, 3], ["hello", "string"]] : [number[], string[]] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number +>["hello", "string"] : string[] +>"hello" : string +>"string" : string + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +>c0 : number +>c1 : number +>[1, 2] : [number, number] +>1 : number +>2 : number + +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] +>c2 : number +>c3 : number +>[1, 2, true] : [number, number, boolean] +>1 : number +>2 : number +>true : boolean + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +>temp : string[] +>["s", "t", "r"] : string[] +>"s" : string +>"t" : string +>"r" : string + +var temp1 = [1, 2, 3]; +>temp1 : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +>temp2 : [number[], string[]] +>[[1, 2, 3], ["hello", "string"]] : [number[], string[]] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number +>["hello", "string"] : string[] +>"hello" : string +>"string" : string + +interface myArray extends Array { } +>myArray : myArray +>Array : T[] +>Number : Number + +interface myArray2 extends Array { } +>myArray2 : myArray2 +>Array : T[] +>Number : Number +>String : String + +var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] +>d0 : (string | number | boolean)[] +>[1, true, ...temp, ] : (string | number | boolean)[] +>1 : number +>true : boolean +>...temp : string +>temp : string[] + +var d1 = [...temp]; // has type string[] +>d1 : string[] +>[...temp] : string[] +>...temp : string +>temp : string[] + +var d2: number[] = [...temp1]; +>d2 : number[] +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d3: myArray = [...temp1]; +>d3 : myArray +>myArray : myArray +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d4: myArray2 = [...temp, ...temp1]; +>d4 : myArray2 +>myArray2 : myArray2 +>[...temp, ...temp1] : (string | number)[] +>...temp : string +>temp : string[] +>...temp1 : number +>temp1 : number[] + +var d5 = [...a2]; +>d5 : (string | number)[] +>[...a2] : (string | number)[] +>...a2 : string | number +>a2 : (string | number)[] + +var d6 = [...a3]; +>d6 : number[] +>[...a3] : number[] +>...a3 : number +>a3 : number[] + +var d7 = [...a4]; +>d7 : (() => number)[] +>[...a4] : (() => number)[] +>...a4 : () => number +>a4 : (() => number)[] + +var d8: number[][] = [[...temp1]] +>d8 : number[][] +>[[...temp1]] : number[][] +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] + +var d9 = [[...temp1], ...["hello"]]; +>d9 : (string | number[])[] +>[[...temp1], ...["hello"]] : (string | number[])[] +>[...temp1] : number[] +>...temp1 : number +>temp1 : number[] +>...["hello"] : string +>["hello"] : string[] +>"hello" : string + diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt new file mode 100644 index 00000000000..74cfdb165d7 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -0,0 +1,86 @@ +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. + Property '0' is missing in type 'undefined[]'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. + Types of property '0' are incompatible. + Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => number'. + Type 'string | number | boolean' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(string[] | number[])[]' is not assignable to type 'tup'. + Property '0' is missing in type '(string[] | number[])[]'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. + Property '0' is missing in type 'number[]'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'. + Types of property 'push' are incompatible. + Type '(...items: (string | number)[]) => number' is not assignable to type '(...items: Number[]) => number'. + Types of parameters 'items' and 'items' are incompatible. + Type 'string | number' 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) ==== + // Each element expression in a non-empty array literal is processed as follows: + // - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) + // by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, + // the element expression is contextually typed by the type of that property. + + // The resulting type an array literal expression is determined as follows: + // - If the array literal contains no spread elements and is contextually typed by a tuple-like type, + // the resulting type is a tuple type constructed from the types of the element expressions. + + var a0: [any, any, any] = []; // Error + ~~ +!!! error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. +!!! error TS2322: Property '0' is missing in type 'undefined[]'. + var a1: [boolean, string, number] = ["string", 1, true]; // Error + ~~ +!!! error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. + + // The resulting type an array literal expression is determined as follows: + // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), + // the resulting type is a tuple type constructed from the types of the element expressions. + + var [b1, b2]: [number, number] = [1, 2, "string", true]; + ~~~~~~~~ +!!! error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + + // The resulting type an array literal expression is determined as follows: + // - the resulting type is an array type with an element type that is the union of the types of the + // non - spread element expressions and the numeric index signature types of the spread element expressions + var temp = ["s", "t", "r"]; + var temp1 = [1, 2, 3]; + var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + + interface tup { + 0: number[]|string[]; + 1: number[]|string[]; + } + interface myArray extends Array { } + interface myArray2 extends Array { } + var c0: tup = [...temp2]; // Error + ~~ +!!! error TS2322: Type '(string[] | number[])[]' is not assignable to type 'tup'. +!!! error TS2322: Property '0' is missing in type '(string[] | number[])[]'. + var c1: [number, number, number] = [...temp1]; // Error cannot assign number[] to [number, number, number] + ~~ +!!! error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. +!!! error TS2322: Property '0' is missing in type 'number[]'. + var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[] + ~~ +!!! error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'. +!!! error TS2322: Types of property 'push' are incompatible. +!!! error TS2322: Type '(...items: (string | number)[]) => number' is not assignable to type '(...items: Number[]) => number'. +!!! error TS2322: Types of parameters 'items' and 'items' are incompatible. +!!! error TS2322: Type 'string | number' 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/arrayLiterals3.js b/tests/baselines/reference/arrayLiterals3.js new file mode 100644 index 00000000000..091c6148068 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals3.js @@ -0,0 +1,60 @@ +//// [arrayLiterals3.ts] +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var a0: [any, any, any] = []; // Error +var a1: [boolean, string, number] = ["string", 1, true]; // Error + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [b1, b2]: [number, number] = [1, 2, "string", true]; + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +interface tup { + 0: number[]|string[]; + 1: number[]|string[]; +} +interface myArray extends Array { } +interface myArray2 extends Array { } +var c0: tup = [...temp2]; // Error +var c1: [number, number, number] = [...temp1]; // Error cannot assign number[] to [number, number, number] +var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[] + + +//// [arrayLiterals3.js] +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. +var a0 = []; // Error +var a1 = ["string", 1, true]; // Error +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. +var _a = [1, 2, "string", true], b1 = _a[0], b2 = _a[1]; +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2 = [[1, 2, 3], ["hello", "string"]]; +var c0 = temp2; // Error +var c1 = temp1; // Error cannot assign number[] to [number, number, number] +var c2 = temp1.concat(temp); // Error cannot assign (number|string)[] to number[] diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index f15215a88eb..b3c0a0f7877 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -26,7 +26,7 @@ var myDerivedList: DerivedList; var as = [list, myDerivedList]; // List[] //// [arrayLiteralsWithRecursiveGenerics.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index a10e3955ae0..f4a11fb47ae 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -97,7 +97,7 @@ var asserted2: any; //// [arrowFunctionContexts.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index 8d33412bb4b..1ad82ca531b 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -101,7 +101,7 @@ b18 = a18; // ok //// [assignmentCompatWithCallSignatures3.js] // these are all permitted with the current rules, since we do not do contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 926d8eb13e1..387395525ad 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -100,7 +100,7 @@ module Errors { //// [assignmentCompatWithCallSignatures4.js] // These are mostly permitted with the current loose rules. All ok unless otherwise noted. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index afe3166ccb5..2e3790cd529 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -67,7 +67,7 @@ b18 = a18; // ok //// [assignmentCompatWithCallSignatures5.js] // checking assignment compat for function types. No errors in this file -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index 0db1f1f79fb..a29a607f9ef 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -44,7 +44,7 @@ b16 = x.a16; //// [assignmentCompatWithCallSignatures6.js] // checking assignment compatibility relations for function types. All valid -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index 1926f0e0684..32176e764e9 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -101,7 +101,7 @@ b18 = a18; // ok //// [assignmentCompatWithConstructSignatures3.js] // checking assignment compatibility relations for function types. All of these are valid. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index 9e12f0f360d..21bace1645c 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -100,7 +100,7 @@ module Errors { //// [assignmentCompatWithConstructSignatures4.js] // checking assignment compatibility relations for function types. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index 1b26d813d45..76be317e95a 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -67,7 +67,7 @@ b18 = a18; // ok //// [assignmentCompatWithConstructSignatures5.js] // checking assignment compat for function types. All valid -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index ccca809c281..dc1d0dd2dee 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -44,7 +44,7 @@ b16 = x.a16; //// [assignmentCompatWithConstructSignatures6.js] // checking assignment compatibility relations for function types. All valid. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index a139787130e..6044c40b3cc 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -45,7 +45,7 @@ module Generics { //// [assignmentCompatWithNumericIndexer.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 8aa8dca511e..b3c073ea0b7 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -42,7 +42,7 @@ module Generics { //// [assignmentCompatWithNumericIndexer3.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index 0d535cbb20d..229525a91f0 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -93,7 +93,7 @@ module WithBase { //// [assignmentCompatWithObjectMembers4.js] // members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index 5525b623ecc..629f7bf5113 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -90,7 +90,7 @@ module SourceHasOptional { //// [assignmentCompatWithObjectMembersOptionality.js] // Derived member is not optional but base member is, should be ok -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index 8859a4c9ab0..4ffec4aa7dd 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -92,7 +92,7 @@ module SourceHasOptional { //// [assignmentCompatWithObjectMembersOptionality2.js] // M is optional and S contains no property with the same name as M // N is optional and T contains no property with the same name as N -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index b54c75a1bec..99457453af4 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -55,7 +55,7 @@ module Generics { //// [assignmentCompatWithStringIndexer.js] // index signatures must be compatible in assignments -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 4b17f855171..d5276e71a9b 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -71,7 +71,7 @@ foo() = value; (foo()) = value; //// [assignmentLHSIsValue.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/augmentedTypesModules.errors.txt b/tests/baselines/reference/augmentedTypesModules.errors.txt index 980837a18ef..5ece0710e43 100644 --- a/tests/baselines/reference/augmentedTypesModules.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules.errors.txt @@ -4,9 +4,9 @@ tests/cases/compiler/augmentedTypesModules.ts(8,8): error TS2300: Duplicate iden tests/cases/compiler/augmentedTypesModules.ts(9,5): error TS2300: Duplicate identifier 'm1b'. tests/cases/compiler/augmentedTypesModules.ts(16,8): error TS2300: Duplicate identifier 'm1d'. tests/cases/compiler/augmentedTypesModules.ts(19,5): error TS2300: Duplicate identifier 'm1d'. -tests/cases/compiler/augmentedTypesModules.ts(25,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged -tests/cases/compiler/augmentedTypesModules.ts(28,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged -tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules.ts(25,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules.ts(28,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged ==== tests/cases/compiler/augmentedTypesModules.ts (9 errors) ==== @@ -48,12 +48,12 @@ tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A module decl module m2a { var y = 2; } ~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged function m2a() { }; // error since the module is instantiated module m2b { export var y = 2; } ~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged function m2b() { }; // error since the module is instantiated // should be errors to have function first @@ -78,7 +78,7 @@ tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A module decl module m3a { var y = 2; } ~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged class m3a { foo() { } } // error, class isn't ambient or declared before the module class m3b { foo() { } } diff --git a/tests/baselines/reference/augmentedTypesModules2.errors.txt b/tests/baselines/reference/augmentedTypesModules2.errors.txt index 19c87a14913..be847d88830 100644 --- a/tests/baselines/reference/augmentedTypesModules2.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/augmentedTypesModules2.ts(5,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged -tests/cases/compiler/augmentedTypesModules2.ts(8,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged -tests/cases/compiler/augmentedTypesModules2.ts(14,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules2.ts(5,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules2.ts(8,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules2.ts(14,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged ==== tests/cases/compiler/augmentedTypesModules2.ts (3 errors) ==== @@ -10,12 +10,12 @@ tests/cases/compiler/augmentedTypesModules2.ts(14,8): error TS2434: A module dec module m2a { var y = 2; } ~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged function m2a() { }; // error since the module is instantiated module m2b { export var y = 2; } ~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged function m2b() { }; // error since the module is instantiated function m2c() { }; @@ -23,7 +23,7 @@ tests/cases/compiler/augmentedTypesModules2.ts(14,8): error TS2434: A module dec module m2cc { export var y = 2; } ~~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged function m2cc() { }; // error to have module first module m2d { } diff --git a/tests/baselines/reference/augmentedTypesModules3.errors.txt b/tests/baselines/reference/augmentedTypesModules3.errors.txt index e264c74463c..8e1bd706271 100644 --- a/tests/baselines/reference/augmentedTypesModules3.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/augmentedTypesModules3.ts(5,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules3.ts(5,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged ==== tests/cases/compiler/augmentedTypesModules3.ts (1 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/augmentedTypesModules3.ts(5,8): error TS2434: A module decl module m3a { var y = 2; } ~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged class m3a { foo() { } } // error, class isn't ambient or declared before the module \ No newline at end of file diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index 6a903b890d8..5986ef4a3f5 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -24,7 +24,7 @@ class Point3D extends Point { //// [autolift4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/badExternalModuleReference.errors.txt b/tests/baselines/reference/badExternalModuleReference.errors.txt index 96ac4224222..e5caaaf296f 100644 --- a/tests/baselines/reference/badExternalModuleReference.errors.txt +++ b/tests/baselines/reference/badExternalModuleReference.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/badExternalModuleReference.ts(1,21): error TS2307: Cannot find external module 'garbage'. +tests/cases/compiler/badExternalModuleReference.ts(1,21): error TS2307: Cannot find module 'garbage'. ==== tests/cases/compiler/badExternalModuleReference.ts (1 errors) ==== import a1 = require("garbage"); ~~~~~~~~~ -!!! error TS2307: Cannot find external module 'garbage'. +!!! error TS2307: Cannot find module 'garbage'. export declare var a: { test1: a1.connectModule; (): a1.connectExport; diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 2ebefcbade2..4e7db8e6a5b 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -30,7 +30,7 @@ function f() { //// [baseCheck.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 4720e92b969..85b76221e3c 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -25,7 +25,7 @@ var z: Derived = b.foo(); */ //// [baseIndexSignatureResolution.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index b206ef2b911..754d90e21ea 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -37,7 +37,7 @@ class Class4 extends Class3 //// [baseTypeOrderChecking.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index 97180f42133..aaa93710339 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -27,7 +27,7 @@ class Wrapper { } //// [baseTypeWrappingInstantiationChain.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index 32d65d1a248..5687e9e0fe1 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -21,7 +21,7 @@ new C().y; //// [bases.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index 49bc535dbfe..e56e530ad64 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -29,7 +29,7 @@ function foo5(t: T, u: U): Object { //// [bestCommonTypeOfConditionalExpressions.js] // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) // no errors expected here -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index 49659de94d4..fb3c15a8fba 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -27,7 +27,7 @@ function foo3(t: T, u: U) { //// [bestCommonTypeOfConditionalExpressions2.js] // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) // these are errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index f9183f41348..5642df5570c 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -23,7 +23,7 @@ var e51 = t5[2]; // {} //// [bestCommonTypeOfTuple2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 8bb4cb665a2..685e33acb6b 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -71,7 +71,7 @@ interface I extends A { //// [callSignatureAssignabilityInInheritance2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index 31cdc8980fd..135c0c056ae 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -116,7 +116,7 @@ module Errors { //// [callSignatureAssignabilityInInheritance3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index 2f9cbc2a9e7..c578a49ee55 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -51,7 +51,7 @@ interface I extends A { //// [callSignatureAssignabilityInInheritance4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index 0cb4830188a..74987308ef7 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -51,7 +51,7 @@ interface I extends B { //// [callSignatureAssignabilityInInheritance5.js] // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithCallSignatures2 just with an extra level of indirection in the inheritance chain -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index dd471f09223..aa2e9787bd1 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -54,7 +54,7 @@ interface I9 extends A { // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithCallSignatures4 but using class type parameters instead of generic signatures // all are errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index d676c0f2a33..c9cd5d2adce 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -54,7 +54,7 @@ var c = new C(1, 2, ...a); //// [callWithSpread.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/callWithSpreadES6.symbols b/tests/baselines/reference/callWithSpreadES6.symbols index 0dd186210b2..94e0b94b002 100644 --- a/tests/baselines/reference/callWithSpreadES6.symbols +++ b/tests/baselines/reference/callWithSpreadES6.symbols @@ -94,7 +94,7 @@ xa[1].foo(1, 2, ...a, "abc"); >a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) (xa[1].foo)(...[1, 2, "abc"]); ->Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 1325, 1)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 1355, 1)) >xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) >xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) >foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index 7200fabd8c4..27c80e2991d 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -9,7 +9,7 @@ class B extends A { } //// [captureThisInSuperCall.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index 2c41d81cd6a..8b1005d4487 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -33,7 +33,7 @@ t4[2] = 10; //// [castingTuple.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index 11b9ceb3a07..022668ba7cf 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -23,7 +23,7 @@ a = b = new A(); //// [chainedAssignment3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index 70456b9e9d1..494f0bc1b5d 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -20,7 +20,7 @@ class C extends B { (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); //// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index b134ff2a40a..bcdde6b3be1 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -32,7 +32,7 @@ class Baz extends Object { //// [checkForObjectTooStrict.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index b1d435cc8ce..1a50a46221b 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -21,7 +21,7 @@ var c = new B.a.C(); //// [circularImportAlias.js] // expected no error -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/circularReference.errors.txt b/tests/baselines/reference/circularReference.errors.txt index 667d1ca895d..5e0a6208a1e 100644 --- a/tests/baselines/reference/circularReference.errors.txt +++ b/tests/baselines/reference/circularReference.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/externalModules/foo1.ts(9,12): error TS2339: Property 'x' does not exist on type 'C1'. tests/cases/conformance/externalModules/foo2.ts(8,12): error TS2339: Property 'y' does not exist on type 'C1'. tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'. @@ -29,7 +29,7 @@ tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x ==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== import foo2 = require('./foo2'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export module M1 { export class C1 { m1: foo2.M1.C1; diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithClass.js b/tests/baselines/reference/circularTypeAliasForUnionWithClass.js new file mode 100644 index 00000000000..90a11364897 --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithClass.js @@ -0,0 +1,39 @@ +//// [circularTypeAliasForUnionWithClass.ts] +var v0: T0; +type T0 = string | I0; +class I0 { + x: T0; +} + +var v3: T3; +type T3 = string | I3; +class I3 { + [x: number]: T3; +} + +var v4: T4; +type T4 = string | I4; +class I4 { + [x: string]: T4; +} + + +//// [circularTypeAliasForUnionWithClass.js] +var v0; +var I0 = (function () { + function I0() { + } + return I0; +})(); +var v3; +var I3 = (function () { + function I3() { + } + return I3; +})(); +var v4; +var I4 = (function () { + function I4() { + } + return I4; +})(); diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithClass.symbols b/tests/baselines/reference/circularTypeAliasForUnionWithClass.symbols new file mode 100644 index 00000000000..ecfba63332d --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithClass.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts === +var v0: T0; +>v0 : Symbol(v0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 3)) +>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 11)) + +type T0 = string | I0; +>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 11)) +>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithClass.ts, 1, 22)) + +class I0 { +>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithClass.ts, 1, 22)) + + x: T0; +>x : Symbol(x, Decl(circularTypeAliasForUnionWithClass.ts, 2, 10)) +>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 11)) +} + +var v3: T3; +>v3 : Symbol(v3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 3)) +>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 11)) + +type T3 = string | I3; +>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 11)) +>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithClass.ts, 7, 22)) + +class I3 { +>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithClass.ts, 7, 22)) + + [x: number]: T3; +>x : Symbol(x, Decl(circularTypeAliasForUnionWithClass.ts, 9, 5)) +>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 11)) +} + +var v4: T4; +>v4 : Symbol(v4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 3)) +>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 11)) + +type T4 = string | I4; +>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 11)) +>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithClass.ts, 13, 22)) + +class I4 { +>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithClass.ts, 13, 22)) + + [x: string]: T4; +>x : Symbol(x, Decl(circularTypeAliasForUnionWithClass.ts, 15, 5)) +>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 11)) +} + diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithClass.types b/tests/baselines/reference/circularTypeAliasForUnionWithClass.types new file mode 100644 index 00000000000..99a05f3d66a --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithClass.types @@ -0,0 +1,49 @@ +=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts === +var v0: T0; +>v0 : string | I0 +>T0 : string | I0 + +type T0 = string | I0; +>T0 : string | I0 +>I0 : I0 + +class I0 { +>I0 : I0 + + x: T0; +>x : string | I0 +>T0 : string | I0 +} + +var v3: T3; +>v3 : string | I3 +>T3 : string | I3 + +type T3 = string | I3; +>T3 : string | I3 +>I3 : I3 + +class I3 { +>I3 : I3 + + [x: number]: T3; +>x : number +>T3 : string | I3 +} + +var v4: T4; +>v4 : string | I4 +>T4 : string | I4 + +type T4 = string | I4; +>T4 : string | I4 +>I4 : I4 + +class I4 { +>I4 : I4 + + [x: string]: T4; +>x : string +>T4 : string | I4 +} + diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js new file mode 100644 index 00000000000..60f4df9a8b6 --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js @@ -0,0 +1,38 @@ +//// [circularTypeAliasForUnionWithInterface.ts] +var v0: T0; +type T0 = string | I0; +interface I0 { + x: T0; +} + +var v1: T1; +type T1 = string | I1; +interface I1 { + (): T1; +} + +var v2: T2; +type T2 = string | I2; +interface I2 { + new (): T2; +} + +var v3: T3; +type T3 = string | I3; +interface I3 { + [x: number]: T3; +} + +var v4: T4; +type T4 = string | I4; +interface I4 { + [x: string]: T4; +} + + +//// [circularTypeAliasForUnionWithInterface.js] +var v0; +var v1; +var v2; +var v3; +var v4; diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithInterface.symbols b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.symbols new file mode 100644 index 00000000000..29bc3098d91 --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.symbols @@ -0,0 +1,79 @@ +=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts === +var v0: T0; +>v0 : Symbol(v0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 3)) +>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 11)) + +type T0 = string | I0; +>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 11)) +>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithInterface.ts, 1, 22)) + +interface I0 { +>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithInterface.ts, 1, 22)) + + x: T0; +>x : Symbol(x, Decl(circularTypeAliasForUnionWithInterface.ts, 2, 14)) +>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 11)) +} + +var v1: T1; +>v1 : Symbol(v1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 3)) +>T1 : Symbol(T1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 11)) + +type T1 = string | I1; +>T1 : Symbol(T1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 11)) +>I1 : Symbol(I1, Decl(circularTypeAliasForUnionWithInterface.ts, 7, 22)) + +interface I1 { +>I1 : Symbol(I1, Decl(circularTypeAliasForUnionWithInterface.ts, 7, 22)) + + (): T1; +>T1 : Symbol(T1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 11)) +} + +var v2: T2; +>v2 : Symbol(v2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 3)) +>T2 : Symbol(T2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 11)) + +type T2 = string | I2; +>T2 : Symbol(T2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 11)) +>I2 : Symbol(I2, Decl(circularTypeAliasForUnionWithInterface.ts, 13, 22)) + +interface I2 { +>I2 : Symbol(I2, Decl(circularTypeAliasForUnionWithInterface.ts, 13, 22)) + + new (): T2; +>T2 : Symbol(T2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 11)) +} + +var v3: T3; +>v3 : Symbol(v3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 3)) +>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 11)) + +type T3 = string | I3; +>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 11)) +>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithInterface.ts, 19, 22)) + +interface I3 { +>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithInterface.ts, 19, 22)) + + [x: number]: T3; +>x : Symbol(x, Decl(circularTypeAliasForUnionWithInterface.ts, 21, 5)) +>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 11)) +} + +var v4: T4; +>v4 : Symbol(v4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 3)) +>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 11)) + +type T4 = string | I4; +>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 11)) +>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithInterface.ts, 25, 22)) + +interface I4 { +>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithInterface.ts, 25, 22)) + + [x: string]: T4; +>x : Symbol(x, Decl(circularTypeAliasForUnionWithInterface.ts, 27, 5)) +>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 11)) +} + diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithInterface.types b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.types new file mode 100644 index 00000000000..4325f9c774a --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.types @@ -0,0 +1,79 @@ +=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts === +var v0: T0; +>v0 : string | I0 +>T0 : string | I0 + +type T0 = string | I0; +>T0 : string | I0 +>I0 : I0 + +interface I0 { +>I0 : I0 + + x: T0; +>x : string | I0 +>T0 : string | I0 +} + +var v1: T1; +>v1 : string | I1 +>T1 : string | I1 + +type T1 = string | I1; +>T1 : string | I1 +>I1 : I1 + +interface I1 { +>I1 : I1 + + (): T1; +>T1 : string | I1 +} + +var v2: T2; +>v2 : string | I2 +>T2 : string | I2 + +type T2 = string | I2; +>T2 : string | I2 +>I2 : I2 + +interface I2 { +>I2 : I2 + + new (): T2; +>T2 : string | I2 +} + +var v3: T3; +>v3 : string | I3 +>T3 : string | I3 + +type T3 = string | I3; +>T3 : string | I3 +>I3 : I3 + +interface I3 { +>I3 : I3 + + [x: number]: T3; +>x : number +>T3 : string | I3 +} + +var v4: T4; +>v4 : string | I4 +>T4 : string | I4 + +type T4 = string | I4; +>T4 : string | I4 +>I4 : I4 + +interface I4 { +>I4 : I4 + + [x: string]: T4; +>x : string +>T4 : string | I4 +} + diff --git a/tests/baselines/reference/circularTypeofWithVarOrFunc.errors.txt b/tests/baselines/reference/circularTypeofWithVarOrFunc.errors.txt new file mode 100644 index 00000000000..26bff709ae1 --- /dev/null +++ b/tests/baselines/reference/circularTypeofWithVarOrFunc.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts(1,6): error TS2456: Type alias 'typeAlias1' circularly references itself. +tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts(2,5): error TS2502: 'varOfAliasedType1' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts(4,5): error TS2502: 'varOfAliasedType2' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts(5,6): error TS2456: Type alias 'typeAlias2' circularly references itself. +tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts(9,6): error TS2456: Type alias 'typeAlias3' circularly references itself. + + +==== tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts (5 errors) ==== + type typeAlias1 = typeof varOfAliasedType1; + ~~~~~~~~~~ +!!! error TS2456: Type alias 'typeAlias1' circularly references itself. + var varOfAliasedType1: typeAlias1; + ~~~~~~~~~~~~~~~~~ +!!! error TS2502: 'varOfAliasedType1' is referenced directly or indirectly in its own type annotation. + + var varOfAliasedType2: typeAlias2; + ~~~~~~~~~~~~~~~~~ +!!! error TS2502: 'varOfAliasedType2' is referenced directly or indirectly in its own type annotation. + type typeAlias2 = typeof varOfAliasedType2; + ~~~~~~~~~~ +!!! error TS2456: Type alias 'typeAlias2' circularly references itself. + + function func(): typeAlias3 { return null; } + var varOfAliasedType3 = func(); + type typeAlias3 = typeof varOfAliasedType3; + ~~~~~~~~~~ +!!! error TS2456: Type alias 'typeAlias3' circularly references itself. + \ No newline at end of file diff --git a/tests/baselines/reference/circularTypeofWithVarOrFunc.js b/tests/baselines/reference/circularTypeofWithVarOrFunc.js new file mode 100644 index 00000000000..9d569a3d219 --- /dev/null +++ b/tests/baselines/reference/circularTypeofWithVarOrFunc.js @@ -0,0 +1,17 @@ +//// [circularTypeofWithVarOrFunc.ts] +type typeAlias1 = typeof varOfAliasedType1; +var varOfAliasedType1: typeAlias1; + +var varOfAliasedType2: typeAlias2; +type typeAlias2 = typeof varOfAliasedType2; + +function func(): typeAlias3 { return null; } +var varOfAliasedType3 = func(); +type typeAlias3 = typeof varOfAliasedType3; + + +//// [circularTypeofWithVarOrFunc.js] +var varOfAliasedType1; +var varOfAliasedType2; +function func() { return null; } +var varOfAliasedType3 = func(); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 03d56d94e58..5d715556ec1 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -27,7 +27,7 @@ class Derived extends C3 { //// [classConstructorParametersAccessibility.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 1b16d13c82a..1d273e119ec 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -27,7 +27,7 @@ class Derived extends C3 { //// [classConstructorParametersAccessibility2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 9bd6c4bf7f5..43823bbb4d9 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -14,7 +14,7 @@ var d: Derived; d.p; // public, OK //// [classConstructorParametersAccessibility3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index c2bd2f09cf2..7299b04720f 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -12,7 +12,7 @@ module M { } //// [classDeclarationMergedInModuleWithContinuation.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index a62d5b1532b..52474582315 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -13,7 +13,7 @@ class StringTreeCollectionBase { class StringTreeCollection extends StringTreeCollectionBase { } //// [classDoesNotDependOnBaseTypes.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js index 754d6199115..4b1700df7af 100644 --- a/tests/baselines/reference/classExpressionWithDecorator1.js +++ b/tests/baselines/reference/classExpressionWithDecorator1.js @@ -2,7 +2,7 @@ var v = @decorate class C { static p = 1 }; //// [classExpressionWithDecorator1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 130bf5818ee..b8e079e8ecb 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -32,7 +32,7 @@ var r7 = d2.thing(''); var r8 = D2.other(1); //// [classExtendingClass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index 45e92dde5f8..b099ce763e8 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -16,7 +16,7 @@ class C8 extends E { } //// [classExtendingPrimitive.js] // classes cannot extend primitives -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 4ac6b14121a..3dcff0b44b9 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -6,7 +6,7 @@ class C5a extends null { } //// [classExtendingPrimitive2.js] // classes cannot extend primitives -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index c6721909db7..0289797d1e3 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -8,7 +8,7 @@ module M { } //// [classExtendingQualifiedName.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index 9fc31a231ea..76065ccc577 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -8,7 +8,7 @@ module M { } //// [classExtendingQualifiedName2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 6d4a9a09b67..21e0326f741 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -14,7 +14,7 @@ module Foo { } //// [classExtendsClauseClassMergedWithModuleNotReferingConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index 03fcfa19a37..8dc3410a179 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -7,7 +7,7 @@ module Foo { //// [classExtendsClauseClassNotReferringConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index 30966fedafc..afbb4dab714 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -17,7 +17,7 @@ class C5 extends foo { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index 37c0861f5ec..c41943072dd 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -4,7 +4,7 @@ class C2 extends { foo: string; } { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index e40c9154e31..a3e596299fa 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -9,7 +9,7 @@ class B2 implements Comparable2 {} //// [classExtendsInterface.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index bb6b68f07d6..79a4226731f 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -6,7 +6,7 @@ class D extends D { } // error class E extends E { } // error //// [classExtendsItself.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index 11b697cff6b..eee52b877e3 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -12,7 +12,7 @@ class D2 extends C2 { bar: T; } class E2 extends D2 { baz: T; } //// [classExtendsItselfIndirectly.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index 129b2f51b36..02201425cba 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -23,7 +23,7 @@ module O { } //// [classExtendsItselfIndirectly2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index 679525a40a6..bff6dd92bc9 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -19,7 +19,7 @@ class D2 extends C2 { bar: T; } class E2 extends D2 { baz: T; } //// [classExtendsItselfIndirectly_file1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -33,7 +33,7 @@ var C = (function (_super) { return C; })(E); // error //// [classExtendsItselfIndirectly_file2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -47,7 +47,7 @@ var D = (function (_super) { return D; })(C); //// [classExtendsItselfIndirectly_file3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -61,7 +61,7 @@ var E = (function (_super) { return E; })(D); //// [classExtendsItselfIndirectly_file4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -75,7 +75,7 @@ var C2 = (function (_super) { return C2; })(E2); // error //// [classExtendsItselfIndirectly_file5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -89,7 +89,7 @@ var D2 = (function (_super) { return D2; })(C2); //// [classExtendsItselfIndirectly_file6.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index 07d6450f405..7027e85450d 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -4,7 +4,7 @@ class B { } class C extends A,B { } //// [classExtendsMultipleBaseClasses.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index b7245b8095c..48f2e791139 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -9,7 +9,7 @@ module M { } //// [classExtendsShadowedConstructorFunction.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index c2f0f17e534..411bd3c2fba 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -6,7 +6,7 @@ var x = new foo(); // can be used as a constructor function class C extends foo { } // error, cannot extend it though //// [classExtendsValidConstructorFunction.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index 5c6470ffdfd..6d33f79a4d5 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -4,7 +4,7 @@ class D extends C, { } //// [classHeritageWithTrailingSeparator.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index bc4f6b6748c..49b73bfdb18 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -14,7 +14,7 @@ c = c2; c2 = c; //// [classImplementsClass2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index 450263d00c9..f8773b435bd 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -15,7 +15,7 @@ c = c2; c2 = c; //// [classImplementsClass3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index ac5c899bbbf..cf442b0ad24 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -17,7 +17,7 @@ c = c2; c2 = c; //// [classImplementsClass4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index a0971904cc3..a648f6bd63f 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -18,7 +18,7 @@ c = c2; c2 = c; //// [classImplementsClass5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index 931218e2bea..af6f0844d28 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -22,7 +22,7 @@ c.bar(); // error c2.bar(); // should error //// [classImplementsClass6.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index ca5c5913d75..9f630b96306 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -11,7 +11,7 @@ class D123 extends C123 { } //// [classIndexer3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index 3378aea91c0..374248c3a2c 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -3,7 +3,7 @@ class B extends A { } class A extends A { } //// [classInheritence.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index db9ae2adc28..a33bf5499be 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -16,7 +16,7 @@ class Derived2 extends Base<{ bar: string; }> { } //// [classIsSubtypeOfBaseType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt index f396b722263..47adb957141 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(4,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(4,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. @@ -11,7 +11,7 @@ tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error T }; export class Test1 { ~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. constructor(private field1: string) { } messageHandler = () => { diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt index 84e7994fd0c..9d1a2dd3418 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2304: Cannot find name 'field1'. ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (1 errors) ==== export var field1: string; ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ==== declare var console: { diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index 4bc1c3f790c..8eed39bddeb 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -20,7 +20,7 @@ a.foo(); //// [classOrder2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index ddf33831873..ae50152d608 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -16,7 +16,7 @@ class foo extends baz {} //// [classOrderBug.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 74df624a78c..66cbc0c25c7 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -16,7 +16,7 @@ A.bar(); // valid C2.bar(); // valid //// [classSideInheritance1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index f848226bb0e..e09301fe85f 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -21,7 +21,7 @@ class TextBase implements IText { } //// [classSideInheritance2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 9f90fad487b..a69b6ff0345 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -19,7 +19,7 @@ var r2: new (x: string) => A = B; // error var r3: typeof A = C; // ok //// [classSideInheritance3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 351ddac52e8..90149d88d9d 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -114,7 +114,7 @@ class R { } //// [classUpdateTests.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index 2c881a29a7c..f1a10b317a1 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -41,7 +41,7 @@ var d5 = new D(); // error var d6 = new D(1); // ok //// [classWithBaseClassButNoConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 10afc3a9f1b..467738e0966 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -50,7 +50,7 @@ module Generics { } //// [classWithConstructors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 4de87229ad0..7d86e1c7229 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -29,7 +29,7 @@ class D extends C { //// [classWithProtectedProperty.js] // accessing any protected outside the class is an error -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index 36b8bd0af64..edad6c22c70 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -20,7 +20,7 @@ var r2 = r.x; var r3 = r.foo; //// [classWithStaticMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index e9253b61cac..127e0e9f32b 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -94,7 +94,7 @@ class e { } //// [classdecl.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt b/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt index e9001265feb..2de3141da54 100644 --- a/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt +++ b/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/cloduleSplitAcrossFiles_module.ts(1,8): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/compiler/cloduleSplitAcrossFiles_module.ts(1,8): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged ==== tests/cases/compiler/cloduleSplitAcrossFiles_class.ts (0 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/cloduleSplitAcrossFiles_module.ts(1,8): error TS2433: A mod ==== tests/cases/compiler/cloduleSplitAcrossFiles_module.ts (1 errors) ==== module D { ~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var y = "hi"; } D.y; \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt index 1b0d9cf13ca..0f23d5c9a15 100644 --- a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt +++ b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/cloduleWithPriorInstantiatedModule.ts(2,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/cloduleWithPriorInstantiatedModule.ts(2,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged ==== tests/cases/compiler/cloduleWithPriorInstantiatedModule.ts (1 errors) ==== // Non-ambient & instantiated module. module Moclodule { ~~~~~~~~~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged export interface Someinterface { foo(): void; } diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index b4b31e59d3e..c37b9f0e96a 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -23,7 +23,7 @@ module Path.Utils { //// [clodulesDerivedClasses.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt index e782abd08b8..4273e3bb436 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts(1,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts(2,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts(1,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts(2,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts (2 errors) ==== import require = require('collisionExportsRequireAndAlias_file1'); // Error ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. import exports = require('collisionExportsRequireAndAlias_file3333'); // Error ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. export function foo() { require.bar(); } diff --git a/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt b/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt index ef0a9018f1d..d443a1ad308 100644 --- a/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts(1,14): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts(3,14): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts(1,14): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts(3,14): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts (2 errors) ==== export class require { ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. } export class exports { ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. } module m1 { class require { diff --git a/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt b/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt index d421cbe4d4b..fce7e932682 100644 --- a/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts(1,13): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts(1,13): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts (2 errors) ==== export enum require { // Error ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. _thisVal1, _thisVal2, } export enum exports { // Error ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. _thisVal1, _thisVal2, } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt b/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt index f52390ec28c..e7052759bc9 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/collisionExportsRequireAndFunction.ts(1,17): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndFunction.ts(4,17): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndFunction.ts(1,17): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndFunction.ts(4,17): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndFunction.ts (2 errors) ==== export function exports() { ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. return 1; } export function require() { ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. return "require"; } module m1 { diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt index 4207db04f53..569fad94f68 100644 --- a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(5,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(6,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(5,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(6,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts (2 errors) ==== @@ -9,10 +9,10 @@ tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(6,8): erro } import exports = m.c; ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. import require = m.c; ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. new exports(); new require(); diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt index cb11155718e..f08bf611e05 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(1,15): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(1,15): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts (2 errors) ==== export module require { ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. export interface I { } export class C { @@ -16,7 +16,7 @@ tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(10,15): } export module exports { ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. export interface I { } export class C { diff --git a/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt b/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt index 2efc84d5436..af7007c25f0 100644 --- a/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(3,5): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. -tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(4,5): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(3,5): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(4,5): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. ==== tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(4,5): error } var exports = 1; ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. var require = "require"; ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. module m1 { var exports = 0; var require = "require"; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index 92ddebd156c..a58f4aa9f94 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -40,7 +40,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInAccessors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index 0d6f15cc374..b89a8753acd 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -25,7 +25,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index 4e116deb802..efa9c1d9f03 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -29,7 +29,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index 45a4c704b52..228b7243d4f 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -19,7 +19,7 @@ class b extends Foo { } //// [collisionSuperAndLocalFunctionInProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index 5a8e54a6c3d..d2392f4df38 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -33,7 +33,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInAccessors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index 2cd7549c78c..dc3210c1f8e 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -21,7 +21,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index e7b374e5a61..7a6ee0c45c5 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -19,7 +19,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index 55777f920a2..f678c7cf6ca 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -18,7 +18,7 @@ class b extends Foo { } //// [collisionSuperAndLocalVarInProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index 763e151247e..540a2b659d9 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -12,7 +12,7 @@ class Foo extends base { } //// [collisionSuperAndNameResolution.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index be9e0ce3f68..ac8947e00d3 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -63,7 +63,7 @@ class Foo4 extends Foo { } //// [collisionSuperAndParameter.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index 11a4206624a..b072667396d 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -10,7 +10,7 @@ class Foo2 extends Foo { } //// [collisionSuperAndParameter1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index fd523d010fb..e96ae7d8928 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -31,7 +31,7 @@ class b4 extends a { } //// [collisionSuperAndPropertyNameAsConstuctorParameter.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index d502fc5c03a..dbf36111dfb 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -19,7 +19,7 @@ class b2 extends a { } //// [collisionThisExpressionAndLocalVarWithSuperExperssion.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/commentOnImportStatement1.errors.txt b/tests/baselines/reference/commentOnImportStatement1.errors.txt index 26a725a8f7c..c6dcaf31c4f 100644 --- a/tests/baselines/reference/commentOnImportStatement1.errors.txt +++ b/tests/baselines/reference/commentOnImportStatement1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/commentOnImportStatement1.ts(3,22): error TS2307: Cannot find external module './foo'. +tests/cases/compiler/commentOnImportStatement1.ts(3,22): error TS2307: Cannot find module './foo'. ==== tests/cases/compiler/commentOnImportStatement1.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/commentOnImportStatement1.ts(3,22): error TS2307: Cannot fi import foo = require('./foo'); ~~~~~~~ -!!! error TS2307: Cannot find external module './foo'. +!!! error TS2307: Cannot find module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement2.errors.txt b/tests/baselines/reference/commentOnImportStatement2.errors.txt index a2ea6c19d6e..31f11a1c148 100644 --- a/tests/baselines/reference/commentOnImportStatement2.errors.txt +++ b/tests/baselines/reference/commentOnImportStatement2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/commentOnImportStatement2.ts(2,22): error TS2307: Cannot find external module './foo'. +tests/cases/compiler/commentOnImportStatement2.ts(2,22): error TS2307: Cannot find module './foo'. ==== tests/cases/compiler/commentOnImportStatement2.ts (1 errors) ==== /* not copyright */ import foo = require('./foo'); ~~~~~~~ -!!! error TS2307: Cannot find external module './foo'. \ No newline at end of file +!!! error TS2307: Cannot find module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement3.errors.txt b/tests/baselines/reference/commentOnImportStatement3.errors.txt index 427bcf3aef7..ec47c42dc41 100644 --- a/tests/baselines/reference/commentOnImportStatement3.errors.txt +++ b/tests/baselines/reference/commentOnImportStatement3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/commentOnImportStatement3.ts(4,22): error TS2307: Cannot find external module './foo'. +tests/cases/compiler/commentOnImportStatement3.ts(4,22): error TS2307: Cannot find module './foo'. ==== tests/cases/compiler/commentOnImportStatement3.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/commentOnImportStatement3.ts(4,22): error TS2307: Cannot fi /* not copyright */ import foo = require('./foo'); ~~~~~~~ -!!! error TS2307: Cannot find external module './foo'. \ No newline at end of file +!!! error TS2307: Cannot find module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 06cd5840d68..4fe5a30cb8b 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -152,7 +152,7 @@ i2_i = i3_i; //// [commentsInheritance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index 4bdb1e38ba7..aebb486a1b5 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -195,7 +195,7 @@ var r8b6 = b5 !== a5; var r8b7 = b6 !== a6; //// [comparisonOperatorWithIdenticalObjects.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index 10250785642..3d7e96be633 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -169,7 +169,7 @@ var r8b6 = b6 !== a6; var r8b7 = b7 !== a7; //// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index 6235eb4b4d9..097246f183b 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -169,7 +169,7 @@ var r8b6 = b6 !== a6; var r8b7 = b7 !== a7; //// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index 43ae21c3b03..6bb3cddc8a7 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -112,7 +112,7 @@ var r8b3 = b3 !== a3; var r8b4 = b4 !== a4; //// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index 83adba638a6..dee8fb5ed5a 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -150,7 +150,7 @@ var r8b5 = b5 !== a5; var r8b6 = b6 !== a6; //// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index a5a52dccf83..bc7db12ebf2 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -150,7 +150,7 @@ var r8b5 = b5 !== a5; var r8b6 = b6 !== a6; //// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index 5a00fd85f3c..a35ece1b617 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -260,7 +260,7 @@ var r8b11 = b11 !== a11; //var r8b12 = b12 !== a12; //// [comparisonOperatorWithSubtypeObjectOnCallSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index cba4f67933b..8ade79daa20 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -222,7 +222,7 @@ var r8b9 = b9 !== a9; //var r8b10 = b10 !== a10; //// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index ec152ef0da5..080c7990c04 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -108,7 +108,7 @@ var r8b1 = b3 !== a3; var r8b1 = b4 !== a4; //// [comparisonOperatorWithSubtypeObjectOnIndexSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index 1f2400f9bea..f01b18496d5 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -165,7 +165,7 @@ var r8b6 = b6 !== a6; //var r8b7 = b7 !== a7; //// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index e80480e1a4e..bd4525e5c7b 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -165,7 +165,7 @@ var r8b6 = b6 !== a6; //var r8b7 = b7 !== a7; //// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index 99c64617531..cbd31f56b30 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -79,7 +79,7 @@ var rh3 = b1 !== a1; var rh4 = b2 !== a2; //// [comparisonOperatorWithSubtypeObjectOnProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index e8dc954e14c..2d750b77f71 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -48,7 +48,7 @@ class FooBase { } //// [complexClassRelationships.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index 49171d4c87b..920172b206d 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -6,7 +6,7 @@ class S18 extends S18 //// [complicatedGenericRecursiveBaseClassReference.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index d85d053f8eb..6e355e136e3 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -123,7 +123,7 @@ foo() += value; (foo()) += value; //// [compoundAssignmentLHSIsValue.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt index 49a1f008a05..ecbe59ccd1c 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts(3,10): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES5.ts(3, var obj = { [this.bar]: 0 ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt index 9e2d1afbe74..9a18ba4a631 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES6.ts(3,10): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES6.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES6.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames19_ES6.ts(3, var obj = { [this.bar]: 0 ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index 3fd4d41d0c2..e433383eb5c 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -9,7 +9,7 @@ class C extends Base { } //// [computedPropertyNames24_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index b6a8d254b26..eca2485ab7d 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -14,7 +14,7 @@ class C extends Base { } //// [computedPropertyNames25_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 7a0a982eb41..0e3b6c126bc 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -11,7 +11,7 @@ class C extends Base { } //// [computedPropertyNames26_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.js b/tests/baselines/reference/computedPropertyNames27_ES5.js index df1fed09724..12f02fbefa9 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -6,7 +6,7 @@ class C extends Base { } //// [computedPropertyNames27_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index 5940c498db8..b2be5f120a5 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -11,7 +11,7 @@ class C extends Base { } //// [computedPropertyNames28_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index 05196e23c5b..6bbca3da056 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -16,7 +16,7 @@ class C extends Base { } //// [computedPropertyNames30_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 173e3c7222b..fb7d651364b 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -16,7 +16,7 @@ class C extends Base { } //// [computedPropertyNames31_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index b689f02ee98..e51df61a8c1 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -13,7 +13,7 @@ class D extends C { } //// [computedPropertyNames43_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.js b/tests/baselines/reference/computedPropertyNames44_ES5.js index 32d3505e252..5efc5a11496 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -12,7 +12,7 @@ class D extends C { } //// [computedPropertyNames44_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.js b/tests/baselines/reference/computedPropertyNames45_ES5.js index 3d924b00b73..d7fb6f35407 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -13,7 +13,7 @@ class D extends C { } //// [computedPropertyNames45_ES5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 722310815ae..18c09a500a6 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -48,7 +48,7 @@ var result11: any = true ? 1 : 'string'; //// [conditionalOperatorWithIdenticalBCT.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 83262ed1301..62b887d7e60 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -24,7 +24,7 @@ var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.p //// [conditionalOperatorWithoutIdenticalBCT.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constDeclarations-access5.errors.txt b/tests/baselines/reference/constDeclarations-access5.errors.txt index a098b0e72c6..d58abfe6bd4 100644 --- a/tests/baselines/reference/constDeclarations-access5.errors.txt +++ b/tests/baselines/reference/constDeclarations-access5.errors.txt @@ -1,4 +1,4 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. tests/cases/compiler/constDeclarations_access_2.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead. tests/cases/compiler/constDeclarations_access_2.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant. tests/cases/compiler/constDeclarations_access_2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant. @@ -20,7 +20,7 @@ tests/cases/compiler/constDeclarations_access_2.ts(22,3): error TS2449: The oper tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/constDeclarations_access_2.ts (19 errors) ==== /// import m = require('constDeclarations_access_1'); diff --git a/tests/baselines/reference/constEnum1.js b/tests/baselines/reference/constEnum1.js new file mode 100644 index 00000000000..d5ccede3ff1 --- /dev/null +++ b/tests/baselines/reference/constEnum1.js @@ -0,0 +1,34 @@ +//// [constEnum1.ts] + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +const enum E { + a = 10, + b = a, + c = (a+1), + e, + d = ~e, + f = a << 2 >> 1, + g = a << 2 >>> 1, + h = a | b +} + +//// [constEnum1.js] +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + + +//// [constEnum1.d.ts] +declare const enum E { + a = 10, + b = 10, + c = 11, + e = 12, + d = -13, + f = 20, + g = 20, + h = 10, +} diff --git a/tests/baselines/reference/constEnum1.symbols b/tests/baselines/reference/constEnum1.symbols new file mode 100644 index 00000000000..e94ed0a4722 --- /dev/null +++ b/tests/baselines/reference/constEnum1.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/constEnums/constEnum1.ts === + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +const enum E { +>E : Symbol(E, Decl(constEnum1.ts, 0, 0)) + + a = 10, +>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14)) + + b = a, +>b : Symbol(E.b, Decl(constEnum1.ts, 6, 11)) +>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14)) + + c = (a+1), +>c : Symbol(E.c, Decl(constEnum1.ts, 7, 10)) +>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14)) + + e, +>e : Symbol(E.e, Decl(constEnum1.ts, 8, 14)) + + d = ~e, +>d : Symbol(E.d, Decl(constEnum1.ts, 9, 6)) +>e : Symbol(E.e, Decl(constEnum1.ts, 8, 14)) + + f = a << 2 >> 1, +>f : Symbol(E.f, Decl(constEnum1.ts, 10, 11)) +>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14)) + + g = a << 2 >>> 1, +>g : Symbol(E.g, Decl(constEnum1.ts, 11, 20)) +>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14)) + + h = a | b +>h : Symbol(E.h, Decl(constEnum1.ts, 12, 21)) +>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14)) +>b : Symbol(E.b, Decl(constEnum1.ts, 6, 11)) +} diff --git a/tests/baselines/reference/constEnum1.types b/tests/baselines/reference/constEnum1.types new file mode 100644 index 00000000000..9ae95992847 --- /dev/null +++ b/tests/baselines/reference/constEnum1.types @@ -0,0 +1,54 @@ +=== tests/cases/conformance/constEnums/constEnum1.ts === + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +const enum E { +>E : E + + a = 10, +>a : E +>10 : number + + b = a, +>b : E +>a : E + + c = (a+1), +>c : E +>(a+1) : number +>a+1 : number +>a : E +>1 : number + + e, +>e : E + + d = ~e, +>d : E +>~e : number +>e : E + + f = a << 2 >> 1, +>f : E +>a << 2 >> 1 : number +>a << 2 : number +>a : E +>2 : number +>1 : number + + g = a << 2 >>> 1, +>g : E +>a << 2 >>> 1 : number +>a << 2 : number +>a : E +>2 : number +>1 : number + + h = a | b +>h : E +>a | b : number +>a : E +>b : E +} diff --git a/tests/baselines/reference/constEnum2.errors.txt b/tests/baselines/reference/constEnum2.errors.txt new file mode 100644 index 00000000000..f0cac0c2f5d --- /dev/null +++ b/tests/baselines/reference/constEnum2.errors.txt @@ -0,0 +1,29 @@ +tests/cases/conformance/constEnums/constEnum2.ts(11,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. +tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. +tests/cases/conformance/constEnums/constEnum2.ts(13,5): error TS1005: ',' expected. +tests/cases/conformance/constEnums/constEnum2.ts(13,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. + + +==== tests/cases/conformance/constEnums/constEnum2.ts (4 errors) ==== + + // An enum declaration that specifies a const modifier is a constant enum declaration. + // In a constant enum declaration, all members must have constant values and + // it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + + // Error : not a constant enum expression + + const CONST = 9000 % 2; + const enum D { + d = 10, + e = 199 * Math.floor(Math.random() * 1000), + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. + f = d - (100 * Math.floor(Math.random() % 8)) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. + g = CONST, + ~ +!!! error TS1005: ',' expected. + ~~~~~ +!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/constEnum2.js b/tests/baselines/reference/constEnum2.js new file mode 100644 index 00000000000..c0c640b87fd --- /dev/null +++ b/tests/baselines/reference/constEnum2.js @@ -0,0 +1,32 @@ +//// [constEnum2.ts] + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +// Error : not a constant enum expression + +const CONST = 9000 % 2; +const enum D { + d = 10, + e = 199 * Math.floor(Math.random() * 1000), + f = d - (100 * Math.floor(Math.random() % 8)) + g = CONST, +} + +//// [constEnum2.js] +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. +// Error : not a constant enum expression +var CONST = 9000 % 2; + + +//// [constEnum2.d.ts] +declare const CONST: number; +declare const enum D { + d = 10, + e, + f, + g, +} diff --git a/tests/baselines/reference/constEnumPropertyAccess1.js b/tests/baselines/reference/constEnumPropertyAccess1.js new file mode 100644 index 00000000000..114f1e1928e --- /dev/null +++ b/tests/baselines/reference/constEnumPropertyAccess1.js @@ -0,0 +1,67 @@ +//// [constEnumPropertyAccess1.ts] + +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members + +const enum G { + A = 1, + B = 2, + C = A + B, + D = A * 2 +} + +var o: { + [idx: number]: boolean +} = { + 1: true + }; + +var a = G.A; +var a1 = G["A"]; +var g = o[G.A]; + +class C { + [G.A]() { } + get [G.B]() { + return true; + } + set [G.B](x: number) { } +} + + + +//// [constEnumPropertyAccess1.js] +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members +var o = { + 1: true +}; +var a = 1 /* A */; +var a1 = 1 /* "A" */; +var g = o[1 /* A */]; +class C { + [1 /* A */]() { } + get [2 /* B */]() { + return true; + } + set [2 /* B */](x) { } +} + + +//// [constEnumPropertyAccess1.d.ts] +declare const enum G { + A = 1, + B = 2, + C = 3, + D = 2, +} +declare var o: { + [idx: number]: boolean; +}; +declare var a: G; +declare var a1: G; +declare var g: boolean; +declare class C { +} diff --git a/tests/baselines/reference/constEnumPropertyAccess1.symbols b/tests/baselines/reference/constEnumPropertyAccess1.symbols new file mode 100644 index 00000000000..e5f2853f157 --- /dev/null +++ b/tests/baselines/reference/constEnumPropertyAccess1.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/constEnums/constEnumPropertyAccess1.ts === + +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members + +const enum G { +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) + + A = 1, +>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) + + B = 2, +>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 6, 10)) + + C = A + B, +>C : Symbol(G.C, Decl(constEnumPropertyAccess1.ts, 7, 10)) +>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) +>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 6, 10)) + + D = A * 2 +>D : Symbol(G.D, Decl(constEnumPropertyAccess1.ts, 8, 14)) +>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) +} + +var o: { +>o : Symbol(o, Decl(constEnumPropertyAccess1.ts, 12, 3)) + + [idx: number]: boolean +>idx : Symbol(idx, Decl(constEnumPropertyAccess1.ts, 13, 5)) + +} = { + 1: true + }; + +var a = G.A; +>a : Symbol(a, Decl(constEnumPropertyAccess1.ts, 18, 3)) +>G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) +>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) + +var a1 = G["A"]; +>a1 : Symbol(a1, Decl(constEnumPropertyAccess1.ts, 19, 3)) +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) +>"A" : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) + +var g = o[G.A]; +>g : Symbol(g, Decl(constEnumPropertyAccess1.ts, 20, 3)) +>o : Symbol(o, Decl(constEnumPropertyAccess1.ts, 12, 3)) +>G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) +>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) + +class C { +>C : Symbol(C, Decl(constEnumPropertyAccess1.ts, 20, 15)) + + [G.A]() { } +>G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) +>A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 5, 14)) + + get [G.B]() { +>G.B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 6, 10)) +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) +>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 6, 10)) + + return true; + } + set [G.B](x: number) { } +>G.B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 6, 10)) +>G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) +>B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 6, 10)) +>x : Symbol(x, Decl(constEnumPropertyAccess1.ts, 27, 14)) +} + + diff --git a/tests/baselines/reference/constEnumPropertyAccess1.types b/tests/baselines/reference/constEnumPropertyAccess1.types new file mode 100644 index 00000000000..5ed2b932bd0 --- /dev/null +++ b/tests/baselines/reference/constEnumPropertyAccess1.types @@ -0,0 +1,88 @@ +=== tests/cases/conformance/constEnums/constEnumPropertyAccess1.ts === + +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members + +const enum G { +>G : G + + A = 1, +>A : G +>1 : number + + B = 2, +>B : G +>2 : number + + C = A + B, +>C : G +>A + B : number +>A : G +>B : G + + D = A * 2 +>D : G +>A * 2 : number +>A : G +>2 : number +} + +var o: { +>o : { [idx: number]: boolean; } + + [idx: number]: boolean +>idx : number + +} = { +>{ 1: true } : { [x: number]: boolean; 1: boolean; } + + 1: true +>true : boolean + + }; + +var a = G.A; +>a : G +>G.A : G +>G : typeof G +>A : G + +var a1 = G["A"]; +>a1 : G +>G["A"] : G +>G : typeof G +>"A" : string + +var g = o[G.A]; +>g : boolean +>o[G.A] : boolean +>o : { [idx: number]: boolean; } +>G.A : G +>G : typeof G +>A : G + +class C { +>C : C + + [G.A]() { } +>G.A : G +>G : typeof G +>A : G + + get [G.B]() { +>G.B : G +>G : typeof G +>B : G + + return true; +>true : boolean + } + set [G.B](x: number) { } +>G.B : G +>G : typeof G +>B : G +>x : number +} + + diff --git a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt new file mode 100644 index 00000000000..19b273faffa --- /dev/null +++ b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt @@ -0,0 +1,35 @@ +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(15,12): error TS2476: A const enum member can only be accessed using a string literal. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type 'string' is not assignable to type 'G'. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS2364: Invalid left-hand side of assignment expression. + + +==== tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts (4 errors) ==== + + // constant enum declarations are completely erased in the emitted JavaScript code. + // it is an error to reference a constant enum object in any other context + // than a property access that selects one of the enum's members + + const enum G { + A = 1, + B = 2, + C = A + B, + D = A * 2 + } + + // Error from referring constant enum in any other context than a property access + var z = G; + ~ +!!! error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + var z1 = G[G.A]; + ~~~ +!!! error TS2476: A const enum member can only be accessed using a string literal. + var g: G; + g = "string"; + ~ +!!! error TS2322: Type 'string' is not assignable to type 'G'. + function foo(x: G) { } + G.B = 3; + ~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + \ No newline at end of file diff --git a/tests/baselines/reference/constEnumPropertyAccess2.js b/tests/baselines/reference/constEnumPropertyAccess2.js new file mode 100644 index 00000000000..46a1d918b94 --- /dev/null +++ b/tests/baselines/reference/constEnumPropertyAccess2.js @@ -0,0 +1,46 @@ +//// [constEnumPropertyAccess2.ts] + +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members + +const enum G { + A = 1, + B = 2, + C = A + B, + D = A * 2 +} + +// Error from referring constant enum in any other context than a property access +var z = G; +var z1 = G[G.A]; +var g: G; +g = "string"; +function foo(x: G) { } +G.B = 3; + + +//// [constEnumPropertyAccess2.js] +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members +// Error from referring constant enum in any other context than a property access +var z = G; +var z1 = G[1 /* A */]; +var g; +g = "string"; +function foo(x) { } +2 /* B */ = 3; + + +//// [constEnumPropertyAccess2.d.ts] +declare const enum G { + A = 1, + B = 2, + C = 3, + D = 2, +} +declare var z: typeof G; +declare var z1: any; +declare var g: G; +declare function foo(x: G): void; diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 408b56805fb..aa89c619e7e 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -14,7 +14,7 @@ function foo(tagName: any): Base { //// [constantOverloadFunction.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 591d6171dbe..529f888bfc9 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -15,7 +15,7 @@ function foo(tagName: any): Base { //// [constantOverloadFunctionNoSubtypeError.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index caeb2d32ee4..22b77ba6816 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -20,7 +20,7 @@ class Container { } //// [constraintCheckInGenericBaseTypeReference.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 3cc7bddd1d0..c1c10ead1e3 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -71,7 +71,7 @@ interface I extends A { //// [constructSignatureAssignabilityInInheritance2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index f9f8ca0c089..12907c6d032 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -114,7 +114,7 @@ module Errors { //// [constructSignatureAssignabilityInInheritance3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index 4119b87ba97..ef03802a17e 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -61,7 +61,7 @@ interface I extends A { //// [constructSignatureAssignabilityInInheritance4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index a33d2a03b26..9964a3464a1 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -51,7 +51,7 @@ interface I extends B { //// [constructSignatureAssignabilityInInheritance5.js] // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index f94845e82bf..4cf9b7d71f5 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -54,7 +54,7 @@ interface I9 extends A { // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures // all are errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index e77c6ed8e0f..93a47178d52 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -16,7 +16,7 @@ class Sub extends Super { //// [constructorArgs.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index 7262e5b7e0d..9c92f31ce97 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -20,7 +20,7 @@ class Derived2 extends Base { } //// [constructorFunctionTypeIsAssignableToBaseType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index 79094a38b1d..61cf399f613 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -34,7 +34,7 @@ class Derived2 extends Base { //// [constructorFunctionTypeIsAssignableToBaseType2.js] // the constructor function itself does not need to be a subtype of the base type constructor function -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 951593e9353..47020120f9f 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -32,7 +32,7 @@ module Generic { } //// [constructorHasPrototypeProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index e3eae0ed5a9..16da3f0fa0a 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -26,7 +26,7 @@ f1.bar1(); //// [constructorOverloads2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index c54226745c2..f4299466aa1 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -23,7 +23,7 @@ f1.bar1(); //// [constructorOverloads3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 5d607c8f5b2..2818793948f 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,4 +1,5 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2304: Cannot find name 'module'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -82,7 +83,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (82 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (83 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -96,6 +97,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS import fs = module("fs"); ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~~~~~~ +!!! error TS2503: Cannot find namespace 'module'. ~ !!! error TS1005: ';' expected. diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index b44d7faa5a6..01a1880ffd5 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -280,7 +280,7 @@ TypeScriptAllInOne.Program.Main(); //// [constructorWithIncompleteTypeAnnotation.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/contextualTyping.js.map b/tests/baselines/reference/contextualTyping.js.map index 614b3590371..a8835dc965d 100644 --- a/tests/baselines/reference/contextualTyping.js.map +++ b/tests/baselines/reference/contextualTyping.js.map @@ -1,2 +1,2 @@ //// [contextualTyping.js.map] -{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c9t5","C11t5","C11t5.constructor","EF1","Point"],"mappings":"AAYA,sCAAsC;AACtC;IAAAA;QACIC,QAAGA,GAAqCA,UAASA,CAACA;YAC9C,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IAADD,WAACA;AAADA,CAACA,AAJD,IAIC;AAED,uCAAuC;AACvC,IAAO,IAAI,CAIV;AAJD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAGA,GAAqCA,UAASA,CAACA;QACzD,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EAJM,IAAI,KAAJ,IAAI,QAIV;AAED,gCAAgC;AAChC,IAAI,IAAI,GAA0B,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,qCAAqC;AACrC;IAEIC;QACIC,IAAIA,CAACA,GAAGA,GAAGA,UAASA,CAACA,EAAEA,CAACA;YACpB,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IACLD,WAACA;AAADA,CAACA,AAPD,IAOC;AAED,sCAAsC;AACtC,IAAO,IAAI,CAKV;AALD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAqCA,CAACA;IACjDA,QAAGA,GAAGA,UAASA,CAACA,EAAEA,CAACA;QACf,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EALM,IAAI,KAAJ,IAAI,QAKV;AAED,+BAA+B;AAC/B,IAAI,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAE9D,kCAAkC;AAClC,IAAI,IAAY,CAAC;AACjB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AACF,yBAAyB;AACzB,cAAc,CAAsB,IAAGC,CAACA;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,MAAM,CAAO,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,4BAA4B;AAC5B,IAAI,KAAK,GAA8B,cAAa,MAAM,CAAC,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE/F,0BAA0B;AAC1B;IAAcC,eAAYA,CAAsBA;IAAIC,CAACA;IAACD,YAACA;AAADA,CAACA,AAAvD,IAAuD;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAErD,qCAAqC;AACrC,IAAI,KAAK,GAA2B,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,aAAa,CAAC,EAAC,CAAC,IAAIE,MAAMA,CAACA,CAACA,GAACA,CAACA,CAACA,CAACA,CAACA;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,eAAe,CAAC,EAAE,CAAC;IACfC,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IACXA,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IAEXA,MAAMA,CAACA,IAAIA,CAACA;AAChBA,CAACA;AAED,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} \ No newline at end of file +{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c9t5","C11t5","C11t5.constructor","EF1","Point"],"mappings":"AAaA,AADA,sCAAsC;;IACtCA;QACIC,QAAGA,GAAqCA,UAASA,CAACA;YAC9C,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IAADD,WAACA;AAADA,CAACA,AAJD,IAIC;AAGD,AADA,uCAAuC;AACvC,IAAO,IAAI,CAIV;AAJD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAGA,GAAqCA,UAASA,CAACA;QACzD,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EAJM,IAAI,KAAJ,IAAI,QAIV;AAGD,AADA,gCAAgC;IAC5B,IAAI,GAA0B,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAGF,AADA,qCAAqC;;IAGjCC;QACIC,IAAIA,CAACA,GAAGA,GAAGA,UAASA,CAACA,EAAEA,CAACA;YACpB,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IACLD,WAACA;AAADA,CAACA,AAPD,IAOC;AAGD,AADA,sCAAsC;AACtC,IAAO,IAAI,CAKV;AALD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAqCA,CAACA;IACjDA,QAAGA,GAAGA,UAASA,CAACA,EAAEA,CAACA;QACf,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EALM,IAAI,KAAJ,IAAI,QAKV;AAGD,AADA,+BAA+B;IAC3B,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAG9D,AADA,kCAAkC;IAC9B,IAAY,CAAC;AACjB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,AADA,yBAAyB;cACX,CAAsB,IAAGC,CAACA;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,MAAM,CAAO,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAGH,AADA,4BAA4B;IACxB,KAAK,GAA8B,cAAa,MAAM,CAAC,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAG/F,AADA,0BAA0B;;IACZC,eAAYA,CAAsBA;IAAIC,CAACA;IAACD,YAACA;AAADA,CAACA,AAAvD,IAAuD;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAGrD,AADA,qCAAqC;IACjC,KAAK,GAA2B,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,aAAa,CAAC,EAAC,CAAC,IAAIE,MAAMA,CAACA,CAACA,GAACA,CAACA,CAACA,CAACA,CAACA;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,eAAe,CAAC,EAAE,CAAC;IACfC,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IACXA,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IAEXA,MAAMA,CAACA,IAAIA,CAACA;AAChBA,CAACA;AAED,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.sourcemap.txt b/tests/baselines/reference/contextualTyping.sourcemap.txt index a2167e04577..085f6a439ff 100644 --- a/tests/baselines/reference/contextualTyping.sourcemap.txt +++ b/tests/baselines/reference/contextualTyping.sourcemap.txt @@ -10,7 +10,8 @@ sourceFile:contextualTyping.ts ------------------------------------------------------------------- >>>// CONTEXT: Class property declaration 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 >// DEFAULT INTERFACES >interface IFoo { > n: number; @@ -23,23 +24,21 @@ sourceFile:contextualTyping.ts > foo: IFoo; >} > + >// CONTEXT: Class property declaration > -2 >// CONTEXT: Class property declaration -1 >Emitted(1, 1) Source(13, 1) + SourceIndex(0) -2 >Emitted(1, 39) Source(13, 39) + SourceIndex(0) +2 > +3 >// CONTEXT: Class property declaration +1 >Emitted(1, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(13, 1) + SourceIndex(0) +3 >Emitted(1, 39) Source(13, 39) + SourceIndex(0) --- >>>var C1T5 = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> +>>> function C1T5() { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0) ---- ->>> function C1T5() { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -1->Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5) +1 >Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5) --- >>> this.foo = function (i) { 1->^^^^^^^^ @@ -128,13 +127,17 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Module property declaration 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + >// CONTEXT: Module property declaration > -2 >// CONTEXT: Module property declaration -1->Emitted(10, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(10, 40) Source(20, 40) + SourceIndex(0) +2 > +3 >// CONTEXT: Module property declaration +1->Emitted(10, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(10, 1) Source(20, 1) + SourceIndex(0) +3 >Emitted(10, 40) Source(20, 40) + SourceIndex(0) --- >>>var C2T5; 1 > @@ -254,65 +257,66 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Variable declaration 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^-> +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^-> 1-> > + >// CONTEXT: Variable declaration > -2 >// CONTEXT: Variable declaration -1->Emitted(17, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(17, 33) Source(27, 33) + SourceIndex(0) +2 > +3 >// CONTEXT: Variable declaration +1->Emitted(17, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(17, 1) Source(27, 1) + SourceIndex(0) +3 >Emitted(17, 33) Source(27, 33) + SourceIndex(0) --- >>>var c3t1 = (function (s) { return s; }); -1-> -2 >^^^^ -3 > ^^^^ -4 > ^^^ -5 > ^ -6 > ^^^^^^^^^^ -7 > ^ -8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ +1->^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ 1-> - > -2 >var -3 > c3t1 -4 > : (s: string) => string = -5 > ( -6 > function( -7 > s -8 > ) { -9 > return -10> -11> s -12> -13> -14> } -15> ) -16> ; -1->Emitted(18, 1) Source(28, 1) + SourceIndex(0) -2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0) -3 >Emitted(18, 9) Source(28, 9) + SourceIndex(0) -4 >Emitted(18, 12) Source(28, 35) + SourceIndex(0) -5 >Emitted(18, 13) Source(28, 36) + SourceIndex(0) -6 >Emitted(18, 23) Source(28, 45) + SourceIndex(0) -7 >Emitted(18, 24) Source(28, 46) + SourceIndex(0) -8 >Emitted(18, 28) Source(28, 50) + SourceIndex(0) -9 >Emitted(18, 34) Source(28, 56) + SourceIndex(0) -10>Emitted(18, 35) Source(28, 57) + SourceIndex(0) -11>Emitted(18, 36) Source(28, 58) + SourceIndex(0) -12>Emitted(18, 37) Source(28, 58) + SourceIndex(0) -13>Emitted(18, 38) Source(28, 59) + SourceIndex(0) -14>Emitted(18, 39) Source(28, 60) + SourceIndex(0) -15>Emitted(18, 40) Source(28, 61) + SourceIndex(0) -16>Emitted(18, 41) Source(28, 62) + SourceIndex(0) + >var +2 > c3t1 +3 > : (s: string) => string = +4 > ( +5 > function( +6 > s +7 > ) { +8 > return +9 > +10> s +11> +12> +13> } +14> ) +15> ; +1->Emitted(18, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(18, 9) Source(28, 9) + SourceIndex(0) +3 >Emitted(18, 12) Source(28, 35) + SourceIndex(0) +4 >Emitted(18, 13) Source(28, 36) + SourceIndex(0) +5 >Emitted(18, 23) Source(28, 45) + SourceIndex(0) +6 >Emitted(18, 24) Source(28, 46) + SourceIndex(0) +7 >Emitted(18, 28) Source(28, 50) + SourceIndex(0) +8 >Emitted(18, 34) Source(28, 56) + SourceIndex(0) +9 >Emitted(18, 35) Source(28, 57) + SourceIndex(0) +10>Emitted(18, 36) Source(28, 58) + SourceIndex(0) +11>Emitted(18, 37) Source(28, 58) + SourceIndex(0) +12>Emitted(18, 38) Source(28, 59) + SourceIndex(0) +13>Emitted(18, 39) Source(28, 60) + SourceIndex(0) +14>Emitted(18, 40) Source(28, 61) + SourceIndex(0) +15>Emitted(18, 41) Source(28, 62) + SourceIndex(0) --- >>>var c3t2 = ({ 1 > @@ -941,28 +945,27 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Class property assignment 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + >// CONTEXT: Class property assignment > -2 >// CONTEXT: Class property assignment -1->Emitted(40, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(40, 38) Source(55, 38) + SourceIndex(0) +2 > +3 >// CONTEXT: Class property assignment +1->Emitted(40, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(40, 1) Source(55, 1) + SourceIndex(0) +3 >Emitted(40, 38) Source(55, 38) + SourceIndex(0) --- >>>var C4T5 = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0) ---- >>> function C4T5() { -1->^^^^ +1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1->class C4T5 { +1 > + >class C4T5 { > foo: (i: number, s: string) => string; > -1->Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5) +1 >Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5) --- >>> this.foo = function (i, s) { 1->^^^^^^^^ @@ -1067,13 +1070,17 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Module property assignment 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + >// CONTEXT: Module property assignment > -2 >// CONTEXT: Module property assignment -1->Emitted(49, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(49, 39) Source(65, 39) + SourceIndex(0) +2 > +3 >// CONTEXT: Module property assignment +1->Emitted(49, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(49, 1) Source(65, 1) + SourceIndex(0) +3 >Emitted(49, 39) Source(65, 39) + SourceIndex(0) --- >>>var C5T5; 1 > @@ -1213,29 +1220,30 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Variable assignment 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + >// CONTEXT: Variable assignment > -2 >// CONTEXT: Variable assignment -1->Emitted(57, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(57, 32) Source(73, 32) + SourceIndex(0) +2 > +3 >// CONTEXT: Variable assignment +1->Emitted(57, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(57, 1) Source(73, 1) + SourceIndex(0) +3 >Emitted(57, 32) Source(73, 32) + SourceIndex(0) --- >>>var c6t5; -1 > -2 >^^^^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >var -3 > c6t5: (n: number) => IFoo -4 > ; -1 >Emitted(58, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(58, 5) Source(74, 5) + SourceIndex(0) -3 >Emitted(58, 9) Source(74, 30) + SourceIndex(0) -4 >Emitted(58, 10) Source(74, 31) + SourceIndex(0) + >var +2 > c6t5: (n: number) => IFoo +3 > ; +1 >Emitted(58, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(58, 9) Source(74, 30) + SourceIndex(0) +3 >Emitted(58, 10) Source(74, 31) + SourceIndex(0) --- >>>c6t5 = function (n) { return ({}); }; 1-> @@ -1287,29 +1295,30 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Array index assignment 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 > > + >// CONTEXT: Array index assignment > -2 >// CONTEXT: Array index assignment -1 >Emitted(60, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(60, 35) Source(77, 35) + SourceIndex(0) +2 > +3 >// CONTEXT: Array index assignment +1 >Emitted(60, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(60, 1) Source(77, 1) + SourceIndex(0) +3 >Emitted(60, 35) Source(77, 35) + SourceIndex(0) --- >>>var c7t2; -1 > -2 >^^^^ -3 > ^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^-> +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^-> 1 > - > -2 >var -3 > c7t2: IFoo[] -4 > ; -1 >Emitted(61, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(61, 5) Source(78, 5) + SourceIndex(0) -3 >Emitted(61, 9) Source(78, 17) + SourceIndex(0) -4 >Emitted(61, 10) Source(78, 18) + SourceIndex(0) + >var +2 > c7t2: IFoo[] +3 > ; +1 >Emitted(61, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(61, 9) Source(78, 17) + SourceIndex(0) +3 >Emitted(61, 10) Source(78, 18) + SourceIndex(0) --- >>>c7t2[0] = ({ n: 1 }); 1-> @@ -2142,30 +2151,31 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Function call 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> + >// CONTEXT: Function call > -2 >// CONTEXT: Function call -1->Emitted(86, 1) Source(145, 1) + SourceIndex(0) -2 >Emitted(86, 26) Source(145, 26) + SourceIndex(0) +2 > +3 >// CONTEXT: Function call +1->Emitted(86, 1) Source(146, 1) + SourceIndex(0) +2 >Emitted(86, 1) Source(145, 1) + SourceIndex(0) +3 >Emitted(86, 26) Source(145, 26) + SourceIndex(0) --- >>>function c9t5(f) { } -1 > -2 >^^^^^^^^^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ +1 >^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^ +4 > ^ 1 > - > -2 >function c9t5( -3 > f: (n: number) => IFoo -4 > ) { -5 > } -1 >Emitted(87, 1) Source(146, 1) + SourceIndex(0) -2 >Emitted(87, 15) Source(146, 15) + SourceIndex(0) -3 >Emitted(87, 16) Source(146, 37) + SourceIndex(0) -4 >Emitted(87, 20) Source(146, 40) + SourceIndex(0) name (c9t5) -5 >Emitted(87, 21) Source(146, 41) + SourceIndex(0) name (c9t5) + >function c9t5( +2 > f: (n: number) => IFoo +3 > ) { +4 > } +1 >Emitted(87, 15) Source(146, 15) + SourceIndex(0) +2 >Emitted(87, 16) Source(146, 37) + SourceIndex(0) +3 >Emitted(87, 20) Source(146, 40) + SourceIndex(0) name (c9t5) +4 >Emitted(87, 21) Source(146, 41) + SourceIndex(0) name (c9t5) --- >>>; 1 > @@ -2237,107 +2247,107 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Return statement 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > + >// CONTEXT: Return statement > -2 >// CONTEXT: Return statement -1->Emitted(92, 1) Source(151, 1) + SourceIndex(0) -2 >Emitted(92, 29) Source(151, 29) + SourceIndex(0) +2 > +3 >// CONTEXT: Return statement +1->Emitted(92, 1) Source(152, 1) + SourceIndex(0) +2 >Emitted(92, 1) Source(151, 1) + SourceIndex(0) +3 >Emitted(92, 29) Source(151, 29) + SourceIndex(0) --- >>>var c10t5 = function () { return function (n) { return ({}); }; }; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^^^^^^^^^^^^^ -6 > ^^^^^^ -7 > ^ -8 > ^^^^^^^^^^ -9 > ^ -10> ^^^^ -11> ^^^^^^ -12> ^ -13> ^ -14> ^^ -15> ^ -16> ^ -17> ^ -18> ^ -19> ^ -20> ^ -21> ^ -22> ^ +1->^^^^ +2 > ^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^^^^^^^ +8 > ^ +9 > ^^^^ +10> ^^^^^^ +11> ^ +12> ^ +13> ^^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ +20> ^ +21> ^ 1-> - > -2 >var -3 > c10t5 -4 > : () => (n: number) => IFoo = -5 > function() { -6 > return -7 > -8 > function( -9 > n -10> ) { -11> return -12> -13> ( -14> {} -15> ) -16> -17> -18> } -19> -20> -21> } -22> ; -1->Emitted(93, 1) Source(152, 1) + SourceIndex(0) -2 >Emitted(93, 5) Source(152, 5) + SourceIndex(0) -3 >Emitted(93, 10) Source(152, 10) + SourceIndex(0) -4 >Emitted(93, 13) Source(152, 40) + SourceIndex(0) -5 >Emitted(93, 27) Source(152, 53) + SourceIndex(0) -6 >Emitted(93, 33) Source(152, 59) + SourceIndex(0) -7 >Emitted(93, 34) Source(152, 60) + SourceIndex(0) -8 >Emitted(93, 44) Source(152, 69) + SourceIndex(0) -9 >Emitted(93, 45) Source(152, 70) + SourceIndex(0) -10>Emitted(93, 49) Source(152, 74) + SourceIndex(0) -11>Emitted(93, 55) Source(152, 80) + SourceIndex(0) -12>Emitted(93, 56) Source(152, 87) + SourceIndex(0) -13>Emitted(93, 57) Source(152, 88) + SourceIndex(0) -14>Emitted(93, 59) Source(152, 90) + SourceIndex(0) -15>Emitted(93, 60) Source(152, 91) + SourceIndex(0) -16>Emitted(93, 61) Source(152, 91) + SourceIndex(0) -17>Emitted(93, 62) Source(152, 92) + SourceIndex(0) -18>Emitted(93, 63) Source(152, 93) + SourceIndex(0) -19>Emitted(93, 64) Source(152, 93) + SourceIndex(0) -20>Emitted(93, 65) Source(152, 94) + SourceIndex(0) -21>Emitted(93, 66) Source(152, 95) + SourceIndex(0) -22>Emitted(93, 67) Source(152, 96) + SourceIndex(0) + >var +2 > c10t5 +3 > : () => (n: number) => IFoo = +4 > function() { +5 > return +6 > +7 > function( +8 > n +9 > ) { +10> return +11> +12> ( +13> {} +14> ) +15> +16> +17> } +18> +19> +20> } +21> ; +1->Emitted(93, 5) Source(152, 5) + SourceIndex(0) +2 >Emitted(93, 10) Source(152, 10) + SourceIndex(0) +3 >Emitted(93, 13) Source(152, 40) + SourceIndex(0) +4 >Emitted(93, 27) Source(152, 53) + SourceIndex(0) +5 >Emitted(93, 33) Source(152, 59) + SourceIndex(0) +6 >Emitted(93, 34) Source(152, 60) + SourceIndex(0) +7 >Emitted(93, 44) Source(152, 69) + SourceIndex(0) +8 >Emitted(93, 45) Source(152, 70) + SourceIndex(0) +9 >Emitted(93, 49) Source(152, 74) + SourceIndex(0) +10>Emitted(93, 55) Source(152, 80) + SourceIndex(0) +11>Emitted(93, 56) Source(152, 87) + SourceIndex(0) +12>Emitted(93, 57) Source(152, 88) + SourceIndex(0) +13>Emitted(93, 59) Source(152, 90) + SourceIndex(0) +14>Emitted(93, 60) Source(152, 91) + SourceIndex(0) +15>Emitted(93, 61) Source(152, 91) + SourceIndex(0) +16>Emitted(93, 62) Source(152, 92) + SourceIndex(0) +17>Emitted(93, 63) Source(152, 93) + SourceIndex(0) +18>Emitted(93, 64) Source(152, 93) + SourceIndex(0) +19>Emitted(93, 65) Source(152, 94) + SourceIndex(0) +20>Emitted(93, 66) Source(152, 95) + SourceIndex(0) +21>Emitted(93, 67) Source(152, 96) + SourceIndex(0) --- >>>// CONTEXT: Newing a class 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> 1 > > + >// CONTEXT: Newing a class > -2 >// CONTEXT: Newing a class -1 >Emitted(94, 1) Source(154, 1) + SourceIndex(0) -2 >Emitted(94, 27) Source(154, 27) + SourceIndex(0) +2 > +3 >// CONTEXT: Newing a class +1 >Emitted(94, 1) Source(155, 1) + SourceIndex(0) +2 >Emitted(94, 1) Source(154, 1) + SourceIndex(0) +3 >Emitted(94, 27) Source(154, 27) + SourceIndex(0) --- >>>var C11t5 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(95, 1) Source(155, 1) + SourceIndex(0) ---- >>> function C11t5(f) { 1->^^^^ 2 > ^^^^^^^^^^^^^^^ 3 > ^ -1->class C11t5 { +1-> + >class C11t5 { 2 > constructor( 3 > f: (n: number) => IFoo 1->Emitted(96, 5) Source(155, 15) + SourceIndex(0) name (C11t5) @@ -2449,65 +2459,66 @@ sourceFile:contextualTyping.ts --- >>>// CONTEXT: Type annotated expression 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^-> +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^-> 1 > > + >// CONTEXT: Type annotated expression > -2 >// CONTEXT: Type annotated expression -1 >Emitted(102, 1) Source(158, 1) + SourceIndex(0) -2 >Emitted(102, 38) Source(158, 38) + SourceIndex(0) +2 > +3 >// CONTEXT: Type annotated expression +1 >Emitted(102, 1) Source(159, 1) + SourceIndex(0) +2 >Emitted(102, 1) Source(158, 1) + SourceIndex(0) +3 >Emitted(102, 38) Source(158, 38) + SourceIndex(0) --- >>>var c12t1 = (function (s) { return s; }); -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^ -6 > ^^^^^^^^^^ -7 > ^ -8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ +1->^^^^ +2 > ^^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ 1-> - > -2 >var -3 > c12t1 -4 > = <(s: string) => string> -5 > ( -6 > function( -7 > s -8 > ) { -9 > return -10> -11> s -12> -13> -14> } -15> ) -16> ; -1->Emitted(103, 1) Source(159, 1) + SourceIndex(0) -2 >Emitted(103, 5) Source(159, 5) + SourceIndex(0) -3 >Emitted(103, 10) Source(159, 10) + SourceIndex(0) -4 >Emitted(103, 13) Source(159, 37) + SourceIndex(0) -5 >Emitted(103, 14) Source(159, 38) + SourceIndex(0) -6 >Emitted(103, 24) Source(159, 47) + SourceIndex(0) -7 >Emitted(103, 25) Source(159, 48) + SourceIndex(0) -8 >Emitted(103, 29) Source(159, 52) + SourceIndex(0) -9 >Emitted(103, 35) Source(159, 58) + SourceIndex(0) -10>Emitted(103, 36) Source(159, 59) + SourceIndex(0) -11>Emitted(103, 37) Source(159, 60) + SourceIndex(0) -12>Emitted(103, 38) Source(159, 60) + SourceIndex(0) -13>Emitted(103, 39) Source(159, 61) + SourceIndex(0) -14>Emitted(103, 40) Source(159, 62) + SourceIndex(0) -15>Emitted(103, 41) Source(159, 63) + SourceIndex(0) -16>Emitted(103, 42) Source(159, 64) + SourceIndex(0) + >var +2 > c12t1 +3 > = <(s: string) => string> +4 > ( +5 > function( +6 > s +7 > ) { +8 > return +9 > +10> s +11> +12> +13> } +14> ) +15> ; +1->Emitted(103, 5) Source(159, 5) + SourceIndex(0) +2 >Emitted(103, 10) Source(159, 10) + SourceIndex(0) +3 >Emitted(103, 13) Source(159, 37) + SourceIndex(0) +4 >Emitted(103, 14) Source(159, 38) + SourceIndex(0) +5 >Emitted(103, 24) Source(159, 47) + SourceIndex(0) +6 >Emitted(103, 25) Source(159, 48) + SourceIndex(0) +7 >Emitted(103, 29) Source(159, 52) + SourceIndex(0) +8 >Emitted(103, 35) Source(159, 58) + SourceIndex(0) +9 >Emitted(103, 36) Source(159, 59) + SourceIndex(0) +10>Emitted(103, 37) Source(159, 60) + SourceIndex(0) +11>Emitted(103, 38) Source(159, 60) + SourceIndex(0) +12>Emitted(103, 39) Source(159, 61) + SourceIndex(0) +13>Emitted(103, 40) Source(159, 62) + SourceIndex(0) +14>Emitted(103, 41) Source(159, 63) + SourceIndex(0) +15>Emitted(103, 42) Source(159, 64) + SourceIndex(0) --- >>>var c12t2 = ({ 1 > diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index 844a50428e2..e24ae90176c 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -15,7 +15,7 @@ var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; //// [contextualTypingArrayOfLambdas.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index b1100ba80a9..72c15455e8e 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -15,7 +15,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; //// [contextualTypingOfConditionalExpression.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index f832d2766ee..4e6b95a6857 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -13,7 +13,7 @@ var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; //// [contextualTypingOfConditionalExpression2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/copyrightWithNewLine1.errors.txt b/tests/baselines/reference/copyrightWithNewLine1.errors.txt index 680d783a1d9..11c34ed86a7 100644 --- a/tests/baselines/reference/copyrightWithNewLine1.errors.txt +++ b/tests/baselines/reference/copyrightWithNewLine1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/copyrightWithNewLine1.ts(5,24): error TS2307: Cannot find external module './greeter'. +tests/cases/compiler/copyrightWithNewLine1.ts(5,24): error TS2307: Cannot find module './greeter'. tests/cases/compiler/copyrightWithNewLine1.ts(6,10): error TS2304: Cannot find name 'document'. @@ -9,7 +9,7 @@ tests/cases/compiler/copyrightWithNewLine1.ts(6,10): error TS2304: Cannot find n import model = require("./greeter") ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './greeter'. +!!! error TS2307: Cannot find module './greeter'. var el = document.getElementById('content'); ~~~~~~~~ !!! error TS2304: Cannot find name 'document'. diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt index a4f792f2dae..d7f5f3129c7 100644 --- a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt +++ b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/copyrightWithoutNewLine1.ts(4,24): error TS2307: Cannot find external module './greeter'. +tests/cases/compiler/copyrightWithoutNewLine1.ts(4,24): error TS2307: Cannot find module './greeter'. tests/cases/compiler/copyrightWithoutNewLine1.ts(5,10): error TS2304: Cannot find name 'document'. @@ -8,7 +8,7 @@ tests/cases/compiler/copyrightWithoutNewLine1.ts(5,10): error TS2304: Cannot fin ****************************/ import model = require("./greeter") ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './greeter'. +!!! error TS2307: Cannot find module './greeter'. var el = document.getElementById('content'); ~~~~~~~~ !!! error TS2304: Cannot find name 'document'. diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index 8928e45694c..17c9ac649d8 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -11,7 +11,7 @@ var a: D = foo("hi", []); //// [crashInsourcePropertyIsRelatableToTargetProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index c19ab9a3fb1..134bacd6053 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -10,7 +10,7 @@ interface I extends X<() => number> { //// [declFileForFunctionTypeAsTypeParameter.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index dfeb6f5d3c3..23630ba5218 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -13,7 +13,7 @@ class Baz implements IBar { //// [declFileGenericClassWithGenericExtendedClass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index e01626a7ead..35fde5bde00 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -40,7 +40,7 @@ export var j = C.F6; //// [declFileGenericType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index db1399e64d3..03649af4ba6 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -43,7 +43,7 @@ module templa.dom.mvc.composite { //// [declFileGenericType2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 7da7dd8716a..8881122839e 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -21,7 +21,7 @@ module X.Y.base.Z { //// [declFileWithClassNameConflictingWithClassReferredByExtendsClause.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index 5f6509cb597..c06461e89fc 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -19,7 +19,7 @@ module A.B.C { } //// [declFileWithExtendsClauseThatHasItsContainerNameConflict.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js index 0d68c38cfda..8f4fa686e44 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -27,7 +27,7 @@ module M.P { } //// [declarationEmit_nameConflicts3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.js b/tests/baselines/reference/declarationEmit_protectedMembers.js index 61a4ebdfcab..faa1dc298e1 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.js +++ b/tests/baselines/reference/declarationEmit_protectedMembers.js @@ -51,7 +51,7 @@ class C4 { } //// [declarationEmit_protectedMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js index 974a678abda..2579a5557fc 100644 --- a/tests/baselines/reference/declareDottedExtend.js +++ b/tests/baselines/reference/declareDottedExtend.js @@ -12,7 +12,7 @@ class E extends A.B.C{ } //// [declareDottedExtend.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/declareModifierOnImport1.errors.txt b/tests/baselines/reference/declareModifierOnImport1.errors.txt index 776f2c07bcb..7260a8e48f3 100644 --- a/tests/baselines/reference/declareModifierOnImport1.errors.txt +++ b/tests/baselines/reference/declareModifierOnImport1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/declareModifierOnImport1.ts(1,1): error TS1079: A 'declare' modifier cannot be used with an import declaration. -tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2304: Cannot find name 'b'. +tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2503: Cannot find namespace 'b'. ==== tests/cases/compiler/declareModifierOnImport1.ts (2 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/declareModifierOnImport1.ts(1,20): error TS2304: Cannot fin ~~~~~~~ !!! error TS1079: A 'declare' modifier cannot be used with an import declaration. ~ -!!! error TS2304: Cannot find name 'b'. \ No newline at end of file +!!! error TS2503: Cannot find namespace 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.js b/tests/baselines/reference/decoratedClassFromExternalModule.js index da31e7c2f92..163a4a094b4 100644 --- a/tests/baselines/reference/decoratedClassFromExternalModule.js +++ b/tests/baselines/reference/decoratedClassFromExternalModule.js @@ -10,7 +10,7 @@ export default class Decorated { } import Decorated from 'decorated'; //// [decorated.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -21,7 +21,6 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target, function decorate() { } let Decorated = class { }; -Object.defineProperty(Decorated, "name", { value: "Decorated", configurable: true }); Decorated = __decorate([ decorate ], Decorated); diff --git a/tests/baselines/reference/decoratorOnClass1.js b/tests/baselines/reference/decoratorOnClass1.js index 49b2b27ac8b..b8099222acc 100644 --- a/tests/baselines/reference/decoratorOnClass1.js +++ b/tests/baselines/reference/decoratorOnClass1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClass1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClass2.js b/tests/baselines/reference/decoratorOnClass2.js index 71ac2358555..18492794331 100644 --- a/tests/baselines/reference/decoratorOnClass2.js +++ b/tests/baselines/reference/decoratorOnClass2.js @@ -6,7 +6,7 @@ export class C { } //// [decoratorOnClass2.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClass3.js b/tests/baselines/reference/decoratorOnClass3.js index 37da7043615..2291a2dbc57 100644 --- a/tests/baselines/reference/decoratorOnClass3.js +++ b/tests/baselines/reference/decoratorOnClass3.js @@ -7,7 +7,7 @@ class C { } //// [decoratorOnClass3.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClass4.js b/tests/baselines/reference/decoratorOnClass4.js index e56e427b797..484efdf6128 100644 --- a/tests/baselines/reference/decoratorOnClass4.js +++ b/tests/baselines/reference/decoratorOnClass4.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClass4.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClass5.js b/tests/baselines/reference/decoratorOnClass5.js index b415fcf8f9a..02ea01c3fd6 100644 --- a/tests/baselines/reference/decoratorOnClass5.js +++ b/tests/baselines/reference/decoratorOnClass5.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClass5.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClass8.js b/tests/baselines/reference/decoratorOnClass8.js index 500cdcf4511..e75ccac3c86 100644 --- a/tests/baselines/reference/decoratorOnClass8.js +++ b/tests/baselines/reference/decoratorOnClass8.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClass8.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.js b/tests/baselines/reference/decoratorOnClassAccessor1.js index 2e0f3520b43..2700c531e42 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.js +++ b/tests/baselines/reference/decoratorOnClassAccessor1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassAccessor1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.js b/tests/baselines/reference/decoratorOnClassAccessor2.js index a339c3b1663..c29c7598013 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.js +++ b/tests/baselines/reference/decoratorOnClassAccessor2.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassAccessor2.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.js b/tests/baselines/reference/decoratorOnClassAccessor3.js index 843a1113255..61430a986ac 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.js +++ b/tests/baselines/reference/decoratorOnClassAccessor3.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassAccessor3.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.js b/tests/baselines/reference/decoratorOnClassAccessor4.js index 416472ba5ff..0ad11c4c09e 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.js +++ b/tests/baselines/reference/decoratorOnClassAccessor4.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassAccessor4.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.js b/tests/baselines/reference/decoratorOnClassAccessor5.js index ba4e20955e9..53a43f7912c 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.js +++ b/tests/baselines/reference/decoratorOnClassAccessor5.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassAccessor5.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.js b/tests/baselines/reference/decoratorOnClassAccessor6.js index 05f0651e1e5..eaa21f45234 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.js +++ b/tests/baselines/reference/decoratorOnClassAccessor6.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassAccessor6.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js index aa477bcdaef..b2af1450123 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassConstructorParameter1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -14,7 +14,7 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target, case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; -if (typeof __param !== "function") __param = function (paramIndex, decorator) { +var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var C = (function () { diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js index 7b7f418ed02..5273482586e 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassConstructorParameter4.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -14,7 +14,7 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target, case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; -if (typeof __param !== "function") __param = function (paramIndex, decorator) { +var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var C = (function () { diff --git a/tests/baselines/reference/decoratorOnClassMethod1.js b/tests/baselines/reference/decoratorOnClassMethod1.js index c2f64cb0639..65c2f4b6008 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.js +++ b/tests/baselines/reference/decoratorOnClassMethod1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod10.js b/tests/baselines/reference/decoratorOnClassMethod10.js index ad934eb6d08..bae4e97fb5b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod10.js +++ b/tests/baselines/reference/decoratorOnClassMethod10.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod10.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod11.errors.txt b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt index 5e56c0b62a8..8e284f496a2 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts(5,10): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts(5,10): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts(5,10 @this.decorator ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. method() { } } } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index b55cdf81b24..5d4ac60c14e 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -9,7 +9,7 @@ module M { } //// [decoratorOnClassMethod11.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 4c2c19bd6a5..aa938eaaaf4 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -10,13 +10,13 @@ module M { } //// [decoratorOnClassMethod12.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; d.prototype = new __(); }; -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod13.js b/tests/baselines/reference/decoratorOnClassMethod13.js index be6d7449ee4..967cc05ba4d 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.js +++ b/tests/baselines/reference/decoratorOnClassMethod13.js @@ -7,7 +7,7 @@ class C { } //// [decoratorOnClassMethod13.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod2.js b/tests/baselines/reference/decoratorOnClassMethod2.js index 7500cebc12d..8b4ceeb47ee 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.js +++ b/tests/baselines/reference/decoratorOnClassMethod2.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod2.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod3.js b/tests/baselines/reference/decoratorOnClassMethod3.js index 54b2ae20d87..fff0e845860 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.js +++ b/tests/baselines/reference/decoratorOnClassMethod3.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod3.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod4.js b/tests/baselines/reference/decoratorOnClassMethod4.js index 7ce4596fc17..9f5b0d67eb1 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.js +++ b/tests/baselines/reference/decoratorOnClassMethod4.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod4.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod5.js b/tests/baselines/reference/decoratorOnClassMethod5.js index 9f768816b47..f767b176207 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.js +++ b/tests/baselines/reference/decoratorOnClassMethod5.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod5.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod6.js b/tests/baselines/reference/decoratorOnClassMethod6.js index 064992b1c7a..33dc4c86fd2 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.js +++ b/tests/baselines/reference/decoratorOnClassMethod6.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod6.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod7.js b/tests/baselines/reference/decoratorOnClassMethod7.js index 8635fe25b6a..c20a726fc46 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.js +++ b/tests/baselines/reference/decoratorOnClassMethod7.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod7.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethod8.js b/tests/baselines/reference/decoratorOnClassMethod8.js index e63de6d4db3..a664bdb8494 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.js +++ b/tests/baselines/reference/decoratorOnClassMethod8.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethod8.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.js index a81cdaa19c8..4a3ed36eec5 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.js +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassMethodParameter1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -14,7 +14,7 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target, case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; -if (typeof __param !== "function") __param = function (paramIndex, decorator) { +var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var C = (function () { diff --git a/tests/baselines/reference/decoratorOnClassProperty1.js b/tests/baselines/reference/decoratorOnClassProperty1.js index 23e5eec1cc0..567eb510cb3 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.js +++ b/tests/baselines/reference/decoratorOnClassProperty1.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty1.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassProperty10.js b/tests/baselines/reference/decoratorOnClassProperty10.js index b3848e73d57..b64986a8c97 100644 --- a/tests/baselines/reference/decoratorOnClassProperty10.js +++ b/tests/baselines/reference/decoratorOnClassProperty10.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty10.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassProperty11.js b/tests/baselines/reference/decoratorOnClassProperty11.js index 72ad6f276de..a33fc724180 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.js +++ b/tests/baselines/reference/decoratorOnClassProperty11.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty11.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassProperty2.js b/tests/baselines/reference/decoratorOnClassProperty2.js index 72fb1bcb331..f5de593b057 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.js +++ b/tests/baselines/reference/decoratorOnClassProperty2.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty2.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassProperty3.js b/tests/baselines/reference/decoratorOnClassProperty3.js index af72503b914..d2876d2cd6a 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.js +++ b/tests/baselines/reference/decoratorOnClassProperty3.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty3.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassProperty6.js b/tests/baselines/reference/decoratorOnClassProperty6.js index a8621e253e8..4ebd19ceee8 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.js +++ b/tests/baselines/reference/decoratorOnClassProperty6.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty6.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/decoratorOnClassProperty7.js b/tests/baselines/reference/decoratorOnClassProperty7.js index 6c7b3292235..045f8722b97 100644 --- a/tests/baselines/reference/decoratorOnClassProperty7.js +++ b/tests/baselines/reference/decoratorOnClassProperty7.js @@ -6,7 +6,7 @@ class C { } //// [decoratorOnClassProperty7.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 32e8cf4199e..37dc2db870b 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -34,7 +34,7 @@ class Derived4 extends Base2 { //// [derivedClassConstructorWithoutSuperCall.js] // derived class constructors must contain a super call -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index 615c3e7f7a6..eaf7dfd5698 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -15,7 +15,7 @@ class Derived extends Base { } //// [derivedClassFunctionOverridesBaseClassAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index f2e816604d2..b83255ccf93 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -41,7 +41,7 @@ var r8 = d2[1]; //// [derivedClassIncludesInheritedMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index a942e1ee237..1fe59d78044 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -18,7 +18,7 @@ class Derived2 extends Base2 { } //// [derivedClassOverridesIndexersWithAssignmentCompatibility.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index c1519f7695c..b9cd6df0338 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -16,7 +16,7 @@ class DerivedClass extends BaseClass { new DerivedClass(); //// [derivedClassOverridesPrivateFunction1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index f6a704e076a..2cc8360a803 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -16,7 +16,7 @@ class Derived2 extends Base2 { } //// [derivedClassOverridesPrivates.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index b66d356a73e..48ee6eded6c 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -37,7 +37,7 @@ class Derived extends Base { //// [derivedClassOverridesProtectedMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index 80f7456ab9a..fca27b0de04 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -64,7 +64,7 @@ var r8 = d2[1]; //// [derivedClassOverridesProtectedMembers2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index cfb6116ee85..2a102d55eac 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -72,7 +72,7 @@ class Derived10 extends Base { } //// [derivedClassOverridesProtectedMembers3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index e1d5b766b82..5145f3919a8 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -15,7 +15,7 @@ class Derived2 extends Derived1 { } //// [derivedClassOverridesProtectedMembers4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 9d7df0eee40..0529189e4c1 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -63,7 +63,7 @@ var r8 = d2[1]; //// [derivedClassOverridesPublicMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index 7a18c0d71a5..5cb746bfdd3 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -24,7 +24,7 @@ class Derived2 extends Base2 { } //// [derivedClassOverridesWithoutSubtype.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index 0ad14313c17..dd5b206ecdd 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -96,7 +96,7 @@ class Derived10 extends Base2 { //// [derivedClassParameterProperties.js] // ordering of super calls in derived constructors matters depending on other class contents -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index 14ac1f47e2f..d2914cd6949 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -33,7 +33,7 @@ class Derived extends Base { //// [derivedClassSuperCallsInNonConstructorMembers.js] // error to use super calls outside a constructor -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index 1902b6f4068..7c7e9b40cec 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -29,7 +29,7 @@ class Derived4 extends Base { } //// [derivedClassSuperCallsWithThisArg.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index 2088fc1122b..ad4f3e481a7 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -22,7 +22,7 @@ var r2 = e.foo(''); //// [derivedClassTransitivity.js] // subclassing is not transitive when you can remove required parameters and add optional parameters -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index 458aede164c..efeb25195ff 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -22,7 +22,7 @@ var r2 = e.foo(1, ''); //// [derivedClassTransitivity2.js] // subclassing is not transitive when you can remove required parameters and add optional parameters -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index 9768a8f5fa3..8befbf18731 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -22,7 +22,7 @@ var r2 = e.foo('', 1); //// [derivedClassTransitivity3.js] // subclassing is not transitive when you can remove required parameters and add optional parameters -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js index abf1a3b5bd0..546c7e4a849 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -22,7 +22,7 @@ var r2 = e.foo(''); //// [derivedClassTransitivity4.js] // subclassing is not transitive when you can remove required parameters and add optional parameters on protected members -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithAny.js b/tests/baselines/reference/derivedClassWithAny.js index 8070e689bd0..6f9ef484627 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -60,7 +60,7 @@ var r = c.foo(); // e.foo would return string //// [derivedClassWithAny.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index 8b00c632058..bf8b1b51cd1 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -23,7 +23,7 @@ class Derived extends Base { //// [derivedClassWithPrivateInstanceShadowingProtectedInstance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index 4ac57d159e6..131c529f3bf 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -33,7 +33,7 @@ var r6 = Derived.a; // error Derived.a = 2; // error //// [derivedClassWithPrivateInstanceShadowingPublicInstance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index 1037d3faaae..d661eeadc06 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -22,7 +22,7 @@ class Derived extends Base { } //// [derivedClassWithPrivateStaticShadowingProtectedStatic.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index c5bfea288bd..c3fc34b21c1 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -34,7 +34,7 @@ var r6 = Derived.a; // error Derived.a = 2; // error //// [derivedClassWithPrivateStaticShadowingPublicStatic.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 350e36b9bf7..16b9b110a5f 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -26,7 +26,7 @@ var d = new D(); // error var d2 = new D(new Date()); // ok //// [derivedClassWithoutExplicitConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index b0f10960578..6e413752f1d 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -34,7 +34,7 @@ var d3 = new D(new Date(), new Date()); var d4 = new D(new Date(), new Date(), new Date()); //// [derivedClassWithoutExplicitConstructor2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index 618750d3321..b72fdb1503d 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -48,7 +48,7 @@ var d3 = new D2(new Date(), new Date()); // ok //// [derivedClassWithoutExplicitConstructor3.js] // automatic constructors with a class hieararchy of depth > 2 -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index e256313d27b..7221031cb8b 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -31,7 +31,7 @@ b.hue(); //// [derivedClasses.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index 4d1f0452be4..b5bfbd5e5db 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -43,7 +43,7 @@ c = e; var r = c.foo(); // e.foo would return string //// [derivedGenericClassWithAny.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index 39e87b620d6..564a51f2b13 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -18,7 +18,7 @@ class Derived extends Base { } //// [derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index 50c8aba1ef8..f981a5e6e54 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -21,7 +21,7 @@ b = d2; var r: Base[] = [d1, d2]; //// [derivedTypeDoesNotRequireExtendsClause.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.js b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.js new file mode 100644 index 00000000000..bf71064264a --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.js @@ -0,0 +1,100 @@ +//// [destructuringArrayBindingPatternAndAssignment1ES5.ts] +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +var [a2 = false, a3 = 1]: any = undefined; + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; + +function foo() { + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +var [...b8] = foo(); + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [,,, c8] = [1, 2, 3, 4]; +var [,,, c9] = [1, 2, 3, 4]; +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; + + + +//// [destructuringArrayBindingPatternAndAssignment1ES5.js] +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true +// 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 the type Any, or +var a0 = undefined[0], a1 = undefined[1]; +var _a = undefined[0], a2 = _a === void 0 ? false : _a, _b = undefined[1], a3 = _b === void 0 ? 1 : _b; +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var _c = [2, 3, 4], b0 = _c[0], b1 = _c[1], b2 = _c[2]; +var _d = [1, 2, "string"], b3 = _d[0], b4 = _d[1], b5 = _d[2]; +function foo() { + return [1, 2, 3]; +} +var _e = foo(), b6 = _e[0], b7 = _e[1]; +var b8 = foo().slice(0); +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1, 2, 3]; +var _f = temp, c0 = _f[0], c1 = _f[1]; +var c2 = [][0]; +var _g = [[[]], [[[[]]]]], c3 = _g[0][0][0], c4 = _g[1][0][0][0][0]; +var _h = [[1], true], c5 = _h[0][0], c6 = _h[1]; +var _j = [1, 2, 3], c7 = _j[1]; +var _k = [1, 2, 3, 4], c8 = _k[3]; +var _l = [1, 2, 3, 4], c9 = _l[3]; +var _m = [1, 2, 3, 4, "hello"], c10 = _m.slice(3); +var _o = [1, 2, "string"], c11 = _o[0], c12 = _o[1], c13 = _o.slice(2); +var _p = [1, 2, "string"], c14 = _p[0], c15 = _p[1], c16 = _p[2]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.symbols b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.symbols new file mode 100644 index 00000000000..d8e319f4120 --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.symbols @@ -0,0 +1,105 @@ +=== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts === +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +>a0 : Symbol(a0, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 23, 5)) +>a1 : Symbol(a1, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 23, 8)) +>undefined : Symbol(undefined) + +var [a2 = false, a3 = 1]: any = undefined; +>a2 : Symbol(a2, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 24, 5)) +>a3 : Symbol(a3, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 24, 16)) +>undefined : Symbol(undefined) + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +>b0 : Symbol(b0, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 29, 5)) +>b1 : Symbol(b1, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 29, 8)) +>b2 : Symbol(b2, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 29, 12)) + +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; +>b3 : Symbol(b3, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 30, 5)) +>b4 : Symbol(b4, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 30, 8)) +>b5 : Symbol(b5, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 30, 12)) + +function foo() { +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 30, 62)) + + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +>b6 : Symbol(b6, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 36, 5)) +>b7 : Symbol(b7, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 36, 8)) +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 30, 62)) + +var [...b8] = foo(); +>b8 : Symbol(b8, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 37, 5)) +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 30, 62)) + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +>temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 40, 3)) + +var [c0, c1] = [...temp]; +>c0 : Symbol(c0, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 41, 5)) +>c1 : Symbol(c1, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 41, 8)) +>temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 40, 3)) + +var [c2] = []; +>c2 : Symbol(c2, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 42, 5)) + +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +>c3 : Symbol(c3, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 43, 7)) +>c4 : Symbol(c4, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 43, 17)) + +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +>c5 : Symbol(c5, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 44, 6)) +>c6 : Symbol(c6, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 44, 10)) + +var [, c7] = [1, 2, 3]; +>c7 : Symbol(c7, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 45, 6)) + +var [,,, c8] = [1, 2, 3, 4]; +>c8 : Symbol(c8, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 46, 8)) + +var [,,, c9] = [1, 2, 3, 4]; +>c9 : Symbol(c9, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 47, 8)) + +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +>c10 : Symbol(c10, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 48, 8)) + +var [c11, c12, ...c13] = [1, 2, "string"]; +>c11 : Symbol(c11, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 49, 5)) +>c12 : Symbol(c12, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 49, 9)) +>c13 : Symbol(c13, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 49, 14)) + +var [c14, c15, c16] = [1, 2, "string"]; +>c14 : Symbol(c14, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 50, 5)) +>c15 : Symbol(c15, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 50, 9)) +>c16 : Symbol(c16, Decl(destructuringArrayBindingPatternAndAssignment1ES5.ts, 50, 14)) + + diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types new file mode 100644 index 00000000000..bde9c867e2b --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types @@ -0,0 +1,177 @@ +=== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts === +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +>a0 : any +>a1 : any +>undefined : undefined + +var [a2 = false, a3 = 1]: any = undefined; +>a2 : boolean +>false : boolean +>a3 : number +>1 : number +>undefined : undefined + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +>b0 : number +>b1 : number +>b2 : number +>[2, 3, 4] : [number, number, number] +>2 : number +>3 : number +>4 : number + +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; +>b3 : number +>b4 : number +>b5 : string +>[1, 2, "string"] : [number, number, string] +>1 : number +>2 : number +>"string" : string + +function foo() { +>foo : () => number[] + + return [1, 2, 3]; +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number +} + +var [b6, b7] = foo(); +>b6 : number +>b7 : number +>foo() : number[] +>foo : () => number[] + +var [...b8] = foo(); +>b8 : number[] +>foo() : number[] +>foo : () => number[] + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +>temp : number[] +>[1,2,3] : number[] +>1 : number +>2 : number +>3 : number + +var [c0, c1] = [...temp]; +>c0 : number +>c1 : number +>[...temp] : number[] +>...temp : number +>temp : number[] + +var [c2] = []; +>c2 : any +>[] : undefined[] + +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +>c3 : any +>c4 : any +>[[[]], [[[[]]]]] : [[undefined[]], [[[undefined[]]]]] +>[[]] : [undefined[]] +>[] : undefined[] +>[[[[]]]] : [[[undefined[]]]] +>[[[]]] : [[undefined[]]] +>[[]] : [undefined[]] +>[] : undefined[] + +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +>c5 : string | number +>c6 : boolean +>[[1], true] : [[number], boolean] +>[1] : [number] +>1 : number +>true : boolean + +var [, c7] = [1, 2, 3]; +> : undefined +>c7 : number +>[1, 2, 3] : [number, number, number] +>1 : number +>2 : number +>3 : number + +var [,,, c8] = [1, 2, 3, 4]; +> : undefined +> : undefined +> : undefined +>c8 : number +>[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number + +var [,,, c9] = [1, 2, 3, 4]; +> : undefined +> : undefined +> : undefined +>c9 : number +>[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number + +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +> : undefined +> : undefined +> : undefined +>c10 : (string | number)[] +>[1, 2, 3, 4, "hello"] : (string | number)[] +>1 : number +>2 : number +>3 : number +>4 : number +>"hello" : string + +var [c11, c12, ...c13] = [1, 2, "string"]; +>c11 : string | number +>c12 : string | number +>c13 : (string | number)[] +>[1, 2, "string"] : (string | number)[] +>1 : number +>2 : number +>"string" : string + +var [c14, c15, c16] = [1, 2, "string"]; +>c14 : number +>c15 : number +>c16 : string +>[1, 2, "string"] : [number, number, string] +>1 : number +>2 : number +>"string" : string + + diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.js b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.js new file mode 100644 index 00000000000..d3a5c9ff5aa --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.js @@ -0,0 +1,99 @@ +//// [destructuringArrayBindingPatternAndAssignment1ES6.ts] + +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +var [a2 = false, a3 = 1]: any = undefined; + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; + +function foo() { + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +var [...b8] = foo(); + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [,,, c8] = [1, 2, 3, 4]; +var [,,, c9] = [1, 2, 3, 4]; +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; + +//// [destructuringArrayBindingPatternAndAssignment1ES6.js] +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true +// 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 the type Any, or +var [a0, a1] = undefined; +var [a2 = false, a3 = 1] = undefined; +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5] = [1, 2, "string"]; +function foo() { + return [1, 2, 3]; +} +var [b6, b7] = foo(); +var [...b8] = foo(); +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1, 2, 3]; +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]]; +var [[c5], c6] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [, , , c8] = [1, 2, 3, 4]; +var [, , , c9] = [1, 2, 3, 4]; +var [, , , ...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.symbols b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.symbols new file mode 100644 index 00000000000..33f9b4e88be --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.symbols @@ -0,0 +1,105 @@ +=== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts === + +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +>a0 : Symbol(a0, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 24, 5)) +>a1 : Symbol(a1, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 24, 8)) +>undefined : Symbol(undefined) + +var [a2 = false, a3 = 1]: any = undefined; +>a2 : Symbol(a2, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 25, 5)) +>a3 : Symbol(a3, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 25, 16)) +>undefined : Symbol(undefined) + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +>b0 : Symbol(b0, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 30, 5)) +>b1 : Symbol(b1, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 30, 8)) +>b2 : Symbol(b2, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 30, 12)) + +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; +>b3 : Symbol(b3, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 31, 5)) +>b4 : Symbol(b4, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 31, 8)) +>b5 : Symbol(b5, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 31, 12)) + +function foo() { +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 31, 62)) + + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +>b6 : Symbol(b6, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 37, 5)) +>b7 : Symbol(b7, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 37, 8)) +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 31, 62)) + +var [...b8] = foo(); +>b8 : Symbol(b8, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 38, 5)) +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 31, 62)) + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +>temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 41, 3)) + +var [c0, c1] = [...temp]; +>c0 : Symbol(c0, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 42, 5)) +>c1 : Symbol(c1, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 42, 8)) +>temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 41, 3)) + +var [c2] = []; +>c2 : Symbol(c2, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 43, 5)) + +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +>c3 : Symbol(c3, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 44, 7)) +>c4 : Symbol(c4, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 44, 17)) + +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +>c5 : Symbol(c5, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 45, 6)) +>c6 : Symbol(c6, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 45, 10)) + +var [, c7] = [1, 2, 3]; +>c7 : Symbol(c7, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 46, 6)) + +var [,,, c8] = [1, 2, 3, 4]; +>c8 : Symbol(c8, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 47, 8)) + +var [,,, c9] = [1, 2, 3, 4]; +>c9 : Symbol(c9, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 48, 8)) + +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +>c10 : Symbol(c10, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 49, 8)) + +var [c11, c12, ...c13] = [1, 2, "string"]; +>c11 : Symbol(c11, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 50, 5)) +>c12 : Symbol(c12, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 50, 9)) +>c13 : Symbol(c13, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 50, 14)) + +var [c14, c15, c16] = [1, 2, "string"]; +>c14 : Symbol(c14, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 51, 5)) +>c15 : Symbol(c15, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 51, 9)) +>c16 : Symbol(c16, Decl(destructuringArrayBindingPatternAndAssignment1ES6.ts, 51, 14)) + diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types new file mode 100644 index 00000000000..2d5d82c5efe --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types @@ -0,0 +1,177 @@ +=== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts === + +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +>a0 : any +>a1 : any +>undefined : undefined + +var [a2 = false, a3 = 1]: any = undefined; +>a2 : boolean +>false : boolean +>a3 : number +>1 : number +>undefined : undefined + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +>b0 : number +>b1 : number +>b2 : number +>[2, 3, 4] : [number, number, number] +>2 : number +>3 : number +>4 : number + +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; +>b3 : number +>b4 : number +>b5 : string +>[1, 2, "string"] : [number, number, string] +>1 : number +>2 : number +>"string" : string + +function foo() { +>foo : () => number[] + + return [1, 2, 3]; +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number +} + +var [b6, b7] = foo(); +>b6 : number +>b7 : number +>foo() : number[] +>foo : () => number[] + +var [...b8] = foo(); +>b8 : number[] +>foo() : number[] +>foo : () => number[] + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +>temp : number[] +>[1,2,3] : number[] +>1 : number +>2 : number +>3 : number + +var [c0, c1] = [...temp]; +>c0 : number +>c1 : number +>[...temp] : number[] +>...temp : number +>temp : number[] + +var [c2] = []; +>c2 : any +>[] : undefined[] + +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +>c3 : any +>c4 : any +>[[[]], [[[[]]]]] : [[undefined[]], [[[undefined[]]]]] +>[[]] : [undefined[]] +>[] : undefined[] +>[[[[]]]] : [[[undefined[]]]] +>[[[]]] : [[undefined[]]] +>[[]] : [undefined[]] +>[] : undefined[] + +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +>c5 : string | number +>c6 : boolean +>[[1], true] : [[number], boolean] +>[1] : [number] +>1 : number +>true : boolean + +var [, c7] = [1, 2, 3]; +> : undefined +>c7 : number +>[1, 2, 3] : [number, number, number] +>1 : number +>2 : number +>3 : number + +var [,,, c8] = [1, 2, 3, 4]; +> : undefined +> : undefined +> : undefined +>c8 : number +>[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number + +var [,,, c9] = [1, 2, 3, 4]; +> : undefined +> : undefined +> : undefined +>c9 : number +>[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number + +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +> : undefined +> : undefined +> : undefined +>c10 : (string | number)[] +>[1, 2, 3, 4, "hello"] : (string | number)[] +>1 : number +>2 : number +>3 : number +>4 : number +>"hello" : string + +var [c11, c12, ...c13] = [1, 2, "string"]; +>c11 : string | number +>c12 : string | number +>c13 : (string | number)[] +>[1, 2, "string"] : (string | number)[] +>1 : number +>2 : number +>"string" : string + +var [c14, c15, c16] = [1, 2, "string"]; +>c14 : number +>c15 : number +>c16 : string +>[1, 2, "string"] : [number, number, string] +>1 : number +>2 : number +>"string" : string + diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt new file mode 100644 index 00000000000..a2e5cb7e17c --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -0,0 +1,71 @@ +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2461: Type 'undefined' is not an array type. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2461: Type 'undefined' is not an array type. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. + 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]'. + Property '0' is missing in type 'number[]'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(34,5): error TS2461: Type 'F' is not an array type. + + +==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (8 errors) ==== + // 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 the type Any, or + var [[a0], [[a1]]] = [] // Error + ~~~~ +!!! error TS2461: Type 'undefined' is not an array type. + ~~~~~~ +!!! error TS2461: Type 'undefined' is not an array type. + var [[a2], [[a3]]] = undefined // Error + ~~~~~~~~~~~~~~ +!!! error TS2461: Type 'undefined' is not an array type. + + // 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, + // where N is the numeric index of E in the array assignment pattern, or + var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error + ~~~~~~~~~~~~ +!!! error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. +!!! error TS2322: Types of property '1' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. + interface J extends Array { + 2: number; + } + + function bar(): J { + return <[number, number, number]>[1, 2, 3]; + } + 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. + var temp = [1, 2, 3] + var [c0, c1]: [number, number] = [...temp]; // Error + ~~~~~~~~ +!!! error TS2322: Type 'number[]' is not assignable to type '[number, number]'. +!!! error TS2322: Property '0' is missing in type 'number[]'. + var [c2, c3]: [string, string] = [...temp]; // Error + ~~~~~~~~ +!!! error TS2322: Type 'number[]' is not assignable to type '[string, string]'. +!!! error TS2322: Property '0' is missing in type 'number[]'. + + interface F { + [idx: number]: boolean + } + + function foo(idx: number): F { + return { + 2: true + } + } + var [c4, c5, c6] = foo(1); // Error + ~~~~~~~~~~~~ +!!! error TS2461: Type 'F' is not an array type. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.js b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.js new file mode 100644 index 00000000000..fdbf47fd970 --- /dev/null +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.js @@ -0,0 +1,60 @@ +//// [destructuringArrayBindingPatternAndAssignment2.ts] +// 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 the type Any, or +var [[a0], [[a1]]] = [] // Error +var [[a2], [[a3]]] = undefined // Error + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error +interface J extends Array { + 2: number; +} + +function bar(): J { + return <[number, number, number]>[1, 2, 3]; +} +var [b3 = "string", b4, b5] = bar(); // Error + +// 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. +var temp = [1, 2, 3] +var [c0, c1]: [number, number] = [...temp]; // Error +var [c2, c3]: [string, string] = [...temp]; // Error + +interface F { + [idx: number]: boolean +} + +function foo(idx: number): F { + return { + 2: true + } +} +var [c4, c5, c6] = foo(1); // Error + +//// [destructuringArrayBindingPatternAndAssignment2.js] +// 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 the type Any, or +var _a = [], a0 = _a[0][0], a1 = _a[1][0][0]; // Error +var a2 = undefined[0][0], a3 = undefined[1][0][0]; // Error +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var _b = [1, 2, "string"], b0 = _b[0], b1 = _b[1], b2 = _b[2]; // Error +function bar() { + return [1, 2, 3]; +} +var _c = bar(), _d = _c[0], b3 = _d === void 0 ? "string" : _d, b4 = _c[1], b5 = _c[2]; // Error +// 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. +var temp = [1, 2, 3]; +var _e = temp, c0 = _e[0], c1 = _e[1]; // Error +var _f = temp, c2 = _f[0], c3 = _f[1]; // Error +function foo(idx) { + return { + 2: true + }; +} +var _g = foo(1), c4 = _g[0], c5 = _g[1], c6 = _g[2]; // Error diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js new file mode 100644 index 00000000000..f201b17deda --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js @@ -0,0 +1,90 @@ +//// [destructuringObjectBindingPatternAndAssignment1ES5.ts] +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +var { a2 }: any = {}; + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +var {1: b3} = { 1: "string" }; +var {b4 = 1}: any = { b4: 100000 }; +var {b5: { b52 } } = { b5: { b52 } }; + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { + [idx: number]: boolean; +} + +function foo(): F { + return { + 1: true + }; +} + +function bar(): F { + return { + 2: true + }; +} +var {1: c0} = foo(); +var {1: c1} = bar(); + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { + [str: string]: number; +} + +function foo1(): F1 { + return { + "prop1": 2 + } +} + +var {"prop1": d1} = foo1(); +var {"prop2": d1} = foo1(); + +//// [destructuringObjectBindingPatternAndAssignment1ES5.js] +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var a1 = undefined.a1; +var a2 = {}.a2; +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var b1 = { b1: 1 }.b1; +var _a = { b2: { b21: "world" } }.b2, b21 = (_a === void 0 ? { b21: "string" } : _a).b21; +var b3 = { 1: "string" }[1]; +var _b = { b4: 100000 }.b4, b4 = _b === void 0 ? 1 : _b; +var b52 = { b5: { b52: b52 } }.b5.b52; +function foo() { + return { + 1: true + }; +} +function bar() { + return { + 2: true + }; +} +var c0 = foo()[1]; +var c1 = bar()[1]; +function foo1() { + return { + "prop1": 2 + }; +} +var d1 = foo1()["prop1"]; +var d1 = foo1()["prop2"]; diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.symbols b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.symbols new file mode 100644 index 00000000000..017a7f71e61 --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts === +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +>a1 : Symbol(a1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 5, 5)) +>undefined : Symbol(undefined) + +var { a2 }: any = {}; +>a2 : Symbol(a2, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 6, 5)) + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +>b1 : Symbol(b1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 11, 5)) +>b1 : Symbol(b1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 11, 15)) + +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +>b21 : Symbol(b21, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 12, 11)) +>b21 : Symbol(b21, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 12, 21)) +>b2 : Symbol(b2, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 12, 44)) +>b21 : Symbol(b21, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 12, 50)) + +var {1: b3} = { 1: "string" }; +>b3 : Symbol(b3, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 13, 5)) + +var {b4 = 1}: any = { b4: 100000 }; +>b4 : Symbol(b4, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 14, 5)) +>b4 : Symbol(b4, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 14, 21)) + +var {b5: { b52 } } = { b5: { b52 } }; +>b52 : Symbol(b52, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 15, 10)) +>b5 : Symbol(b5, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 15, 23)) +>b52 : Symbol(b52, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 15, 29)) + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { +>F : Symbol(F, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 15, 38)) + + [idx: number]: boolean; +>idx : Symbol(idx, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 22, 5)) +} + +function foo(): F { +>foo : Symbol(foo, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 23, 1)) +>F : Symbol(F, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 15, 38)) + + return { + 1: true + }; +} + +function bar(): F { +>bar : Symbol(bar, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 29, 1)) +>F : Symbol(F, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 15, 38)) + + return { + 2: true + }; +} +var {1: c0} = foo(); +>c0 : Symbol(c0, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 36, 5)) +>foo : Symbol(foo, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 23, 1)) + +var {1: c1} = bar(); +>c1 : Symbol(c1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 37, 5)) +>bar : Symbol(bar, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 29, 1)) + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { +>F1 : Symbol(F1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 37, 20)) + + [str: string]: number; +>str : Symbol(str, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 43, 5)) +} + +function foo1(): F1 { +>foo1 : Symbol(foo1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 44, 1)) +>F1 : Symbol(F1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 37, 20)) + + return { + "prop1": 2 + } +} + +var {"prop1": d1} = foo1(); +>d1 : Symbol(d1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 52, 5), Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 53, 5)) +>foo1 : Symbol(foo1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 44, 1)) + +var {"prop2": d1} = foo1(); +>d1 : Symbol(d1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 52, 5), Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 53, 5)) +>foo1 : Symbol(foo1, Decl(destructuringObjectBindingPatternAndAssignment1ES5.ts, 44, 1)) + diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types new file mode 100644 index 00000000000..f44adab359f --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types @@ -0,0 +1,133 @@ +=== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts === +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +>a1 : any +>undefined : undefined + +var { a2 }: any = {}; +>a2 : any +>{} : {} + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +>b1 : number +>{ b1:1, } : { b1: number; } +>b1 : number +>1 : number + +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +>b2 : any +>b21 : string +>{ b21: "string" } : { b21: string; } +>b21 : string +>"string" : string +>{ b2: { b21: "world" } } : { b2: { b21: string; }; } +>b2 : { b21: string; } +>{ b21: "world" } : { b21: string; } +>b21 : string +>"world" : string + +var {1: b3} = { 1: "string" }; +>b3 : string +>{ 1: "string" } : { 1: string; } +>"string" : string + +var {b4 = 1}: any = { b4: 100000 }; +>b4 : number +>1 : number +>{ b4: 100000 } : { b4: number; } +>b4 : number +>100000 : number + +var {b5: { b52 } } = { b5: { b52 } }; +>b5 : any +>b52 : any +>{ b5: { b52 } } : { b5: { b52: any; }; } +>b5 : { b52: any; } +>{ b52 } : { b52: any; } +>b52 : any + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { +>F : F + + [idx: number]: boolean; +>idx : number +} + +function foo(): F { +>foo : () => F +>F : F + + return { +>{ 1: true } : { [x: number]: boolean; 1: boolean; } + + 1: true +>true : boolean + + }; +} + +function bar(): F { +>bar : () => F +>F : F + + return { +>{ 2: true } : { [x: number]: boolean; 2: boolean; } + + 2: true +>true : boolean + + }; +} +var {1: c0} = foo(); +>c0 : boolean +>foo() : F +>foo : () => F + +var {1: c1} = bar(); +>c1 : boolean +>bar() : F +>bar : () => F + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { +>F1 : F1 + + [str: string]: number; +>str : string +} + +function foo1(): F1 { +>foo1 : () => F1 +>F1 : F1 + + return { +>{ "prop1": 2 } : { [x: string]: number; "prop1": number; } + + "prop1": 2 +>2 : number + } +} + +var {"prop1": d1} = foo1(); +>d1 : number +>foo1() : F1 +>foo1 : () => F1 + +var {"prop2": d1} = foo1(); +>d1 : number +>foo1() : F1 +>foo1 : () => F1 + diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.js new file mode 100644 index 00000000000..0173645d8a3 --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.js @@ -0,0 +1,90 @@ +//// [destructuringObjectBindingPatternAndAssignment1ES6.ts] +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +var { a2 }: any = {}; + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +var {1: b3} = { 1: "string" }; +var {b4 = 1}: any = { b4: 100000 }; +var {b5: { b52 } } = { b5: { b52 } }; + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { + [idx: number]: boolean; +} + +function foo(): F { + return { + 1: true + }; +} + +function bar(): F { + return { + 2: true + }; +} +var {1: c0} = foo(); +var {1: c1} = bar(); + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { + [str: string]: number; +} + +function foo1(): F1 { + return { + "prop1": 2 + } +} + +var {"prop1": d1} = foo1(); +var {"prop2": d1} = foo1(); + +//// [destructuringObjectBindingPatternAndAssignment1ES6.js] +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 } = undefined; +var { a2 } = {}; +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1: 1, }; +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +var { 1: b3 } = { 1: "string" }; +var { b4 = 1 } = { b4: 100000 }; +var { b5: { b52 } } = { b5: { b52 } }; +function foo() { + return { + 1: true + }; +} +function bar() { + return { + 2: true + }; +} +var { 1: c0 } = foo(); +var { 1: c1 } = bar(); +function foo1() { + return { + "prop1": 2 + }; +} +var { "prop1": d1 } = foo1(); +var { "prop2": d1 } = foo1(); diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.symbols b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.symbols new file mode 100644 index 00000000000..11289210ee4 --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts === +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +>a1 : Symbol(a1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 5, 5)) +>undefined : Symbol(undefined) + +var { a2 }: any = {}; +>a2 : Symbol(a2, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 6, 5)) + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +>b1 : Symbol(b1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 11, 5)) +>b1 : Symbol(b1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 11, 15)) + +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +>b21 : Symbol(b21, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 12, 11)) +>b21 : Symbol(b21, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 12, 21)) +>b2 : Symbol(b2, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 12, 44)) +>b21 : Symbol(b21, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 12, 50)) + +var {1: b3} = { 1: "string" }; +>b3 : Symbol(b3, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 13, 5)) + +var {b4 = 1}: any = { b4: 100000 }; +>b4 : Symbol(b4, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 14, 5)) +>b4 : Symbol(b4, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 14, 21)) + +var {b5: { b52 } } = { b5: { b52 } }; +>b52 : Symbol(b52, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 15, 10)) +>b5 : Symbol(b5, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 15, 23)) +>b52 : Symbol(b52, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 15, 29)) + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { +>F : Symbol(F, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 15, 38)) + + [idx: number]: boolean; +>idx : Symbol(idx, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 22, 5)) +} + +function foo(): F { +>foo : Symbol(foo, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 23, 1)) +>F : Symbol(F, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 15, 38)) + + return { + 1: true + }; +} + +function bar(): F { +>bar : Symbol(bar, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 29, 1)) +>F : Symbol(F, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 15, 38)) + + return { + 2: true + }; +} +var {1: c0} = foo(); +>c0 : Symbol(c0, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 36, 5)) +>foo : Symbol(foo, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 23, 1)) + +var {1: c1} = bar(); +>c1 : Symbol(c1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 37, 5)) +>bar : Symbol(bar, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 29, 1)) + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { +>F1 : Symbol(F1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 37, 20)) + + [str: string]: number; +>str : Symbol(str, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 43, 5)) +} + +function foo1(): F1 { +>foo1 : Symbol(foo1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 44, 1)) +>F1 : Symbol(F1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 37, 20)) + + return { + "prop1": 2 + } +} + +var {"prop1": d1} = foo1(); +>d1 : Symbol(d1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 52, 5), Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 53, 5)) +>foo1 : Symbol(foo1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 44, 1)) + +var {"prop2": d1} = foo1(); +>d1 : Symbol(d1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 52, 5), Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 53, 5)) +>foo1 : Symbol(foo1, Decl(destructuringObjectBindingPatternAndAssignment1ES6.ts, 44, 1)) + diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types new file mode 100644 index 00000000000..47d4474b63e --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types @@ -0,0 +1,133 @@ +=== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts === +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +>a1 : any +>undefined : undefined + +var { a2 }: any = {}; +>a2 : any +>{} : {} + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +>b1 : number +>{ b1:1, } : { b1: number; } +>b1 : number +>1 : number + +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +>b2 : any +>b21 : string +>{ b21: "string" } : { b21: string; } +>b21 : string +>"string" : string +>{ b2: { b21: "world" } } : { b2: { b21: string; }; } +>b2 : { b21: string; } +>{ b21: "world" } : { b21: string; } +>b21 : string +>"world" : string + +var {1: b3} = { 1: "string" }; +>b3 : string +>{ 1: "string" } : { 1: string; } +>"string" : string + +var {b4 = 1}: any = { b4: 100000 }; +>b4 : number +>1 : number +>{ b4: 100000 } : { b4: number; } +>b4 : number +>100000 : number + +var {b5: { b52 } } = { b5: { b52 } }; +>b5 : any +>b52 : any +>{ b5: { b52 } } : { b5: { b52: any; }; } +>b5 : { b52: any; } +>{ b52 } : { b52: any; } +>b52 : any + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { +>F : F + + [idx: number]: boolean; +>idx : number +} + +function foo(): F { +>foo : () => F +>F : F + + return { +>{ 1: true } : { [x: number]: boolean; 1: boolean; } + + 1: true +>true : boolean + + }; +} + +function bar(): F { +>bar : () => F +>F : F + + return { +>{ 2: true } : { [x: number]: boolean; 2: boolean; } + + 2: true +>true : boolean + + }; +} +var {1: c0} = foo(); +>c0 : boolean +>foo() : F +>foo : () => F + +var {1: c1} = bar(); +>c1 : boolean +>bar() : F +>bar : () => F + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { +>F1 : F1 + + [str: string]: number; +>str : string +} + +function foo1(): F1 { +>foo1 : () => F1 +>F1 : F1 + + return { +>{ "prop1": 2 } : { [x: string]: number; "prop1": number; } + + "prop1": 2 +>2 : number + } +} + +var {"prop1": d1} = foo1(); +>d1 : number +>foo1() : F1 +>foo1 : () => F1 + +var {"prop2": d1} = foo1(); +>d1 : number +>foo1() : F1 +>foo1 : () => F1 + diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt new file mode 100644 index 00000000000..9025f24f992 --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.errors.txt @@ -0,0 +1,42 @@ +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(2,7): error TS1005: ',' expected. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(3,5): error TS2322: Type '{ i: number; }' is not assignable to type 'string | number'. + Type '{ i: number; }' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(3,6): error TS2459: Type 'string | number' has no property 'i' and no string index signature. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(4,6): error TS2459: Type 'string | number | {}' has no property 'i1' and no string index signature. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(5,12): error TS2459: Type '{ f212: string; }' has no property 'f21' and no string index signature. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(6,7): error TS1180: Property destructuring pattern expected. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(9,7): error TS1005: ':' expected. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(9,15): error TS1005: ':' expected. +tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(10,12): error TS1005: ':' expected. + + +==== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts (9 errors) ==== + // Error + var {h?} = { h?: 1 }; + ~ +!!! error TS1005: ',' expected. + var {i}: string | number = { i: 2 }; + ~~~ +!!! error TS2322: Type '{ i: number; }' is not assignable to type 'string | number'. +!!! error TS2322: Type '{ i: number; }' is not assignable to type 'number'. + ~ +!!! error TS2459: Type 'string | number' has no property 'i' and no string index signature. + var {i1}: string | number| {} = { i1: 2 }; + ~~ +!!! error TS2459: Type 'string | number | {}' has no property 'i1' and no string index signature. + var { f2: {f21} = { f212: "string" } }: any = undefined; + ~~~ +!!! error TS2459: Type '{ f212: string; }' has no property 'f21' and no string index signature. + var { ...d1 } = { + ~~~ +!!! error TS1180: Property destructuring pattern expected. + a: 1, b: 1, d1: 9, e: 10 + } + var {1} = { 1 }; + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1005: ':' expected. + var {"prop"} = { "prop": 1 }; + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js new file mode 100644 index 00000000000..77288e6a542 --- /dev/null +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js @@ -0,0 +1,23 @@ +//// [destructuringObjectBindingPatternAndAssignment3.ts] +// Error +var {h?} = { h?: 1 }; +var {i}: string | number = { i: 2 }; +var {i1}: string | number| {} = { i1: 2 }; +var { f2: {f21} = { f212: "string" } }: any = undefined; +var { ...d1 } = { + a: 1, b: 1, d1: 9, e: 10 +} +var {1} = { 1 }; +var {"prop"} = { "prop": 1 }; + +//// [destructuringObjectBindingPatternAndAssignment3.js] +// Error +var h = { h: 1 }.h; +var i = { i: 2 }.i; +var i1 = { i1: 2 }.i1; +var _a = undefined.f2, f21 = (_a === void 0 ? { f212: "string" } : _a).f21; +var d1 = { + a: 1, b: 1, d1: 9, e: 10 +}.d1; +var = { 1: }[1]; +var = { "prop": 1 }["prop"]; diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt new file mode 100644 index 00000000000..269d2b5640d --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt @@ -0,0 +1,124 @@ +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(32,4): error TS2345: Argument of type '[string, number, number]' is not assignable to parameter of type '[undefined, null, undefined]'. + Types of property '0' are incompatible. + Type 'string' is not assignable to type 'undefined'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(33,4): error TS2345: Argument of type '[[string], number, [[boolean, boolean]]]' is not assignable to parameter of type '[[undefined], undefined, [[undefined, undefined]]]'. + Types of property '0' are incompatible. + Type '[string]' is not assignable to type '[undefined]'. + Types of property '0' are incompatible. + Type 'string' is not assignable to type 'undefined'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(62,10): error TS2393: Duplicate function implementation. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(63,10): error TS2393: Duplicate function implementation. + + +==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts (4 errors) ==== + // A parameter declaration may specify either an identifier or a binding pattern. + // The identifiers specified in parameter declarations and binding patterns + // in a parameter list must be unique within that parameter list. + + // If the declaration includes a type annotation, the parameter is of that type + function a1([a, b, [[c]]]: [number, number, string[][]]) { } + function a2(o: { x: number, a: number }) { } + function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; + function a4({x, a}: { x: number, a: number }) { } + + a1([1, 2, [["world"]]]); + a1([1, 2, [["world"]], 3]); + + // If the declaration includes an initializer expression (which is permitted only + // when the parameter list occurs in conjunction with a function body), + // the parameter type is the widened form (section 3.11) of the type of the initializer expression. + + function b1(z = [undefined, null]) { }; + function b2(z = null, o = { x: 0, y: undefined }) { } + function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + + interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); + } + + function b6([a, z, y] = [undefined, null, undefined]) { } + function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + + b1([1, 2, 3]); // z is widen to the type any[] + b2("string", { x: 200, y: "string" }); + b2("string", { x: 200, y: true }); + b6(["string", 1, 2]); // Shouldn't be an error + ~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[string, number, number]' is not assignable to parameter of type '[undefined, null, undefined]'. +!!! error TS2345: Types of property '0' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'undefined'. + b7([["string"], 1, [[true, false]]]); // Shouldn't be an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[[string], number, [[boolean, boolean]]]' is not assignable to parameter of type '[[undefined], undefined, [[undefined, undefined]]]'. +!!! error TS2345: Types of property '0' are incompatible. +!!! error TS2345: Type '[string]' is not assignable to type '[undefined]'. +!!! error TS2345: Types of property '0' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'undefined'. + + + // If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) + enum Foo { a } + function c0({z: {x, y: {j}}}) { } + function c1({z} = { z: 10 }) { } + function c2({z = 10}) { } + function c3({b}: { b: number|string} = { b: "hello" }) { } + function c5([a, b, [[c]]]) { } + function c6([a, b, [[c=1]]]) { } + + c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } + c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + + c1(); // Implied type is {z:number}? + c1({ z: 1 }) // Implied type is {z:number}? + + c2({}); // Implied type is {z?: number} + c2({z:1}); // Implied type is {z?: number} + + c3({ b: 1 }); // Implied type is { b: number|string }. + + c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] + c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + + // A parameter can be marked optional by following its name or binding pattern with a question mark (?) + // or by including an initializer. + + function d0(x?) { } + ~~ +!!! error TS2393: Duplicate function implementation. + function d0(x = 10) { } + ~~ +!!! error TS2393: Duplicate function implementation. + + interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); + } + + class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } + } + + class C3 implements F2 { + d3([a, b, c]) { } + d4({x, y, z}) { } + e0([a, b, c]) { } + } + + + function d5({x, y} = { x: 1, y: 2 }) { } + d5(); // Parameter is optional as its declaration included an initializer + + // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, + // as such annotations would conflict with the already established meaning of colons in object literals. + // Type annotations must instead be written on the top- level parameter declaration + + function e1({x: number}) { } // x has type any NOT number + function e2({x}: { x: number }) { } // x is type number + function e3({x}: { x?: number }) { } // x is an optional with type number + function e4({x: [number,string,any] }) { } // x has type [any, any, any] + function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5.js b/tests/baselines/reference/destructuringParameterDeclaration1ES5.js new file mode 100644 index 00000000000..9a5b4eb8156 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5.js @@ -0,0 +1,226 @@ +//// [destructuringParameterDeclaration1ES5.ts] +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +function a2(o: { x: number, a: number }) { } +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +function a4({x, a}: { x: number, a: number }) { } + +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + +interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); +b6(["string", 1, 2]); // Shouldn't be an error +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string} = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c=1]]]) { } + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + +c1(); // Implied type is {z:number}? +c1({ z: 1 }) // Implied type is {z:number}? + +c2({}); // Implied type is {z?: number} +c2({z:1}); // Implied type is {z?: number} + +c3({ b: 1 }); // Implied type is { b: number|string }. + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +function d0(x?) { } +function d0(x = 10) { } + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } +} + +class C3 implements F2 { + d3([a, b, c]) { } + d4({x, y, z}) { } + e0([a, b, c]) { } +} + + +function d5({x, y} = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +function e2({x}: { x: number }) { } // x is type number +function e3({x}: { x?: number }) { } // x is an optional with type number +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] + + +//// [destructuringParameterDeclaration1ES5.js] +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. +// If the declaration includes a type annotation, the parameter is of that type +function a1(_a) { + var a = _a[0], b = _a[1], c = _a[2][0][0]; +} +function a2(o) { } +function a3(_a) { + var j = _a.j, k = _a.k, _b = _a.l, m = _b.m, n = _b.n, _c = _a.q, a = _c[0], b = _c[1], c = _c[2]; +} +; +function a4(_a) { + var x = _a.x, a = _a.a; +} +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. +function b1(z) { + if (z === void 0) { z = [undefined, null]; } +} +; +function b2(z, o) { + if (z === void 0) { z = null; } + if (o === void 0) { o = { x: 0, y: undefined }; } +} +function b3(_a) { + var _b = (_a === void 0 ? { z: { x: "hi", y: { j: 1 } } } : _a).z, x = _b.x, j = _b.y.j; +} +function b6(_a) { + var _b = _a === void 0 ? [undefined, null, undefined] : _a, a = _b[0], z = _b[1], y = _b[2]; +} +function b7(_a) { + var _b = _a === void 0 ? [[undefined], undefined, [[undefined, undefined]]] : _a, a = _b[0][0], b = _b[1], _c = _b[2][0], c = _c[0], d = _c[1]; +} +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); +b6(["string", 1, 2]); // Shouldn't be an error +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +var Foo; +(function (Foo) { + Foo[Foo["a"] = 0] = "a"; +})(Foo || (Foo = {})); +function c0(_a) { + var _b = _a.z, x = _b.x, j = _b.y.j; +} +function c1(_a) { + var z = (_a === void 0 ? { z: 10 } : _a).z; +} +function c2(_a) { + var _b = _a.z, z = _b === void 0 ? 10 : _b; +} +function c3(_a) { + var b = (_a === void 0 ? { b: "hello" } : _a).b; +} +function c5(_a) { + var a = _a[0], b = _a[1], c = _a[2][0][0]; +} +function c6(_a) { + var a = _a[0], b = _a[1], _b = _a[2][0][0], c = _b === void 0 ? 1 : _b; +} +c0({ z: { x: 1, y: { j: "world" } } }); // Implied type is { z: {x: any, y: {j: any}} } +c0({ z: { x: "string", y: { j: true } } }); // Implied type is { z: {x: any, y: {j: any}} } +c1(); // Implied type is {z:number}? +c1({ z: 1 }); // Implied type is {z:number}? +c2({}); // Implied type is {z?: number} +c2({ z: 1 }); // Implied type is {z?: number} +c3({ b: 1 }); // Implied type is { b: number|string }. +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. +function d0(x) { } +function d0(x) { + if (x === void 0) { x = 10; } +} +var C2 = (function () { + function C2() { + } + C2.prototype.d3 = function () { }; + C2.prototype.d4 = function () { }; + C2.prototype.e0 = function (_a) { + var a = _a[0], b = _a[1], c = _a[2]; + }; + return C2; +})(); +var C3 = (function () { + function C3() { + } + C3.prototype.d3 = function (_a) { + var a = _a[0], b = _a[1], c = _a[2]; + }; + C3.prototype.d4 = function (_a) { + var x = _a.x, y = _a.y, z = _a.z; + }; + C3.prototype.e0 = function (_a) { + var a = _a[0], b = _a[1], c = _a[2]; + }; + return C3; +})(); +function d5(_a) { + var _b = _a === void 0 ? { x: 1, y: 2 } : _a, x = _b.x, y = _b.y; +} +d5(); // Parameter is optional as its declaration included an initializer +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration +function e1(_a) { + var number = _a.x; +} // x has type any NOT number +function e2(_a) { + var x = _a.x; +} // x is type number +function e3(_a) { + var x = _a.x; +} // x is an optional with type number +function e4(_a) { + var _b = _a.x, number = _b[0], string = _b[1], any = _b[2]; +} // x has type [any, any, any] +function e5(_a) { + var _b = _a.x, a = _b[0], b = _b[1], c = _b[2]; +} // x has type [any, any, any] diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES6.js b/tests/baselines/reference/destructuringParameterDeclaration1ES6.js new file mode 100644 index 00000000000..6310a8f638e --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES6.js @@ -0,0 +1,169 @@ +//// [destructuringParameterDeclaration1ES6.ts] +// Conformance for emitting ES6 + +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +function a2(o: { x: number, a: number }) { } +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +function a4({x, a}: { x: number, a: number }) { } + +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); + + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + +interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string} = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c=1]]]) { } + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + +c1(); // Implied type is {z:number}? +c1({ z: 1 }) // Implied type is {z:number}? + +c2({}); // Implied type is {z?: number} +c2({z:1}); // Implied type is {z?: number} + +c3({ b: 1 }); // Implied type is { b: number|string }. + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } +} + +class C3 implements F2 { + d3([a, b, c]) { } + d4({x, y, z}) { } + e0([a, b, c]) { } +} + +function d5({x, y} = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +function e2({x}: { x: number }) { } // x is type number +function e3({x}: { x?: number }) { } // x is an optional with type number +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] + +function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier; + + + + +//// [destructuringParameterDeclaration1ES6.js] +// Conformance for emitting ES6 +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]) { } +function a2(o) { } +function a3({ j, k, l: { m, n }, q: [a, b, c] }) { } +; +function a4({ x, a }) { } +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. +function b1(z = [undefined, null]) { } +; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({ z: { x, y: { j } } } = { z: { x: "hi", y: { j: 1 } } }) { } +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +var Foo; +(function (Foo) { + Foo[Foo["a"] = 0] = "a"; +})(Foo || (Foo = {})); +function c0({ z: { x, y: { j } } }) { } +function c1({ z } = { z: 10 }) { } +function c2({ z = 10 }) { } +function c3({ b } = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c = 1]]]) { } +c0({ z: { x: 1, y: { j: "world" } } }); // Implied type is { z: {x: any, y: {j: any}} } +c0({ z: { x: "string", y: { j: true } } }); // Implied type is { z: {x: any, y: {j: any}} } +c1(); // Implied type is {z:number}? +c1({ z: 1 }); // Implied type is {z:number}? +c2({}); // Implied type is {z?: number} +c2({ z: 1 }); // Implied type is {z?: number} +c3({ b: 1 }); // Implied type is { b: number|string }. +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +class C2 { + constructor() { + } + d3() { } + d4() { } + e0([a, b, c]) { } +} +class C3 { + d3([a, b, c]) { } + d4({ x, y, z }) { } + e0([a, b, c]) { } +} +function d5({ x, y } = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration +function e1({ x: number }) { } // x has type any NOT number +function e2({ x }) { } // x is type number +function e3({ x }) { } // x is an optional with type number +function e4({ x: [number, string, any] }) { } // x has type [any, any, any] +function e5({ x: [a, b, c] }) { } // x has type [any, any, any] +function e6({ x: [number, number, number] }) { } // should be an error, duplicate identifier; diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES6.symbols b/tests/baselines/reference/destructuringParameterDeclaration1ES6.symbols new file mode 100644 index 00000000000..3267d4470db --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES6.symbols @@ -0,0 +1,314 @@ +=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts === +// Conformance for emitting ES6 + +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES6.ts, 0, 0)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 7, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 7, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 7, 21)) + +function a2(o: { x: number, a: number }) { } +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration1ES6.ts, 7, 60)) +>o : Symbol(o, Decl(destructuringParameterDeclaration1ES6.ts, 8, 12)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 8, 16)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 8, 27)) + +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +>a3 : Symbol(a3, Decl(destructuringParameterDeclaration1ES6.ts, 8, 44)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 9, 13)) +>k : Symbol(k, Decl(destructuringParameterDeclaration1ES6.ts, 9, 15)) +>m : Symbol(m, Decl(destructuringParameterDeclaration1ES6.ts, 9, 23)) +>n : Symbol(n, Decl(destructuringParameterDeclaration1ES6.ts, 9, 25)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 9, 34)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 9, 36)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 9, 39)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 9, 46)) +>k : Symbol(k, Decl(destructuringParameterDeclaration1ES6.ts, 9, 57)) +>l : Symbol(l, Decl(destructuringParameterDeclaration1ES6.ts, 9, 68)) +>m : Symbol(m, Decl(destructuringParameterDeclaration1ES6.ts, 9, 73)) +>n : Symbol(n, Decl(destructuringParameterDeclaration1ES6.ts, 9, 85)) +>q : Symbol(q, Decl(destructuringParameterDeclaration1ES6.ts, 9, 98)) + +function a4({x, a}: { x: number, a: number }) { } +>a4 : Symbol(a4, Decl(destructuringParameterDeclaration1ES6.ts, 9, 127)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 10, 13)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 10, 15)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 10, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 10, 32)) + +a1([1, 2, [["world"]]]); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES6.ts, 0, 0)) + +a1([1, 2, [["world"]], 3]); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES6.ts, 0, 0)) + + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +>b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES6.ts, 13, 27)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 20, 12)) +>undefined : Symbol(undefined) + +function b2(z = null, o = { x: 0, y: undefined }) { } +>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES6.ts, 20, 39)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 21, 12)) +>o : Symbol(o, Decl(destructuringParameterDeclaration1ES6.ts, 21, 21)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 21, 27)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 21, 33)) +>undefined : Symbol(undefined) + +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } +>b3 : Symbol(b3, Decl(destructuringParameterDeclaration1ES6.ts, 21, 53)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 22, 17)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 22, 24)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 22, 32)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 22, 37)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 22, 46)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 22, 51)) + +interface F1 { +>F1 : Symbol(F1, Decl(destructuringParameterDeclaration1ES6.ts, 22, 67)) + + b5(z, y, [, a, b], {p, m: { q, r}}); +>b5 : Symbol(b5, Decl(destructuringParameterDeclaration1ES6.ts, 24, 14)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 25, 7)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 25, 9)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 25, 15)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 25, 18)) +>p : Symbol(p, Decl(destructuringParameterDeclaration1ES6.ts, 25, 24)) +>q : Symbol(q, Decl(destructuringParameterDeclaration1ES6.ts, 25, 31)) +>r : Symbol(r, Decl(destructuringParameterDeclaration1ES6.ts, 25, 34)) +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +>b6 : Symbol(b6, Decl(destructuringParameterDeclaration1ES6.ts, 26, 1)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 28, 13)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 28, 15)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 28, 18)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } +>b7 : Symbol(b7, Decl(destructuringParameterDeclaration1ES6.ts, 28, 57)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 29, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 29, 17)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 29, 23)) +>d : Symbol(d, Decl(destructuringParameterDeclaration1ES6.ts, 29, 25)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +b1([1, 2, 3]); // z is widen to the type any[] +>b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES6.ts, 13, 27)) + +b2("string", { x: 200, y: "string" }); +>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES6.ts, 20, 39)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 32, 14)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 32, 22)) + +b2("string", { x: 200, y: true }); +>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES6.ts, 20, 39)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 33, 14)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 33, 22)) + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +>Foo : Symbol(Foo, Decl(destructuringParameterDeclaration1ES6.ts, 33, 34)) +>a : Symbol(Foo.a, Decl(destructuringParameterDeclaration1ES6.ts, 37, 10)) + +function c0({z: {x, y: {j}}}) { } +>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES6.ts, 37, 14)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 38, 17)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 38, 24)) + +function c1({z} = { z: 10 }) { } +>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES6.ts, 38, 33)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 39, 13)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 39, 19)) + +function c2({z = 10}) { } +>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES6.ts, 39, 32)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 40, 13)) + +function c3({b}: { b: number|string} = { b: "hello" }) { } +>c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES6.ts, 40, 25)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 41, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 41, 18)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 41, 40)) + +function c5([a, b, [[c]]]) { } +>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES6.ts, 41, 58)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 42, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 42, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 42, 21)) + +function c6([a, b, [[c=1]]]) { } +>c6 : Symbol(c6, Decl(destructuringParameterDeclaration1ES6.ts, 42, 30)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 43, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 43, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 43, 21)) + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES6.ts, 37, 14)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 45, 4)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 45, 9)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 45, 15)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 45, 20)) + +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES6.ts, 37, 14)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 46, 4)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 46, 9)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 46, 22)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES6.ts, 46, 27)) + +c1(); // Implied type is {z:number}? +>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES6.ts, 38, 33)) + +c1({ z: 1 }) // Implied type is {z:number}? +>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES6.ts, 38, 33)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 49, 4)) + +c2({}); // Implied type is {z?: number} +>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES6.ts, 39, 32)) + +c2({z:1}); // Implied type is {z?: number} +>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES6.ts, 39, 32)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 52, 4)) + +c3({ b: 1 }); // Implied type is { b: number|string }. +>c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES6.ts, 40, 25)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 54, 4)) + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES6.ts, 41, 58)) + +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES6.ts, 41, 58)) + + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +interface F2 { +>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES6.ts, 57, 38)) + + d3([a, b, c]?); +>d3 : Symbol(d3, Decl(destructuringParameterDeclaration1ES6.ts, 63, 14)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 64, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 64, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 64, 13)) + + d4({x, y, z}?); +>d4 : Symbol(d4, Decl(destructuringParameterDeclaration1ES6.ts, 64, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 65, 8)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 65, 10)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 65, 13)) + + e0([a, b, c]); +>e0 : Symbol(e0, Decl(destructuringParameterDeclaration1ES6.ts, 65, 19)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 66, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 66, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 66, 13)) +} + +class C2 implements F2 { +>C2 : Symbol(C2, Decl(destructuringParameterDeclaration1ES6.ts, 67, 1)) +>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES6.ts, 57, 38)) + + constructor() { } + d3() { } +>d3 : Symbol(d3, Decl(destructuringParameterDeclaration1ES6.ts, 70, 21)) + + d4() { } +>d4 : Symbol(d4, Decl(destructuringParameterDeclaration1ES6.ts, 71, 12)) + + e0([a, b, c]) { } +>e0 : Symbol(e0, Decl(destructuringParameterDeclaration1ES6.ts, 72, 12)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 73, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 73, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 73, 13)) +} + +class C3 implements F2 { +>C3 : Symbol(C3, Decl(destructuringParameterDeclaration1ES6.ts, 74, 1)) +>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES6.ts, 57, 38)) + + d3([a, b, c]) { } +>d3 : Symbol(d3, Decl(destructuringParameterDeclaration1ES6.ts, 76, 24)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 77, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 77, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 77, 13)) + + d4({x, y, z}) { } +>d4 : Symbol(d4, Decl(destructuringParameterDeclaration1ES6.ts, 77, 21)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 78, 8)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 78, 10)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES6.ts, 78, 13)) + + e0([a, b, c]) { } +>e0 : Symbol(e0, Decl(destructuringParameterDeclaration1ES6.ts, 78, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 79, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 79, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 79, 13)) +} + +function d5({x, y} = { x: 1, y: 2 }) { } +>d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES6.ts, 80, 1)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 82, 13)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 82, 15)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 82, 22)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES6.ts, 82, 28)) + +d5(); // Parameter is optional as its declaration included an initializer +>d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES6.ts, 80, 1)) + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +>e1 : Symbol(e1, Decl(destructuringParameterDeclaration1ES6.ts, 83, 5)) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 89, 13)) + +function e2({x}: { x: number }) { } // x is type number +>e2 : Symbol(e2, Decl(destructuringParameterDeclaration1ES6.ts, 89, 28)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 90, 13)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 90, 18)) + +function e3({x}: { x?: number }) { } // x is an optional with type number +>e3 : Symbol(e3, Decl(destructuringParameterDeclaration1ES6.ts, 90, 35)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 91, 13)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 91, 18)) + +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +>e4 : Symbol(e4, Decl(destructuringParameterDeclaration1ES6.ts, 91, 36)) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 92, 17)) +>string : Symbol(string, Decl(destructuringParameterDeclaration1ES6.ts, 92, 24)) +>any : Symbol(any, Decl(destructuringParameterDeclaration1ES6.ts, 92, 31)) + +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] +>e5 : Symbol(e5, Decl(destructuringParameterDeclaration1ES6.ts, 92, 42)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES6.ts, 93, 17)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES6.ts, 93, 19)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES6.ts, 93, 22)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES6.ts, 93, 29)) + +function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier; +>e6 : Symbol(e6, Decl(destructuringParameterDeclaration1ES6.ts, 93, 64)) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 95, 17), Decl(destructuringParameterDeclaration1ES6.ts, 95, 24), Decl(destructuringParameterDeclaration1ES6.ts, 95, 32)) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 95, 17), Decl(destructuringParameterDeclaration1ES6.ts, 95, 24), Decl(destructuringParameterDeclaration1ES6.ts, 95, 32)) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES6.ts, 95, 17), Decl(destructuringParameterDeclaration1ES6.ts, 95, 24), Decl(destructuringParameterDeclaration1ES6.ts, 95, 32)) + + + diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES6.types b/tests/baselines/reference/destructuringParameterDeclaration1ES6.types new file mode 100644 index 00000000000..9395fa49b5b --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES6.types @@ -0,0 +1,422 @@ +=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts === +// Conformance for emitting ES6 + +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void +>a : number +>b : number +>c : string + +function a2(o: { x: number, a: number }) { } +>a2 : (o: { x: number; a: number; }) => void +>o : { x: number; a: number; } +>x : number +>a : number + +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +>a3 : ({j, k, l: {m, n}, q: [a, b, c]}: { j: number; k: string; l: { m: boolean; n: number; }; q: (string | number)[]; }) => void +>j : number +>k : string +>l : any +>m : boolean +>n : number +>q : any +>a : string | number +>b : string | number +>c : string | number +>j : number +>k : string +>l : { m: boolean; n: number; } +>m : boolean +>n : number +>q : (string | number)[] + +function a4({x, a}: { x: number, a: number }) { } +>a4 : ({x, a}: { x: number; a: number; }) => void +>x : number +>a : number +>x : number +>a : number + +a1([1, 2, [["world"]]]); +>a1([1, 2, [["world"]]]) : void +>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void +>[1, 2, [["world"]]] : [number, number, string[][]] +>1 : number +>2 : number +>[["world"]] : string[][] +>["world"] : string[] +>"world" : string + +a1([1, 2, [["world"]], 3]); +>a1([1, 2, [["world"]], 3]) : void +>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void +>[1, 2, [["world"]], 3] : [number, number, string[][], number] +>1 : number +>2 : number +>[["world"]] : string[][] +>["world"] : string[] +>"world" : string +>3 : number + + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +>b1 : (z?: any[]) => void +>z : any[] +>[undefined, null] : null[] +>undefined : undefined +>null : null + +function b2(z = null, o = { x: 0, y: undefined }) { } +>b2 : (z?: any, o?: { x: number; y: any; }) => void +>z : any +>null : null +>o : { x: number; y: any; } +>{ x: 0, y: undefined } : { x: number; y: undefined; } +>x : number +>0 : number +>y : undefined +>undefined : undefined + +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } +>b3 : ({z: {x, y: {j}}}?: { z: { x: string; y: { j: number; }; }; }) => void +>z : any +>x : string +>y : any +>j : number +>{ z: { x: "hi", y: { j: 1 } } } : { z: { x: string; y: { j: number; }; }; } +>z : { x: string; y: { j: number; }; } +>{ x: "hi", y: { j: 1 } } : { x: string; y: { j: number; }; } +>x : string +>"hi" : string +>y : { j: number; } +>{ j: 1 } : { j: number; } +>j : number +>1 : number + +interface F1 { +>F1 : F1 + + b5(z, y, [, a, b], {p, m: { q, r}}); +>b5 : (z: any, y: any, [, a, b]: [any, any, any], {p, m: { q, r}}: { p: any; m: { q: any; r: any; }; }) => any +>z : any +>y : any +> : undefined +>a : any +>b : any +>p : any +>m : any +>q : any +>r : any +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +>b6 : ([a, z, y]?: [undefined, null, undefined]) => void +>a : any +>z : any +>y : any +>[undefined, null, undefined] : [undefined, null, undefined] +>undefined : undefined +>null : null +>undefined : undefined + +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } +>b7 : ([[a], b, [[c, d]]]?: [[undefined], undefined, [[undefined, undefined]]]) => void +>a : any +>b : any +>c : any +>d : any +>[[undefined], undefined, [[undefined, undefined]]] : [[undefined], undefined, [[undefined, undefined]]] +>[undefined] : [undefined] +>undefined : undefined +>undefined : undefined +>[[undefined, undefined]] : [[undefined, undefined]] +>[undefined, undefined] : [undefined, undefined] +>undefined : undefined +>undefined : undefined + +b1([1, 2, 3]); // z is widen to the type any[] +>b1([1, 2, 3]) : void +>b1 : (z?: any[]) => void +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +b2("string", { x: 200, y: "string" }); +>b2("string", { x: 200, y: "string" }) : void +>b2 : (z?: any, o?: { x: number; y: any; }) => void +>"string" : string +>{ x: 200, y: "string" } : { x: number; y: string; } +>x : number +>200 : number +>y : string +>"string" : string + +b2("string", { x: 200, y: true }); +>b2("string", { x: 200, y: true }) : void +>b2 : (z?: any, o?: { x: number; y: any; }) => void +>"string" : string +>{ x: 200, y: true } : { x: number; y: boolean; } +>x : number +>200 : number +>y : boolean +>true : boolean + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +>Foo : Foo +>a : Foo + +function c0({z: {x, y: {j}}}) { } +>c0 : ({z: {x, y: {j}}}: { z: { x: any; y: { j: any; }; }; }) => void +>z : any +>x : any +>y : any +>j : any + +function c1({z} = { z: 10 }) { } +>c1 : ({z}?: { z: number; }) => void +>z : number +>{ z: 10 } : { z: number; } +>z : number +>10 : number + +function c2({z = 10}) { } +>c2 : ({z = 10}: { z?: number; }) => void +>z : number +>10 : number + +function c3({b}: { b: number|string} = { b: "hello" }) { } +>c3 : ({b}?: { b: string | number; }) => void +>b : string | number +>b : string | number +>{ b: "hello" } : { b: string; } +>b : string +>"hello" : string + +function c5([a, b, [[c]]]) { } +>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>a : any +>b : any +>c : any + +function c6([a, b, [[c=1]]]) { } +>c6 : ([a, b, [[c=1]]]: [any, any, [[number]]]) => void +>a : any +>b : any +>c : number +>1 : number + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0({z : { x: 1, y: { j: "world" } }}) : void +>c0 : ({z: {x, y: {j}}}: { z: { x: any; y: { j: any; }; }; }) => void +>{z : { x: 1, y: { j: "world" } }} : { z: { x: number; y: { j: string; }; }; } +>z : { x: number; y: { j: string; }; } +>{ x: 1, y: { j: "world" } } : { x: number; y: { j: string; }; } +>x : number +>1 : number +>y : { j: string; } +>{ j: "world" } : { j: string; } +>j : string +>"world" : string + +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0({z : { x: "string", y: { j: true } }}) : void +>c0 : ({z: {x, y: {j}}}: { z: { x: any; y: { j: any; }; }; }) => void +>{z : { x: "string", y: { j: true } }} : { z: { x: string; y: { j: boolean; }; }; } +>z : { x: string; y: { j: boolean; }; } +>{ x: "string", y: { j: true } } : { x: string; y: { j: boolean; }; } +>x : string +>"string" : string +>y : { j: boolean; } +>{ j: true } : { j: boolean; } +>j : boolean +>true : boolean + +c1(); // Implied type is {z:number}? +>c1() : void +>c1 : ({z}?: { z: number; }) => void + +c1({ z: 1 }) // Implied type is {z:number}? +>c1({ z: 1 }) : void +>c1 : ({z}?: { z: number; }) => void +>{ z: 1 } : { z: number; } +>z : number +>1 : number + +c2({}); // Implied type is {z?: number} +>c2({}) : void +>c2 : ({z = 10}: { z?: number; }) => void +>{} : {} + +c2({z:1}); // Implied type is {z?: number} +>c2({z:1}) : void +>c2 : ({z = 10}: { z?: number; }) => void +>{z:1} : { z: number; } +>z : number +>1 : number + +c3({ b: 1 }); // Implied type is { b: number|string }. +>c3({ b: 1 }) : void +>c3 : ({b}?: { b: string | number; }) => void +>{ b: 1 } : { b: number; } +>b : number +>1 : number + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +>c5([1, 2, [["string"]]]) : void +>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]]] : [number, number, [[string]]] +>1 : number +>2 : number +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : string + +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +>c5([1, 2, [["string"]], false, true]) : void +>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] +>1 : number +>2 : number +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : string +>false : boolean +>true : boolean + + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +interface F2 { +>F2 : F2 + + d3([a, b, c]?); +>d3 : ([a, b, c]?: [any, any, any]) => any +>a : any +>b : any +>c : any + + d4({x, y, z}?); +>d4 : ({x, y, z}?: { x: any; y: any; z: any; }) => any +>x : any +>y : any +>z : any + + e0([a, b, c]); +>e0 : ([a, b, c]: [any, any, any]) => any +>a : any +>b : any +>c : any +} + +class C2 implements F2 { +>C2 : C2 +>F2 : F2 + + constructor() { } + d3() { } +>d3 : () => void + + d4() { } +>d4 : () => void + + e0([a, b, c]) { } +>e0 : ([a, b, c]: [any, any, any]) => void +>a : any +>b : any +>c : any +} + +class C3 implements F2 { +>C3 : C3 +>F2 : F2 + + d3([a, b, c]) { } +>d3 : ([a, b, c]: [any, any, any]) => void +>a : any +>b : any +>c : any + + d4({x, y, z}) { } +>d4 : ({x, y, z}: { x: any; y: any; z: any; }) => void +>x : any +>y : any +>z : any + + e0([a, b, c]) { } +>e0 : ([a, b, c]: [any, any, any]) => void +>a : any +>b : any +>c : any +} + +function d5({x, y} = { x: 1, y: 2 }) { } +>d5 : ({x, y}?: { x: number; y: number; }) => void +>x : number +>y : number +>{ x: 1, y: 2 } : { x: number; y: number; } +>x : number +>1 : number +>y : number +>2 : number + +d5(); // Parameter is optional as its declaration included an initializer +>d5() : void +>d5 : ({x, y}?: { x: number; y: number; }) => void + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +>e1 : ({x: number}: { x: any; }) => void +>x : any +>number : any + +function e2({x}: { x: number }) { } // x is type number +>e2 : ({x}: { x: number; }) => void +>x : number +>x : number + +function e3({x}: { x?: number }) { } // x is an optional with type number +>e3 : ({x}: { x?: number; }) => void +>x : number +>x : number + +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +>e4 : ({x: [number,string,any] }: { x: [any, any, any]; }) => void +>x : any +>number : any +>string : any +>any : any + +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] +>e5 : ({x: [a, b, c]}: { x: [number, number, number]; }) => void +>x : any +>a : number +>b : number +>c : number +>x : [number, number, number] + +function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier; +>e6 : ({x: [number, number, number]}: { x: [any, any, any]; }) => void +>x : any +>number : any +>number : any +>number : any + + + diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt new file mode 100644 index 00000000000..11af7b0d17c --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -0,0 +1,194 @@ +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(7,4): error TS2345: Argument of type '[number, string, string[][]]' is not assignable to parameter of type '[number, number, string[][]]'. + Types of property '1' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(7,29): error TS1005: ',' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(8,4): error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. + Types of property 'pop' are incompatible. + Type '() => string | number | string[][]' is not assignable to type '() => number | string[][]'. + Type 'string | number | 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[][]'. +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; }'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(30,14): error TS2300: Duplicate identifier 'z'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(30,18): error TS2300: Duplicate identifier 'z'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(34,4): error TS2345: Argument of type '{ z: number; }' is not assignable to parameter of type '{ z: { x: any; y: { j: any; }; }; }'. + Types of property 'z' are incompatible. + Type 'number' is not assignable to type '{ x: any; y: { j: any; }; }'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(35,4): error TS2345: Argument of type '{}' is not assignable to parameter of type '{ z: number; }'. + Property 'z' is missing in type '{}'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(36,4): error TS2345: Argument of type '{ z: boolean; }' is not assignable to parameter of type '{ z: number; }'. + Types of property 'z' are incompatible. + Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(37,4): error TS2345: Argument of type '{ z: boolean; }' is not assignable to parameter of type '{ z?: number; }'. + Types of property 'z' are incompatible. + Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(38,4): error TS2345: Argument of type '{ b: boolean; }' is not assignable to parameter of type '{ b: string | number; }'. + Types of property 'b' are incompatible. + Type 'boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'number'. +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]]'. + Types of property '0' are incompatible. + Type '[string]' is not assignable to type '[number]'. + Types of property '0' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(46,13): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(47,13): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(55,7): error TS2420: Class 'C4' incorrectly implements interface 'F2'. + Types of property 'd4' are incompatible. + Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'. + Types of parameters '__0' and '__0' are incompatible. + Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'. + Property 'z' is missing in type '{ x: any; y: any; c: any; }'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(56,8): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. + + +==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts (19 errors) ==== + // A parameter declaration may specify either an identifier or a binding pattern. + // The identifiers specified in parameter declarations and binding patterns + // in a parameter list must be unique within that parameter list. + + // If the declaration includes a type annotation, the parameter is of that type + function a0([a, b, [[c]]]: [number, number, string[][]]) { } + a0([1, "string", [["world"]]); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, string, string[][]]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Types of property '1' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS1005: ',' expected. + a0([1, 2, [["world"]], "string"]); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Types of property 'pop' are incompatible. +!!! error TS2345: Type '() => string | number | string[][]' is not assignable to type '() => number | string[][]'. +!!! error TS2345: Type 'string | number | 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[][]'. + + + // If the declaration includes an initializer expression (which is permitted only + // when the parameter list occurs in conjunction with a function body), + // the parameter type is the widened form (section 3.11) of the type of the initializer expression. + + interface F1 { + b0(z = 10, [[a, b], d, {u}] = [[1, 2], "string", { u: false }]); // Error, no function body + ~~~~~~ +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + } + + function b1(z = null, o = { x: 0, y: undefined }) { } + function b2([a, z, y] = [undefined, null, undefined]) { } + function b3([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + + b1("string", { x: "string", y: true }); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ x: string; y: boolean; }' is not assignable to parameter of type '{ x: number; y: any; }'. +!!! error TS2345: Types of property 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. + + // If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) + function c0({z: {x, y: {j}}}) { } + function c1({z} = { z: 10 }) { } + function c2({z = 10}) { } + function c3({b}: { b: number|string } = { b: "hello" }) { } + function c4([z], z: number) { } // Error Duplicate identifier + ~ +!!! error TS2300: Duplicate identifier 'z'. + ~ +!!! error TS2300: Duplicate identifier 'z'. + function c5([a, b, [[c]]]) { } + function c6([a, b, [[c = 1]]]) { } + + c0({ z: 1 }); // Error, implied type is { z: {x: any, y: {j: any}} } + ~~~~~~~~ +!!! error TS2345: Argument of type '{ z: number; }' is not assignable to parameter of type '{ z: { x: any; y: { j: any; }; }; }'. +!!! error TS2345: Types of property 'z' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type '{ x: any; y: { j: any; }; }'. + c1({}); // Error, implied type is {z:number}? + ~~ +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type '{ z: number; }'. +!!! error TS2345: Property 'z' is missing in type '{}'. + c1({ z: true }); // Error, implied type is {z:number}? + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ z: boolean; }' is not assignable to parameter of type '{ z: number; }'. +!!! error TS2345: Types of property 'z' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. + c2({ z: false }); // Error, implied type is {z?: number} + ~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ z: boolean; }' is not assignable to parameter of type '{ z?: number; }'. +!!! error TS2345: Types of property 'z' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. + c3({ b: true }); // Error, implied type is { b: number|string }. + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ b: boolean; }' is not assignable to parameter of type '{ b: string | number; }'. +!!! error TS2345: Types of property 'b' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. + c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]] + ~~~~~~~~~~~~~~~~~~~ +!!! 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]]]'. +!!! error TS2345: Types of property '2' are incompatible. +!!! error TS2345: Type '[[string]]' is not assignable to type '[[number]]'. +!!! error TS2345: Types of property '0' are incompatible. +!!! error TS2345: Type '[string]' is not assignable to type '[number]'. +!!! error TS2345: Types of property '0' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. + + // A parameter can be marked optional by following its name or binding pattern with a question mark (?) + // or by including an initializer. Initializers (including binding property or element initializers) are + // permitted only when the parameter list occurs in conjunction with a function body + + function d1([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature + ~~~~~~~~~~ +!!! error TS2463: A binding pattern parameter cannot be optional in an implementation signature. + function d2({x, y, z}?) { } // Error, binding pattern can't be optional in implementation signature + ~~~~~~~~~~ +!!! error TS2463: A binding pattern parameter cannot be optional in an implementation signature. + + interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); + } + + class C4 implements F2 { + ~~ +!!! error TS2420: Class 'C4' incorrectly implements interface 'F2'. +!!! error TS2420: Types of property 'd4' are incompatible. +!!! error TS2420: Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'. +!!! error TS2420: Types of parameters '__0' and '__0' are incompatible. +!!! error TS2420: Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'. +!!! error TS2420: Property 'z' is missing in type '{ x: any; y: any; c: any; }'. + d3([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature + ~~~~~~~~~~ +!!! error TS2463: A binding pattern parameter cannot be optional in an implementation signature. + d4({x, y, c}) { } + e0([a, b, q]) { } + } + + // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, + // as such annotations would conflict with the already established meaning of colons in object literals. + // Type annotations must instead be written on the top- level parameter declaration + + function e0({x: [number, number, number]}) { } // should be an error, duplicate identifier; + + + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.js b/tests/baselines/reference/destructuringParameterDeclaration2.js new file mode 100644 index 00000000000..8033ff7eeae --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration2.js @@ -0,0 +1,149 @@ +//// [destructuringParameterDeclaration2.ts] +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a0([a, b, [[c]]]: [number, number, string[][]]) { } +a0([1, "string", [["world"]]); // Error +a0([1, 2, [["world"]], "string"]); // Error + + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +interface F1 { + b0(z = 10, [[a, b], d, {u}] = [[1, 2], "string", { u: false }]); // Error, no function body +} + +function b1(z = null, o = { x: 0, y: undefined }) { } +function b2([a, z, y] = [undefined, null, undefined]) { } +function b3([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1("string", { x: "string", y: true }); // Error + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string } = { b: "hello" }) { } +function c4([z], z: number) { } // Error Duplicate identifier +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c = 1]]]) { } + +c0({ z: 1 }); // Error, implied type is { z: {x: any, y: {j: any}} } +c1({}); // Error, implied type is {z:number}? +c1({ z: true }); // Error, implied type is {z:number}? +c2({ z: false }); // Error, implied type is {z?: number} +c3({ b: true }); // Error, implied type is { b: number|string }. +c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]] +c6([1, 2, [["string"]]]); // Error, implied type is [any, any, [[number]]] // Use initializer + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. Initializers (including binding property or element initializers) are +// permitted only when the parameter list occurs in conjunction with a function body + +function d1([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature +function d2({x, y, z}?) { } // Error, binding pattern can't be optional in implementation signature + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C4 implements F2 { + d3([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature + d4({x, y, c}) { } + e0([a, b, q]) { } +} + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e0({x: [number, number, number]}) { } // should be an error, duplicate identifier; + + + + +//// [destructuringParameterDeclaration2.js] +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. +// If the declaration includes a type annotation, the parameter is of that type +function a0(_a) { + var a = _a[0], b = _a[1], c = _a[2][0][0]; +} +a0([1, "string", [["world"]]]); // Error +a0([1, 2, [["world"]], "string"]); // Error +function b1(z, o) { + if (z === void 0) { z = null; } + if (o === void 0) { o = { x: 0, y: undefined }; } +} +function b2(_a) { + var _b = _a === void 0 ? [undefined, null, undefined] : _a, a = _b[0], z = _b[1], y = _b[2]; +} +function b3(_a) { + var _b = _a === void 0 ? [[undefined], undefined, [[undefined, undefined]]] : _a, a = _b[0][0], b = _b[1], _c = _b[2][0], c = _c[0], d = _c[1]; +} +b1("string", { x: "string", y: true }); // Error +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +function c0(_a) { + var _b = _a.z, x = _b.x, j = _b.y.j; +} +function c1(_a) { + var z = (_a === void 0 ? { z: 10 } : _a).z; +} +function c2(_a) { + var _b = _a.z, z = _b === void 0 ? 10 : _b; +} +function c3(_a) { + var b = (_a === void 0 ? { b: "hello" } : _a).b; +} +function c4(_a, z) { + var z = _a[0]; +} // Error Duplicate identifier +function c5(_a) { + var a = _a[0], b = _a[1], c = _a[2][0][0]; +} +function c6(_a) { + var a = _a[0], b = _a[1], _b = _a[2][0][0], c = _b === void 0 ? 1 : _b; +} +c0({ z: 1 }); // Error, implied type is { z: {x: any, y: {j: any}} } +c1({}); // Error, implied type is {z:number}? +c1({ z: true }); // Error, implied type is {z:number}? +c2({ z: false }); // Error, implied type is {z?: number} +c3({ b: true }); // Error, implied type is { b: number|string }. +c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]] +c6([1, 2, [["string"]]]); // Error, implied type is [any, any, [[number]]] // Use initializer +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. Initializers (including binding property or element initializers) are +// permitted only when the parameter list occurs in conjunction with a function body +function d1(_a) { + var a = _a[0], b = _a[1], c = _a[2]; +} // Error, binding pattern can't be optional in implementation signature +function d2(_a) { + var x = _a.x, y = _a.y, z = _a.z; +} // Error, binding pattern can't be optional in implementation signature +var C4 = (function () { + function C4() { + } + C4.prototype.d3 = function (_a) { + var a = _a[0], b = _a[1], c = _a[2]; + }; // Error, binding pattern can't be optional in implementation signature + C4.prototype.d4 = function (_a) { + var x = _a.x, y = _a.y, c = _a.c; + }; + C4.prototype.e0 = function (_a) { + var a = _a[0], b = _a[1], q = _a[2]; + }; + return C4; +})(); +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration +function e0(_a) { + var _b = _a.x, number = _b[0], number = _b[1], number = _b[2]; +} // should be an error, duplicate identifier; diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.js b/tests/baselines/reference/destructuringParameterDeclaration3ES5.js new file mode 100644 index 00000000000..5dea671ee1a --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.js @@ -0,0 +1,80 @@ +//// [destructuringParameterDeclaration3ES5.ts] + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a1(...x: (number|string)[]) { } +function a2(...a) { } +function a3(...a: Array) { } +function a4(...a: arrayString) { } +function a5(...a: stringOrNumArray) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]: number[]) { } + + +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] + +// Rest parameter with generic +function foo(...a: T[]) { } +foo("hello", 1, 2); +foo("hello", "world"); + +enum E { a, b } +const enum E1 { a, b } +function foo1(...a: T[]) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, E1.a, E.b); + + + + +//// [destructuringParameterDeclaration3ES5.js] +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. +function a1(...x) { } +function a2(...a) { } +function a3(...a) { } +function a4(...a) { } +function a5(...a) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]) { } +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] +// Rest parameter with generic +function foo(...a) { } +foo("hello", 1, 2); +foo("hello", "world"); +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +function foo1(...a) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, 0 /* a */, E.b); diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols b/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols new file mode 100644 index 00000000000..033ad46ece1 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols @@ -0,0 +1,145 @@ +=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5.ts === + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +type someArray = Array | number[]; +>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES5.ts, 7, 32)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +type stringOrNumArray = Array; +>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5.ts, 8, 42)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function a1(...x: (number|string)[]) { } +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5.ts, 9, 45)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES5.ts, 11, 12)) + +function a2(...a) { } +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES5.ts, 11, 40)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 12, 12)) + +function a3(...a: Array) { } +>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES5.ts, 12, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 13, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +function a4(...a: arrayString) { } +>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES5.ts, 13, 36)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 14, 12)) +>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5.ts, 0, 0)) + +function a5(...a: stringOrNumArray) { } +>a5 : Symbol(a5, Decl(destructuringParameterDeclaration3ES5.ts, 14, 34)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 15, 12)) +>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5.ts, 8, 42)) + +function a9([a, b, [[c]]]) { } +>a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES5.ts, 15, 39)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 16, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES5.ts, 16, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES5.ts, 16, 21)) + +function a10([a, b, [[c]], ...x]) { } +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5.ts, 16, 30)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 17, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES5.ts, 17, 16)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES5.ts, 17, 22)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES5.ts, 17, 26)) + +function a11([a, b, c, ...x]: number[]) { } +>a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES5.ts, 17, 37)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 18, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES5.ts, 18, 16)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES5.ts, 18, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES5.ts, 18, 22)) + + +var array = [1, 2, 3]; +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES5.ts, 21, 3)) + +var array2 = [true, false, "hello"]; +>array2 : Symbol(array2, Decl(destructuringParameterDeclaration3ES5.ts, 22, 3)) + +a2([...array]); +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES5.ts, 11, 40)) +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES5.ts, 21, 3)) + +a1(...array); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5.ts, 9, 45)) +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES5.ts, 21, 3)) + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +>a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES5.ts, 15, 39)) + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5.ts, 16, 30)) + +a10([1, 2, 3, false, true]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5.ts, 16, 30)) + +a10([1, 2]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5.ts, 16, 30)) + +a11([1, 2]); // Parameter type is number[] +>a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES5.ts, 17, 37)) + +// Rest parameter with generic +function foo(...a: T[]) { } +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5.ts, 31, 12)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5.ts, 34, 13)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 34, 16)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5.ts, 34, 13)) + +foo("hello", 1, 2); +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5.ts, 31, 12)) + +foo("hello", "world"); +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5.ts, 31, 12)) + +enum E { a, b } +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES5.ts, 36, 22)) +>a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5.ts, 38, 8)) +>b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5.ts, 38, 11)) + +const enum E1 { a, b } +>E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES5.ts, 38, 15)) +>a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5.ts, 39, 15)) +>b : Symbol(E1.b, Decl(destructuringParameterDeclaration3ES5.ts, 39, 18)) + +function foo1(...a: T[]) { } +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5.ts, 39, 22)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5.ts, 40, 14)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 40, 32)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5.ts, 40, 14)) + +foo1(1, 2, 3, E.a); +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5.ts, 39, 22)) +>E.a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5.ts, 38, 8)) +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES5.ts, 36, 22)) +>a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5.ts, 38, 8)) + +foo1(1, 2, 3, E1.a, E.b); +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5.ts, 39, 22)) +>E1.a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5.ts, 39, 15)) +>E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES5.ts, 38, 15)) +>a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5.ts, 39, 15)) +>E.b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5.ts, 38, 11)) +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES5.ts, 36, 22)) +>b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5.ts, 38, 11)) + + + diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types new file mode 100644 index 00000000000..64bede3e2de --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types @@ -0,0 +1,206 @@ +=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5.ts === + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +>arrayString : String[] +>Array : T[] +>String : String + +type someArray = Array | number[]; +>someArray : number[] | String[] +>Array : T[] +>String : String + +type stringOrNumArray = Array; +>stringOrNumArray : (String | Number)[] +>Array : T[] +>String : String +>Number : Number + +function a1(...x: (number|string)[]) { } +>a1 : (...x: (string | number)[]) => void +>x : (string | number)[] + +function a2(...a) { } +>a2 : (...a: any[]) => void +>a : any[] + +function a3(...a: Array) { } +>a3 : (...a: String[]) => void +>a : String[] +>Array : T[] +>String : String + +function a4(...a: arrayString) { } +>a4 : (...a: String[]) => void +>a : String[] +>arrayString : String[] + +function a5(...a: stringOrNumArray) { } +>a5 : (...a: (String | Number)[]) => void +>a : (String | Number)[] +>stringOrNumArray : (String | Number)[] + +function a9([a, b, [[c]]]) { } +>a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>a : any +>b : any +>c : any + +function a10([a, b, [[c]], ...x]) { } +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>a : any +>b : any +>c : any +>x : any[] + +function a11([a, b, c, ...x]: number[]) { } +>a11 : ([a, b, c, ...x]: number[]) => void +>a : number +>b : number +>c : number +>x : number[] + + +var array = [1, 2, 3]; +>array : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var array2 = [true, false, "hello"]; +>array2 : (string | boolean)[] +>[true, false, "hello"] : (string | boolean)[] +>true : boolean +>false : boolean +>"hello" : string + +a2([...array]); +>a2([...array]) : void +>a2 : (...a: any[]) => void +>[...array] : number[] +>...array : number +>array : number[] + +a1(...array); +>a1(...array) : void +>a1 : (...x: (string | number)[]) => void +>...array : number +>array : number[] + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +>a9([1, 2, [["string"]], false, true]) : void +>a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] +>1 : number +>2 : number +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : string +>false : boolean +>true : boolean + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +>a10([1, 2, [["string"]], false, true]) : void +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>1 : number +>2 : number +>[["string"]] : string[][] +>["string"] : string[] +>"string" : string +>false : boolean +>true : boolean + +a10([1, 2, 3, false, true]); // Parameter type is any[] +>a10([1, 2, 3, false, true]) : void +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>[1, 2, 3, false, true] : (number | boolean)[] +>1 : number +>2 : number +>3 : number +>false : boolean +>true : boolean + +a10([1, 2]); // Parameter type is any[] +>a10([1, 2]) : void +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>[1, 2] : number[] +>1 : number +>2 : number + +a11([1, 2]); // Parameter type is number[] +>a11([1, 2]) : void +>a11 : ([a, b, c, ...x]: number[]) => void +>[1, 2] : number[] +>1 : number +>2 : number + +// Rest parameter with generic +function foo(...a: T[]) { } +>foo : (...a: T[]) => void +>T : T +>a : T[] +>T : T + +foo("hello", 1, 2); +>foo("hello", 1, 2) : void +>foo : (...a: T[]) => void +>"hello" : string +>1 : number +>2 : number + +foo("hello", "world"); +>foo("hello", "world") : void +>foo : (...a: T[]) => void +>"hello" : string +>"world" : string + +enum E { a, b } +>E : E +>a : E +>b : E + +const enum E1 { a, b } +>E1 : E1 +>a : E1 +>b : E1 + +function foo1(...a: T[]) { } +>foo1 : (...a: T[]) => void +>T : T +>Number : Number +>a : T[] +>T : T + +foo1(1, 2, 3, E.a); +>foo1(1, 2, 3, E.a) : void +>foo1 : (...a: T[]) => void +>1 : number +>2 : number +>3 : number +>E.a : E +>E : typeof E +>a : E + +foo1(1, 2, 3, E1.a, E.b); +>foo1(1, 2, 3, E1.a, E.b) : void +>foo1 : (...a: T[]) => void +>1 : number +>2 : number +>3 : number +>E1.a : E1 +>E1 : typeof E1 +>a : E1 +>E.b : E +>E : typeof E +>b : E + + + diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.js b/tests/baselines/reference/destructuringParameterDeclaration3ES6.js new file mode 100644 index 00000000000..5893168bf93 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.js @@ -0,0 +1,80 @@ +//// [destructuringParameterDeclaration3ES6.ts] + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a1(...x: (number|string)[]) { } +function a2(...a) { } +function a3(...a: Array) { } +function a4(...a: arrayString) { } +function a5(...a: stringOrNumArray) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]: number[]) { } + + +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] + +// Rest parameter with generic +function foo(...a: T[]) { } +foo("hello", 1, 2); +foo("hello", "world"); + +enum E { a, b } +const enum E1 { a, b } +function foo1(...a: T[]) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, E1.a, E.b); + + + + +//// [destructuringParameterDeclaration3ES6.js] +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. +function a1(...x) { } +function a2(...a) { } +function a3(...a) { } +function a4(...a) { } +function a5(...a) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]) { } +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] +// Rest parameter with generic +function foo(...a) { } +foo("hello", 1, 2); +foo("hello", "world"); +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +function foo1(...a) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, 0 /* a */, E.b); diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols b/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols new file mode 100644 index 00000000000..d23b624a023 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols @@ -0,0 +1,145 @@ +=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts === + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES6.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +type someArray = Array | number[]; +>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES6.ts, 7, 32)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +type stringOrNumArray = Array; +>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES6.ts, 8, 42)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function a1(...x: (number|string)[]) { } +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES6.ts, 9, 45)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES6.ts, 11, 12)) + +function a2(...a) { } +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES6.ts, 11, 40)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 12, 12)) + +function a3(...a: Array) { } +>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES6.ts, 12, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 13, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) + +function a4(...a: arrayString) { } +>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES6.ts, 13, 36)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 14, 12)) +>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES6.ts, 0, 0)) + +function a5(...a: stringOrNumArray) { } +>a5 : Symbol(a5, Decl(destructuringParameterDeclaration3ES6.ts, 14, 34)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 15, 12)) +>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES6.ts, 8, 42)) + +function a9([a, b, [[c]]]) { } +>a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES6.ts, 15, 39)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 16, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES6.ts, 16, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES6.ts, 16, 21)) + +function a10([a, b, [[c]], ...x]) { } +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES6.ts, 16, 30)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 17, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES6.ts, 17, 16)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES6.ts, 17, 22)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES6.ts, 17, 26)) + +function a11([a, b, c, ...x]: number[]) { } +>a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES6.ts, 17, 37)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 18, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES6.ts, 18, 16)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES6.ts, 18, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES6.ts, 18, 22)) + + +var array = [1, 2, 3]; +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES6.ts, 21, 3)) + +var array2 = [true, false, "hello"]; +>array2 : Symbol(array2, Decl(destructuringParameterDeclaration3ES6.ts, 22, 3)) + +a2([...array]); +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES6.ts, 11, 40)) +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES6.ts, 21, 3)) + +a1(...array); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES6.ts, 9, 45)) +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES6.ts, 21, 3)) + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +>a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES6.ts, 15, 39)) + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES6.ts, 16, 30)) + +a10([1, 2, 3, false, true]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES6.ts, 16, 30)) + +a10([1, 2]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES6.ts, 16, 30)) + +a11([1, 2]); // Parameter type is number[] +>a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES6.ts, 17, 37)) + +// Rest parameter with generic +function foo(...a: T[]) { } +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES6.ts, 31, 12)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES6.ts, 34, 13)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 34, 16)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES6.ts, 34, 13)) + +foo("hello", 1, 2); +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES6.ts, 31, 12)) + +foo("hello", "world"); +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES6.ts, 31, 12)) + +enum E { a, b } +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES6.ts, 36, 22)) +>a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES6.ts, 38, 8)) +>b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES6.ts, 38, 11)) + +const enum E1 { a, b } +>E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES6.ts, 38, 15)) +>a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES6.ts, 39, 15)) +>b : Symbol(E1.b, Decl(destructuringParameterDeclaration3ES6.ts, 39, 18)) + +function foo1(...a: T[]) { } +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES6.ts, 39, 22)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES6.ts, 40, 14)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 40, 32)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES6.ts, 40, 14)) + +foo1(1, 2, 3, E.a); +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES6.ts, 39, 22)) +>E.a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES6.ts, 38, 8)) +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES6.ts, 36, 22)) +>a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES6.ts, 38, 8)) + +foo1(1, 2, 3, E1.a, E.b); +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES6.ts, 39, 22)) +>E1.a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES6.ts, 39, 15)) +>E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES6.ts, 38, 15)) +>a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES6.ts, 39, 15)) +>E.b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES6.ts, 38, 11)) +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES6.ts, 36, 22)) +>b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES6.ts, 38, 11)) + + + diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types new file mode 100644 index 00000000000..aea7b2ae15a --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types @@ -0,0 +1,206 @@ +=== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts === + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +>arrayString : String[] +>Array : T[] +>String : String + +type someArray = Array | number[]; +>someArray : number[] | String[] +>Array : T[] +>String : String + +type stringOrNumArray = Array; +>stringOrNumArray : (String | Number)[] +>Array : T[] +>String : String +>Number : Number + +function a1(...x: (number|string)[]) { } +>a1 : (...x: (string | number)[]) => void +>x : (string | number)[] + +function a2(...a) { } +>a2 : (...a: any[]) => void +>a : any[] + +function a3(...a: Array) { } +>a3 : (...a: String[]) => void +>a : String[] +>Array : T[] +>String : String + +function a4(...a: arrayString) { } +>a4 : (...a: String[]) => void +>a : String[] +>arrayString : String[] + +function a5(...a: stringOrNumArray) { } +>a5 : (...a: (String | Number)[]) => void +>a : (String | Number)[] +>stringOrNumArray : (String | Number)[] + +function a9([a, b, [[c]]]) { } +>a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>a : any +>b : any +>c : any + +function a10([a, b, [[c]], ...x]) { } +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>a : any +>b : any +>c : any +>x : any[] + +function a11([a, b, c, ...x]: number[]) { } +>a11 : ([a, b, c, ...x]: number[]) => void +>a : number +>b : number +>c : number +>x : number[] + + +var array = [1, 2, 3]; +>array : number[] +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + +var array2 = [true, false, "hello"]; +>array2 : (string | boolean)[] +>[true, false, "hello"] : (string | boolean)[] +>true : boolean +>false : boolean +>"hello" : string + +a2([...array]); +>a2([...array]) : void +>a2 : (...a: any[]) => void +>[...array] : number[] +>...array : number +>array : number[] + +a1(...array); +>a1(...array) : void +>a1 : (...x: (string | number)[]) => void +>...array : number +>array : number[] + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +>a9([1, 2, [["string"]], false, true]) : void +>a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] +>1 : number +>2 : number +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : string +>false : boolean +>true : boolean + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +>a10([1, 2, [["string"]], false, true]) : void +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>1 : number +>2 : number +>[["string"]] : string[][] +>["string"] : string[] +>"string" : string +>false : boolean +>true : boolean + +a10([1, 2, 3, false, true]); // Parameter type is any[] +>a10([1, 2, 3, false, true]) : void +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>[1, 2, 3, false, true] : (number | boolean)[] +>1 : number +>2 : number +>3 : number +>false : boolean +>true : boolean + +a10([1, 2]); // Parameter type is any[] +>a10([1, 2]) : void +>a10 : ([a, b, [[c]], ...x]: Iterable) => void +>[1, 2] : number[] +>1 : number +>2 : number + +a11([1, 2]); // Parameter type is number[] +>a11([1, 2]) : void +>a11 : ([a, b, c, ...x]: number[]) => void +>[1, 2] : number[] +>1 : number +>2 : number + +// Rest parameter with generic +function foo(...a: T[]) { } +>foo : (...a: T[]) => void +>T : T +>a : T[] +>T : T + +foo("hello", 1, 2); +>foo("hello", 1, 2) : void +>foo : (...a: T[]) => void +>"hello" : string +>1 : number +>2 : number + +foo("hello", "world"); +>foo("hello", "world") : void +>foo : (...a: T[]) => void +>"hello" : string +>"world" : string + +enum E { a, b } +>E : E +>a : E +>b : E + +const enum E1 { a, b } +>E1 : E1 +>a : E1 +>b : E1 + +function foo1(...a: T[]) { } +>foo1 : (...a: T[]) => void +>T : T +>Number : Number +>a : T[] +>T : T + +foo1(1, 2, 3, E.a); +>foo1(1, 2, 3, E.a) : void +>foo1 : (...a: T[]) => void +>1 : number +>2 : number +>3 : number +>E.a : E +>E : typeof E +>a : E + +foo1(1, 2, 3, E1.a, E.b); +>foo1(1, 2, 3, E1.a, E.b) : void +>foo1 : (...a: T[]) => void +>1 : number +>2 : number +>3 : number +>E1.a : E1 +>E1 : typeof E1 +>a : E1 +>E.b : E +>E : typeof E +>b : E + + + diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt new file mode 100644 index 00000000000..707fb005a80 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -0,0 +1,84 @@ +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(11,13): error TS2370: A rest parameter must be of an array type. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(13,13): error TS2370: A rest parameter must be of an array type. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'. + Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(21,7): error TS2304: Cannot find name 'array2'. +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 '(string | number)[]' is not assignable to parameter of type 'number[]'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(29,24): error TS1005: ',' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(34,22): error TS2304: Cannot find name 'E1'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(34,28): error TS2304: Cannot find name 'E'. + + +==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts (10 errors) ==== + // If the parameter is a rest parameter, the parameter type is any[] + // A type annotation for a rest parameter must denote an array type. + + // RestParameter: + // ... Identifier TypeAnnotation(opt) + + type arrayString = Array + type someArray = Array | number[]; + type stringOrNumArray = Array; + + function a0(...x: [number, number, string]) { } // Error, rest parameter must be array type + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2370: A rest parameter must be of an array type. + function a1(...x: (number|string)[]) { } + function a2(...a: someArray) { } // Error, rest parameter must be array type + ~~~~~~~~~~~~~~~ +!!! error TS2370: A rest parameter must be of an array type. + function a3(...b?) { } // Error, can't be optional + function a4(...b = [1,2,3]) { } // Error, can't have initializer + function a5([a, b, [[c]]]) { } + function a6([a, b, c, ...x]: number[]) { } + + + a1(1, 2, "hello", true); // Error, parameter type is (number|string)[] + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. + a1(...array2); // Error parameter type is (number|string)[] + ~~~~~~ +!!! error TS2304: Cannot find name 'array2'. + a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 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]]]'. +!!! error TS2345: Property '2' is missing in type '[number, number]'. + a6([1, 2, "string"]); // Error, parameter type is number[] + ~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. + + + var temp = [1, 2, 3]; + class C { + constructor(public ...temp) { } // Error, rest parameter can't have accessibilityModifier + ~~~ +!!! error TS1005: ',' expected. + } + + // Rest parameter with generic + function foo1(...a: T[]) { } + foo1(1, 2, "string", E1.a, E.b); // Error + ~~ +!!! error TS2304: Cannot find name 'E1'. + ~ +!!! error TS2304: Cannot find name 'E'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.js b/tests/baselines/reference/destructuringParameterDeclaration4.js new file mode 100644 index 00000000000..adc5264e1ff --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration4.js @@ -0,0 +1,101 @@ +//// [destructuringParameterDeclaration4.ts] +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a0(...x: [number, number, string]) { } // Error, rest parameter must be array type +function a1(...x: (number|string)[]) { } +function a2(...a: someArray) { } // Error, rest parameter must be array type +function a3(...b?) { } // Error, can't be optional +function a4(...b = [1,2,3]) { } // Error, can't have initializer +function a5([a, b, [[c]]]) { } +function a6([a, b, c, ...x]: number[]) { } + + +a1(1, 2, "hello", true); // Error, parameter type is (number|string)[] +a1(...array2); // Error parameter type is (number|string)[] +a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] +a5([1, 2]); // Error, parameter type is [any, any, [[any]]] +a6([1, 2, "string"]); // Error, parameter type is number[] + + +var temp = [1, 2, 3]; +class C { + constructor(public ...temp) { } // Error, rest parameter can't have accessibilityModifier +} + +// Rest parameter with generic +function foo1(...a: T[]) { } +foo1(1, 2, "string", E1.a, E.b); // Error + + + + +//// [destructuringParameterDeclaration4.js] +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. +function a0() { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i - 0] = arguments[_i]; + } +} // Error, rest parameter must be array type +function a1() { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i - 0] = arguments[_i]; + } +} +function a2() { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i - 0] = arguments[_i]; + } +} // Error, rest parameter must be array type +function a3() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i - 0] = arguments[_i]; + } +} // Error, can't be optional +function a4() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i - 0] = arguments[_i]; + } +} // Error, can't have initializer +function a5(_a) { + var a = _a[0], b = _a[1], c = _a[2][0][0]; +} +function a6(_a) { + var a = _a[0], b = _a[1], c = _a[2], x = _a.slice(3); +} +a1(1, 2, "hello", true); // Error, parameter type is (number|string)[] +a1.apply(void 0, array2); // Error parameter type is (number|string)[] +a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] +a5([1, 2]); // Error, parameter type is [any, any, [[any]]] +a6([1, 2, "string"]); // Error, parameter type is number[] +var temp = [1, 2, 3]; +var C = (function () { + function C(public) { + var temp = []; + for (var _i = 1; _i < arguments.length; _i++) { + temp[_i - 1] = arguments[_i]; + } + } // Error, rest parameter can't have accessibilityModifier + return C; +})(); +// Rest parameter with generic +function foo1() { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i - 0] = arguments[_i]; + } +} +foo1(1, 2, "string", E1.a, E.b); // Error diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt new file mode 100644 index 00000000000..c60e2b75c37 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt @@ -0,0 +1,79 @@ +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'. +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; }'. + Types of property 'y' are incompatible. + Type 'number' is not assignable to type 'D'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(50,4): error TS2345: Argument of type '{ y: string; }' is not assignable to parameter of type '{ y: D; }'. + Types of property 'y' are incompatible. + Type 'string' is not assignable to type 'D'. + + +==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts (4 errors) ==== + // Parameter Declaration with generic + + interface F { } + class Class implements F { + constructor() { } + } + + class SubClass extends Class { + foo: boolean; + constructor() { super(); } + } + + class D implements F { + foo: boolean + constructor() { } + } + + class SubD extends D { + bar: number + constructor() { + super(); + } + } + + + function d0({x} = { x: new Class() }) { } + function d1({x}: { x: F }) { } + function d2({x}: { x: Class }) { } + function d3({y}: { y: D }) { } + function d4({y} = { y: new D() }) { } + + var obj = new Class(); + d0({ x: 1 }); + d0({ x: {} }); + d0({ x: "string" }); + + d1({ x: new Class() }); + d1({ x: {} }); + d1({ x: "string" }); + + d2({ x: new SubClass() }); + d2({ x: {} }); + + d3({ y: new SubD() }); + d3({ y: new SubClass() }); + // Error + d3({ y: new Class() }); + ~~~~~~~~~~~~~~~~~~ +!!! 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'. + d3({}); + ~~ +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type '{ y: D; }'. +!!! error TS2345: Property 'y' is missing in type '{}'. + d3({ y: 1 }); + ~~~~~~~~ +!!! error TS2345: Argument of type '{ y: number; }' is not assignable to parameter of type '{ y: D; }'. +!!! error TS2345: Types of property 'y' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'D'. + d3({ y: "world" }); + ~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ y: string; }' is not assignable to parameter of type '{ y: D; }'. +!!! error TS2345: Types of property 'y' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js new file mode 100644 index 00000000000..7540302599c --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -0,0 +1,115 @@ +//// [destructuringParameterDeclaration5.ts] +// Parameter Declaration with generic + +interface F { } +class Class implements F { + constructor() { } +} + +class SubClass extends Class { + foo: boolean; + constructor() { super(); } +} + +class D implements F { + foo: boolean + constructor() { } +} + +class SubD extends D { + bar: number + constructor() { + super(); + } +} + + +function d0({x} = { x: new Class() }) { } +function d1({x}: { x: F }) { } +function d2({x}: { x: Class }) { } +function d3({y}: { y: D }) { } +function d4({y} = { y: new D() }) { } + +var obj = new Class(); +d0({ x: 1 }); +d0({ x: {} }); +d0({ x: "string" }); + +d1({ x: new Class() }); +d1({ x: {} }); +d1({ x: "string" }); + +d2({ x: new SubClass() }); +d2({ x: {} }); + +d3({ y: new SubD() }); +d3({ y: new SubClass() }); +// Error +d3({ y: new Class() }); +d3({}); +d3({ y: 1 }); +d3({ y: "world" }); + +//// [destructuringParameterDeclaration5.js] +// Parameter Declaration with generic +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; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Class = (function () { + function Class() { + } + return Class; +})(); +var SubClass = (function (_super) { + __extends(SubClass, _super); + function SubClass() { + _super.call(this); + } + return SubClass; +})(Class); +var D = (function () { + function D() { + } + return D; +})(); +var SubD = (function (_super) { + __extends(SubD, _super); + function SubD() { + _super.call(this); + } + return SubD; +})(D); +function d0(_a) { + var x = (_a === void 0 ? { x: new Class() } : _a).x; +} +function d1(_a) { + var x = _a.x; +} +function d2(_a) { + var x = _a.x; +} +function d3(_a) { + var y = _a.y; +} +function d4(_a) { + var y = (_a === void 0 ? { y: new D() } : _a).y; +} +var obj = new Class(); +d0({ x: 1 }); +d0({ x: {} }); +d0({ x: "string" }); +d1({ x: new Class() }); +d1({ x: {} }); +d1({ x: "string" }); +d2({ x: new SubClass() }); +d2({ x: {} }); +d3({ y: new SubD() }); +d3({ y: new SubClass() }); +// Error +d3({ y: new Class() }); +d3({}); +d3({ y: 1 }); +d3({ y: "world" }); diff --git a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt new file mode 100644 index 00000000000..15d25ebc60e --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(7,18): error TS1005: ':' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,14): error TS1181: Array element destructuring pattern expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error TS1005: '(' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,21): error TS1109: Expression expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,24): error TS1005: '(' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,26): error TS2304: Cannot find name 'public'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,32): error TS1005: ';' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,33): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(10,16): error TS1003: Identifier expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(10,21): error TS1005: '(' expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(12,13): error TS2370: A rest parameter must be of an array type. + + +==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (11 errors) ==== + // A parameter declaration may specify either an identifier or a binding pattern. + + // Reserved words are not allowed to be used as an identifier in parameter declaration + "use strict" + + // Error + function a({while}) { } + ~ +!!! error TS1005: ':' expected. + function a1({public}) { } + function a4([while, for, public]){ } + ~~~~~ +!!! error TS1181: Array element destructuring pattern expected. + ~ +!!! error TS1005: '(' expected. + ~~~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: '(' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + function a5(...while) { } + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: '(' expected. + function a6(...public) { } + function a7(...a: string) { } + ~~~~~~~~~~~~ +!!! error TS2370: A rest parameter must be of an array type. + a({ while: 1 }); + + // No Error + function b1({public: x}) { } + function b2({while: y}) { } + b1({ public: 1 }); + b2({ while: 1 }); + + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration6.js b/tests/baselines/reference/destructuringParameterDeclaration6.js new file mode 100644 index 00000000000..f34f2d695ce --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration6.js @@ -0,0 +1,61 @@ +//// [destructuringParameterDeclaration6.ts] +// A parameter declaration may specify either an identifier or a binding pattern. + +// Reserved words are not allowed to be used as an identifier in parameter declaration +"use strict" + +// Error +function a({while}) { } +function a1({public}) { } +function a4([while, for, public]){ } +function a5(...while) { } +function a6(...public) { } +function a7(...a: string) { } +a({ while: 1 }); + +// No Error +function b1({public: x}) { } +function b2({while: y}) { } +b1({ public: 1 }); +b2({ while: 1 }); + + + +//// [destructuringParameterDeclaration6.js] +// A parameter declaration may specify either an identifier or a binding pattern. +// Reserved words are not allowed to be used as an identifier in parameter declaration +"use strict"; +// Error +function a(_a) { + var = _a.while; +} +function a1(_a) { + var public = _a.public; +} +while (, ) + for (, public; ; ) + ; +{ } +while () { } +function a6() { + var public = []; + for (var _i = 0; _i < arguments.length; _i++) { + public[_i - 0] = arguments[_i]; + } +} +function a7() { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i - 0] = arguments[_i]; + } +} +a({ while: 1 }); +// No Error +function b1(_a) { + var x = _a.public; +} +function b2(_a) { + var y = _a.while; +} +b1({ public: 1 }); +b2({ while: 1 }); diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.js b/tests/baselines/reference/destructuringVariableDeclaration1ES5.js new file mode 100644 index 00000000000..6d731538d18 --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.js @@ -0,0 +1,77 @@ +//// [destructuringVariableDeclaration1ES5.ts] +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +var temp = { t1: true, t2: "false" }; +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +var [...c2] = [1,2,3, "string"]; + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +var [d3, d4] = [1, "string", ...temp1]; + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; + + + +//// [destructuringVariableDeclaration1ES5.js] +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var _a = { a1: 10, a2: "world" }, a1 = _a.a1, a2 = _a.a2; +var _b = [1, [["hello"]], true], a3 = _b[0], a4 = _b[1][0][0], a5 = _b[2]; +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var _c = { b1: { b11: "world" } }.b1, b11 = (_c === void 0 ? { b11: "string" } : _c).b11; +var temp = { t1: true, t2: "false" }; +var _d = [3, false, { t1: false, t2: "hello" }], _e = _d[0], b2 = _e === void 0 ? 3 : _e, _f = _d[1], b3 = _f === void 0 ? true : _f, _g = _d[2], b4 = _g === void 0 ? temp : _g; +var _h = [undefined, undefined, undefined], _j = _h[0], b5 = _j === void 0 ? 3 : _j, _k = _h[1], b6 = _k === void 0 ? true : _k, _l = _h[2], b7 = _l === void 0 ? temp : _l; +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var c1 = [1, 2, 3].slice(0); +var c2 = [1, 2, 3, "string"].slice(0); +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var _m = [1, "string"], d1 = _m[0], d2 = _m[1]; +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true]; +var _o = [1, "string"].concat(temp1), d3 = _o[0], d4 = _o[1]; +// Combining both forms of destructuring, +var _p = { e: [1, 2, { b1: 4, b4: 0 }] }.e, e1 = _p[0], e2 = _p[1], _q = _p[2], e3 = _q === void 0 ? { b1: 1000, b4: 200 } : _q; +var _r = { f: [1, 2, { f3: 4, f5: 0 }] }.f, f1 = _r[0], f2 = _r[1], _s = _r[2], f4 = _s.f3, f5 = _s.f5; +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var _t = { g: { g1: [1, 2] } }.g.g1, g1 = _t === void 0 ? [undefined, null] : _t; +var _u = { h: { h1: [1, 2] } }.h.h1, h1 = _u === void 0 ? [undefined, null] : _u; diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.symbols b/tests/baselines/reference/destructuringVariableDeclaration1ES5.symbols new file mode 100644 index 00000000000..2a2f2a358ca --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts === +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5.ts, 2, 5)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5.ts, 2, 8)) +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5.ts, 2, 15)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5.ts, 2, 27)) +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5.ts, 2, 44)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5.ts, 2, 52)) + +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; +>a3 : Symbol(a3, Decl(destructuringVariableDeclaration1ES5.ts, 3, 5)) +>a4 : Symbol(a4, Decl(destructuringVariableDeclaration1ES5.ts, 3, 11)) +>a5 : Symbol(a5, Decl(destructuringVariableDeclaration1ES5.ts, 3, 16)) + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5.ts, 7, 11)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5.ts, 7, 21)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5.ts, 7, 44)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5.ts, 7, 50)) + +var temp = { t1: true, t2: "false" }; +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5.ts, 8, 3)) +>t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES5.ts, 8, 12)) +>t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES5.ts, 8, 22)) + +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +>b2 : Symbol(b2, Decl(destructuringVariableDeclaration1ES5.ts, 9, 5)) +>b3 : Symbol(b3, Decl(destructuringVariableDeclaration1ES5.ts, 9, 12)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5.ts, 9, 23)) +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5.ts, 8, 3)) +>t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES5.ts, 9, 49)) +>t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES5.ts, 9, 60)) + +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +>b5 : Symbol(b5, Decl(destructuringVariableDeclaration1ES5.ts, 10, 5)) +>b6 : Symbol(b6, Decl(destructuringVariableDeclaration1ES5.ts, 10, 12)) +>b7 : Symbol(b7, Decl(destructuringVariableDeclaration1ES5.ts, 10, 23)) +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5.ts, 8, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +>c1 : Symbol(c1, Decl(destructuringVariableDeclaration1ES5.ts, 15, 5)) + +var [...c2] = [1,2,3, "string"]; +>c2 : Symbol(c2, Decl(destructuringVariableDeclaration1ES5.ts, 16, 5)) + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] +>d1 : Symbol(d1, Decl(destructuringVariableDeclaration1ES5.ts, 22, 5)) +>d2 : Symbol(d2, Decl(destructuringVariableDeclaration1ES5.ts, 22, 8)) + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +>temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES5.ts, 27, 3)) + +var [d3, d4] = [1, "string", ...temp1]; +>d3 : Symbol(d3, Decl(destructuringVariableDeclaration1ES5.ts, 28, 5)) +>d4 : Symbol(d4, Decl(destructuringVariableDeclaration1ES5.ts, 28, 8)) +>temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES5.ts, 27, 3)) + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +>e1 : Symbol(e1, Decl(destructuringVariableDeclaration1ES5.ts, 31, 9)) +>e2 : Symbol(e2, Decl(destructuringVariableDeclaration1ES5.ts, 31, 12)) +>e3 : Symbol(e3, Decl(destructuringVariableDeclaration1ES5.ts, 31, 16)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5.ts, 31, 23)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5.ts, 31, 33)) +>e : Symbol(e, Decl(destructuringVariableDeclaration1ES5.ts, 31, 49)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5.ts, 31, 61)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5.ts, 31, 68)) + +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; +>f1 : Symbol(f1, Decl(destructuringVariableDeclaration1ES5.ts, 32, 9)) +>f2 : Symbol(f2, Decl(destructuringVariableDeclaration1ES5.ts, 32, 12)) +>f4 : Symbol(f4, Decl(destructuringVariableDeclaration1ES5.ts, 32, 18)) +>f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES5.ts, 32, 26)) +>f : Symbol(f, Decl(destructuringVariableDeclaration1ES5.ts, 32, 41)) +>f3 : Symbol(f3, Decl(destructuringVariableDeclaration1ES5.ts, 32, 53)) +>f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES5.ts, 32, 60)) + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5.ts, 37, 9)) +>undefined : Symbol(undefined) +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES5.ts, 37, 36)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5.ts, 37, 41)) +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES5.ts, 37, 59)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5.ts, 37, 64)) + +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5.ts, 38, 9)) +>undefined : Symbol(undefined) +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES5.ts, 38, 36)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5.ts, 38, 41)) +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES5.ts, 38, 62)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5.ts, 38, 67)) + + diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types new file mode 100644 index 00000000000..ef3507f0f8b --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -0,0 +1,200 @@ +=== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts === +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +>a1 : number +>a2 : string +>a1 : number +>a2 : string +>{ a1: 10, a2: "world" } : { a1: number; a2: string; } +>a1 : number +>10 : number +>a2 : string +>"world" : string + +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; +>a3 : number +>a4 : string +>a5 : boolean +>[1, [["hello"]], true] : [number, [[string]], boolean] +>1 : number +>[["hello"]] : [[string]] +>["hello"] : [string] +>"hello" : string +>true : boolean + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +>b1 : any +>b11 : string +>{ b11: "string" } : { b11: string; } +>b11 : string +>"string" : string +>{ b1: { b11: "world" } } : { b1: { b11: string; }; } +>b1 : { b11: string; } +>{ b11: "world" } : { b11: string; } +>b11 : string +>"world" : string + +var temp = { t1: true, t2: "false" }; +>temp : { t1: boolean; t2: string; } +>{ t1: true, t2: "false" } : { t1: boolean; t2: string; } +>t1 : boolean +>true : boolean +>t2 : string +>"false" : string + +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +>b2 : number +>3 : number +>b3 : boolean +>true : boolean +>b4 : { t1: boolean; t2: string; } +>temp : { t1: boolean; t2: string; } +>[3, false, { t1: false, t2: "hello" }] : [number, boolean, { t1: boolean; t2: string; }] +>3 : number +>false : boolean +>{ t1: false, t2: "hello" } : { t1: boolean; t2: string; } +>t1 : boolean +>false : boolean +>t2 : string +>"hello" : string + +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +>b5 : any +>3 : number +>b6 : any +>true : boolean +>b7 : any +>temp : { t1: boolean; t2: string; } +>[undefined, undefined, undefined] : [undefined, undefined, undefined] +>undefined : undefined +>undefined : undefined +>undefined : undefined + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +>c1 : number[] +>[1,2,3] : number[] +>1 : number +>2 : number +>3 : number + +var [...c2] = [1,2,3, "string"]; +>c2 : (string | number)[] +>[1,2,3, "string"] : (string | number)[] +>1 : number +>2 : number +>3 : number +>"string" : string + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] +>d1 : number +>d2 : string +>[1,"string"] : [number, string] +>1 : number +>"string" : string + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +>temp1 : boolean[] +>[true, false, true] : boolean[] +>true : boolean +>false : boolean +>true : boolean + +var [d3, d4] = [1, "string", ...temp1]; +>d3 : string | number | boolean +>d4 : string | number | boolean +>[1, "string", ...temp1] : (string | number | boolean)[] +>1 : number +>"string" : string +>...temp1 : boolean +>temp1 : boolean[] + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +>e : any +>e1 : number +>e2 : number +>e3 : { b1: number; b4: number; } +>{ b1: 1000, b4: 200 } : { b1: number; b4: number; } +>b1 : number +>1000 : number +>b4 : number +>200 : number +>{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } +>e : [number, number, { b1: number; b4: number; }] +>[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] +>1 : number +>2 : number +>{ b1: 4, b4: 0 } : { b1: number; b4: number; } +>b1 : number +>4 : number +>b4 : number +>0 : number + +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; +>f : any +>f1 : number +>f2 : number +>f3 : any +>f4 : number +>f5 : number +> : undefined +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] +>1 : number +>2 : number +>{ f3: 4, f5: 0 } : { f3: number; f5: number; } +>f3 : number +>4 : number +>f5 : number +>0 : number + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +>g : any +>g1 : any[] +>[undefined, null] : null[] +>undefined : undefined +>null : null +>g : { g1: any[]; } +>g1 : any[] +>{ g: { g1: [1, 2] } } : { g: { g1: number[]; }; } +>g : { g1: number[]; } +>{ g1: [1, 2] } : { g1: number[]; } +>g1 : number[] +>[1, 2] : number[] +>1 : number +>2 : number + +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; +>h : any +>h1 : number[] +>[undefined, null] : null[] +>undefined : undefined +>null : null +>h : { h1: number[]; } +>h1 : number[] +>{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } +>h : { h1: number[]; } +>{ h1: [1, 2] } : { h1: number[]; } +>h1 : number[] +>[1, 2] : number[] +>1 : number +>2 : number + + diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.js b/tests/baselines/reference/destructuringVariableDeclaration1ES6.js new file mode 100644 index 00000000000..53b888471a1 --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.js @@ -0,0 +1,77 @@ +//// [destructuringVariableDeclaration1ES6.ts] +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +var temp = { t1: true, t2: "false" }; +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +var [...c2] = [1,2,3, "string"]; + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +var [d3, d4] = [1, "string", ...temp1]; + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; + + + +//// [destructuringVariableDeclaration1ES6.js] +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var { a1, a2 } = { a1: 10, a2: "world" }; +var [a3, [[a4]], a5] = [1, [["hello"]], true]; +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +var temp = { t1: true, t2: "false" }; +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1, 2, 3]; +var [...c2] = [1, 2, 3, "string"]; +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1, d2] = [1, "string"]; +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true]; +var [d3, d4] = [1, "string", ...temp1]; +// Combining both forms of destructuring, +var { e: [e1, e2, e3 = { b1: 1000, b4: 200 }] } = { e: [1, 2, { b1: 4, b4: 0 }] }; +var { f: [f1, f2, { f3: f4, f5 }, ,] } = { f: [1, 2, { f3: 4, f5: 0 }] }; +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var { g: { g1 = [undefined, null] } } = { g: { g1: [1, 2] } }; +var { h: { h1 = [undefined, null] } } = { h: { h1: [1, 2] } }; diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.symbols b/tests/baselines/reference/destructuringVariableDeclaration1ES6.symbols new file mode 100644 index 00000000000..0350ff35251 --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts === +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES6.ts, 2, 5)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES6.ts, 2, 8)) +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES6.ts, 2, 15)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES6.ts, 2, 27)) +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES6.ts, 2, 44)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES6.ts, 2, 52)) + +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; +>a3 : Symbol(a3, Decl(destructuringVariableDeclaration1ES6.ts, 3, 5)) +>a4 : Symbol(a4, Decl(destructuringVariableDeclaration1ES6.ts, 3, 11)) +>a5 : Symbol(a5, Decl(destructuringVariableDeclaration1ES6.ts, 3, 16)) + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES6.ts, 7, 11)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES6.ts, 7, 21)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES6.ts, 7, 44)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES6.ts, 7, 50)) + +var temp = { t1: true, t2: "false" }; +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES6.ts, 8, 3)) +>t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES6.ts, 8, 12)) +>t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES6.ts, 8, 22)) + +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +>b2 : Symbol(b2, Decl(destructuringVariableDeclaration1ES6.ts, 9, 5)) +>b3 : Symbol(b3, Decl(destructuringVariableDeclaration1ES6.ts, 9, 12)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES6.ts, 9, 23)) +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES6.ts, 8, 3)) +>t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES6.ts, 9, 49)) +>t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES6.ts, 9, 60)) + +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +>b5 : Symbol(b5, Decl(destructuringVariableDeclaration1ES6.ts, 10, 5)) +>b6 : Symbol(b6, Decl(destructuringVariableDeclaration1ES6.ts, 10, 12)) +>b7 : Symbol(b7, Decl(destructuringVariableDeclaration1ES6.ts, 10, 23)) +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES6.ts, 8, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +>c1 : Symbol(c1, Decl(destructuringVariableDeclaration1ES6.ts, 15, 5)) + +var [...c2] = [1,2,3, "string"]; +>c2 : Symbol(c2, Decl(destructuringVariableDeclaration1ES6.ts, 16, 5)) + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] +>d1 : Symbol(d1, Decl(destructuringVariableDeclaration1ES6.ts, 22, 5)) +>d2 : Symbol(d2, Decl(destructuringVariableDeclaration1ES6.ts, 22, 8)) + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +>temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES6.ts, 27, 3)) + +var [d3, d4] = [1, "string", ...temp1]; +>d3 : Symbol(d3, Decl(destructuringVariableDeclaration1ES6.ts, 28, 5)) +>d4 : Symbol(d4, Decl(destructuringVariableDeclaration1ES6.ts, 28, 8)) +>temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES6.ts, 27, 3)) + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +>e1 : Symbol(e1, Decl(destructuringVariableDeclaration1ES6.ts, 31, 9)) +>e2 : Symbol(e2, Decl(destructuringVariableDeclaration1ES6.ts, 31, 12)) +>e3 : Symbol(e3, Decl(destructuringVariableDeclaration1ES6.ts, 31, 16)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES6.ts, 31, 23)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES6.ts, 31, 33)) +>e : Symbol(e, Decl(destructuringVariableDeclaration1ES6.ts, 31, 49)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES6.ts, 31, 61)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES6.ts, 31, 68)) + +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; +>f1 : Symbol(f1, Decl(destructuringVariableDeclaration1ES6.ts, 32, 9)) +>f2 : Symbol(f2, Decl(destructuringVariableDeclaration1ES6.ts, 32, 12)) +>f4 : Symbol(f4, Decl(destructuringVariableDeclaration1ES6.ts, 32, 18)) +>f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES6.ts, 32, 26)) +>f : Symbol(f, Decl(destructuringVariableDeclaration1ES6.ts, 32, 41)) +>f3 : Symbol(f3, Decl(destructuringVariableDeclaration1ES6.ts, 32, 53)) +>f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES6.ts, 32, 60)) + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES6.ts, 37, 9)) +>undefined : Symbol(undefined) +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES6.ts, 37, 36)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES6.ts, 37, 41)) +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES6.ts, 37, 59)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES6.ts, 37, 64)) + +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES6.ts, 38, 9)) +>undefined : Symbol(undefined) +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES6.ts, 38, 36)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES6.ts, 38, 41)) +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES6.ts, 38, 62)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES6.ts, 38, 67)) + + diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types new file mode 100644 index 00000000000..d62574c28f0 --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -0,0 +1,200 @@ +=== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts === +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +>a1 : number +>a2 : string +>a1 : number +>a2 : string +>{ a1: 10, a2: "world" } : { a1: number; a2: string; } +>a1 : number +>10 : number +>a2 : string +>"world" : string + +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; +>a3 : number +>a4 : string +>a5 : boolean +>[1, [["hello"]], true] : [number, [[string]], boolean] +>1 : number +>[["hello"]] : [[string]] +>["hello"] : [string] +>"hello" : string +>true : boolean + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +>b1 : any +>b11 : string +>{ b11: "string" } : { b11: string; } +>b11 : string +>"string" : string +>{ b1: { b11: "world" } } : { b1: { b11: string; }; } +>b1 : { b11: string; } +>{ b11: "world" } : { b11: string; } +>b11 : string +>"world" : string + +var temp = { t1: true, t2: "false" }; +>temp : { t1: boolean; t2: string; } +>{ t1: true, t2: "false" } : { t1: boolean; t2: string; } +>t1 : boolean +>true : boolean +>t2 : string +>"false" : string + +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +>b2 : number +>3 : number +>b3 : boolean +>true : boolean +>b4 : { t1: boolean; t2: string; } +>temp : { t1: boolean; t2: string; } +>[3, false, { t1: false, t2: "hello" }] : [number, boolean, { t1: boolean; t2: string; }] +>3 : number +>false : boolean +>{ t1: false, t2: "hello" } : { t1: boolean; t2: string; } +>t1 : boolean +>false : boolean +>t2 : string +>"hello" : string + +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +>b5 : any +>3 : number +>b6 : any +>true : boolean +>b7 : any +>temp : { t1: boolean; t2: string; } +>[undefined, undefined, undefined] : [undefined, undefined, undefined] +>undefined : undefined +>undefined : undefined +>undefined : undefined + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +>c1 : number[] +>[1,2,3] : number[] +>1 : number +>2 : number +>3 : number + +var [...c2] = [1,2,3, "string"]; +>c2 : (string | number)[] +>[1,2,3, "string"] : (string | number)[] +>1 : number +>2 : number +>3 : number +>"string" : string + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] +>d1 : number +>d2 : string +>[1,"string"] : [number, string] +>1 : number +>"string" : string + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +>temp1 : boolean[] +>[true, false, true] : boolean[] +>true : boolean +>false : boolean +>true : boolean + +var [d3, d4] = [1, "string", ...temp1]; +>d3 : string | number | boolean +>d4 : string | number | boolean +>[1, "string", ...temp1] : (string | number | boolean)[] +>1 : number +>"string" : string +>...temp1 : boolean +>temp1 : boolean[] + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +>e : any +>e1 : number +>e2 : number +>e3 : { b1: number; b4: number; } +>{ b1: 1000, b4: 200 } : { b1: number; b4: number; } +>b1 : number +>1000 : number +>b4 : number +>200 : number +>{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } +>e : [number, number, { b1: number; b4: number; }] +>[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] +>1 : number +>2 : number +>{ b1: 4, b4: 0 } : { b1: number; b4: number; } +>b1 : number +>4 : number +>b4 : number +>0 : number + +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; +>f : any +>f1 : number +>f2 : number +>f3 : any +>f4 : number +>f5 : number +> : undefined +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] +>1 : number +>2 : number +>{ f3: 4, f5: 0 } : { f3: number; f5: number; } +>f3 : number +>4 : number +>f5 : number +>0 : number + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +>g : any +>g1 : any[] +>[undefined, null] : null[] +>undefined : undefined +>null : null +>g : { g1: any[]; } +>g1 : any[] +>{ g: { g1: [1, 2] } } : { g: { g1: number[]; }; } +>g : { g1: number[]; } +>{ g1: [1, 2] } : { g1: number[]; } +>g1 : number[] +>[1, 2] : number[] +>1 : number +>2 : number + +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; +>h : any +>h1 : number[] +>[undefined, null] : null[] +>undefined : undefined +>null : null +>h : { h1: number[]; } +>h1 : number[] +>{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } +>h : { h1: number[]; } +>{ h1: [1, 2] } : { h1: number[]; } +>h1 : number[] +>[1, 2] : number[] +>1 : number +>2 : number + + diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt new file mode 100644 index 00000000000..1a655837743 --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -0,0 +1,62 @@ +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,5): error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. + Types of property 'a1' are incompatible. + Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], boolean]' is not assignable to type '[number, [[string]], boolean]'. + Types of property '1' are incompatible. + Type '[[boolean]]' is not assignable to type '[[string]]'. + Types of property '0' are incompatible. + Type '[boolean]' is not assignable to type '[string]'. + Types of property '0' are incompatible. + Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(9,25): error TS2322: Type '{ t1: boolean; t2: string; }' is not assignable to type '{ t1: boolean; t2: number; }'. + Types of property 't2' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,16): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c3' and no string index signature. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,24): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c5' and no string index signature. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(19,10): error TS2322: Type 'string[]' is not assignable to type 'number[]'. + Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (6 errors) ==== + // The type T associated with a destructuring variable declaration is determined as follows: + // If the declaration includes a type annotation, T is that type. + var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error + ~~~~~~~~ +!!! error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. +!!! error TS2322: Types of property 'a1' are incompatible. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error + ~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '[number, [[boolean]], boolean]' is not assignable to type '[number, [[string]], boolean]'. +!!! error TS2322: Types of property '1' are incompatible. +!!! error TS2322: Type '[[boolean]]' is not assignable to type '[[string]]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type '[boolean]' is not assignable to type '[string]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. + + // The type T associated with a destructuring variable declaration is determined as follows: + // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. + var temp = { t1: true, t2: "false" }; + var [b0 = 3, b1 = true, b2 = temp] = [3, false, { t1: false, t2: 5}]; // Error + ~~ +!!! error TS2322: Type '{ t1: boolean; t2: string; }' is not assignable to type '{ t1: boolean; t2: number; }'. +!!! error TS2322: Types of property 't2' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + + // The type T associated with a binding element is determined as follows: + // If the binding element is a rest element, T is an array type with + // an element type E, where E is the type of the numeric index signature of S. + var [c1, c2, { c3: c4, c5 }, , ...c6] = [1, 2, { c3: 4, c5: 0 }]; // Error + ~~ +!!! error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c3' and no string index signature. + ~~ +!!! error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c5' and no string index signature. + + // When a destructuring variable declaration, binding property, or binding element specifies + // an initializer expression, the type of the initializer expression is required to be assignable + // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. + var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error + ~~ +!!! error TS2322: Type 'string[]' is not assignable to type 'number[]'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.js b/tests/baselines/reference/destructuringVariableDeclaration2.js new file mode 100644 index 00000000000..a4fadd850d7 --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration2.js @@ -0,0 +1,38 @@ +//// [destructuringVariableDeclaration2.ts] +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var temp = { t1: true, t2: "false" }; +var [b0 = 3, b1 = true, b2 = temp] = [3, false, { t1: false, t2: 5}]; // Error + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [c1, c2, { c3: c4, c5 }, , ...c6] = [1, 2, { c3: 4, c5: 0 }]; // Error + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error + +//// [destructuringVariableDeclaration2.js] +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var _a = { a1: true, a2: 1 }, a1 = _a.a1, a2 = _a.a2; // Error +var _b = [1, [[false]], true], a3 = _b[0], a4 = _b[1][0][0], a5 = _b[2]; // Error +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var temp = { t1: true, t2: "false" }; +var _c = [3, false, { t1: false, t2: 5 }], _d = _c[0], b0 = _d === void 0 ? 3 : _d, _e = _c[1], b1 = _e === void 0 ? true : _e, _f = _c[2], b2 = _f === void 0 ? temp : _f; // Error +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var _g = [1, 2, { c3: 4, c5: 0 }], c1 = _g[0], c2 = _g[1], _h = _g[2], c4 = _h.c3, c5 = _h.c5, c6 = _g.slice(4); // Error +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var _j = { d: { d1: [1, 2] } }.d.d1, d1 = _j === void 0 ? ["string", null] : _j; // Error diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt index b9890e925c4..68ea92f8fb5 100644 --- a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt @@ -1,15 +1,21 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(4,6): error TS2456: Type alias 'T0' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(5,6): error TS2456: Type alias 'T0_1' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(6,6): error TS2456: Type alias 'T0_2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(7,6): error TS2456: Type alias 'T0_3' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(11,6): error TS2456: Type alias 'T1' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(14,6): error TS2456: Type alias 'T2' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(16,6): error TS2456: Type alias 'T2_1' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(19,6): error TS2456: Type alias 'T3' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(22,6): error TS2456: Type alias 'T4' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(25,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(26,6): error TS2456: Type alias 'T5' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(29,6): error TS2456: Type alias 'T6' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(30,6): error TS2456: Type alias 'T7' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(31,5): error TS2502: 'yy' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(32,6): error TS2456: Type alias 'T8' circularly references itself. -==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (9 errors) ==== +==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (15 errors) ==== // It is an error for the type specified in a type alias to depend on that type alias // A type alias directly depends on the type it aliases. @@ -17,10 +23,14 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( ~~ !!! error TS2456: Type alias 'T0' circularly references itself. type T0_1 = T0_2 + ~~~~ +!!! error TS2456: Type alias 'T0_1' circularly references itself. type T0_2 = T0_3 ~~~~ !!! error TS2456: Type alias 'T0_2' circularly references itself. type T0_3 = T0_1 + ~~~~ +!!! error TS2456: Type alias 'T0_3' circularly references itself. // A type reference directly depends on the referenced type and each of the type arguments, if any. interface I {} @@ -49,17 +59,25 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( // A type query directly depends on the type of the referenced entity. var x: T5[] = [] + ~ +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. type T5 = typeof x ~~ !!! error TS2456: Type alias 'T5' circularly references itself. class C1 {} type T6 = T7 | number + ~~ +!!! error TS2456: Type alias 'T6' circularly references itself. type T7 = typeof yy ~~ !!! error TS2456: Type alias 'T7' circularly references itself. var yy: [string, T8[]]; + ~~ +!!! error TS2502: 'yy' is referenced directly or indirectly in its own type annotation. type T8 = C + ~~ +!!! error TS2456: Type alias 'T8' circularly references itself. // legal cases type T9 = () => T9 diff --git a/tests/baselines/reference/duplicateExportAssignments.errors.txt b/tests/baselines/reference/duplicateExportAssignments.errors.txt index c0a93076981..47a97f9d8af 100644 --- a/tests/baselines/reference/duplicateExportAssignments.errors.txt +++ b/tests/baselines/reference/duplicateExportAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(3,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2300: Duplicate identifier 'export='. tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2300: Duplicate identifier 'export='. tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2300: Duplicate identifier 'export='. @@ -17,7 +17,7 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate id var y = 20; export = x; ~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~~~~~ !!! error TS2300: Duplicate identifier 'export='. export = y; diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt index 768e6111b73..df4f8f13c31 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/duplicateSymbolsExportMatching.ts(43,16): error TS2395: Ind tests/cases/compiler/duplicateSymbolsExportMatching.ts(44,9): error TS2395: Individual declarations in merged declaration w must be all exported or all local. tests/cases/compiler/duplicateSymbolsExportMatching.ts(45,16): error TS2395: Individual declarations in merged declaration w must be all exported or all local. tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2395: Individual declarations in merged declaration F must be all exported or all local. -tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged tests/cases/compiler/duplicateSymbolsExportMatching.ts(52,21): error TS2395: Individual declarations in merged declaration F must be all exported or all local. tests/cases/compiler/duplicateSymbolsExportMatching.ts(56,11): error TS2395: Individual declarations in merged declaration C must be all exported or all local. tests/cases/compiler/duplicateSymbolsExportMatching.ts(57,12): error TS2395: Individual declarations in merged declaration C must be all exported or all local. @@ -91,7 +91,7 @@ tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Ind ~ !!! error TS2395: Individual declarations in merged declaration F must be all exported or all local. ~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged var t; } export function F() { } // Only one error for duplicate identifier (don't consider visibility) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols index 623cc4c9690..18e1063f1e6 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols @@ -5,7 +5,7 @@ function f() { if (Math.random()) { >Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1)) >random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) let arguments = 100; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols index d140c21284c..6885b359416 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols @@ -8,7 +8,7 @@ function f() { if (Math.random()) { >Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1)) >random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) const arguments = 100; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols index e970b527d56..ae6be6f7951 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols @@ -8,7 +8,7 @@ function f() { if (Math.random()) { >Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1)) >random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) return () => arguments[0]; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols index 8612e0896d1..c8bf211897a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols @@ -9,7 +9,7 @@ function f() { if (Math.random()) { >Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1)) >random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) return () => arguments[0]; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols index 96f9712635c..cc867dd2c72 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols @@ -9,7 +9,7 @@ function f() { if (Math.random()) { >Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) ->Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1)) >random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) return () => arguments; diff --git a/tests/baselines/reference/emitBOM.js.map b/tests/baselines/reference/emitBOM.js.map index 69ccb884295..af5fd260813 100644 --- a/tests/baselines/reference/emitBOM.js.map +++ b/tests/baselines/reference/emitBOM.js.map @@ -1,2 +1,2 @@ //// [emitBOM.js.map] -{"version":3,"file":"emitBOM.js","sourceRoot":"","sources":["emitBOM.ts"],"names":[],"mappings":"AACA,6DAA6D;AAC7D,IAAI,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"emitBOM.js","sourceRoot":"","sources":["emitBOM.ts"],"names":[],"mappings":"AAEA,AADA,6DAA6D;IACzD,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/emitBOM.sourcemap.txt b/tests/baselines/reference/emitBOM.sourcemap.txt index 4cf35c4d1e3..cd49155d24f 100644 --- a/tests/baselines/reference/emitBOM.sourcemap.txt +++ b/tests/baselines/reference/emitBOM.sourcemap.txt @@ -10,27 +10,28 @@ sourceFile:emitBOM.ts ------------------------------------------------------------------- >>>// JS and d.ts output should have a BOM but not the sourcemap 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 > + >// JS and d.ts output should have a BOM but not the sourcemap > -2 >// JS and d.ts output should have a BOM but not the sourcemap -1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(1, 62) Source(2, 62) + SourceIndex(0) +2 > +3 >// JS and d.ts output should have a BOM but not the sourcemap +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +3 >Emitted(1, 62) Source(2, 62) + SourceIndex(0) --- >>>var x; -1 > -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^^^^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >var -3 > x -4 > ; -1 >Emitted(2, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(2, 6) Source(3, 6) + SourceIndex(0) -4 >Emitted(2, 7) Source(3, 7) + SourceIndex(0) + >var +2 > x +3 > ; +1 >Emitted(2, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(2, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 7) + SourceIndex(0) --- >>>//# sourceMappingURL=emitBOM.js.map \ No newline at end of file diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index de47b0b95af..9224e156de9 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -28,7 +28,7 @@ class RegisteredUser extends User { //// [emitThisInSuperMethodCall.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index 5bfa3b38e83..f1a0d741a5c 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -12,7 +12,7 @@ class derived extends base { } //// [errorForwardReferenceForwadingConstructor.js] // Error forward referencing derived class with forwarding constructor -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 4e0f84656fd..bd692f35fa3 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -75,7 +75,7 @@ class OtherDerived extends OtherBase { //// [errorSuperCalls.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index 26ef99f269d..abf077d2b82 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -129,7 +129,7 @@ var obj = { n: super.wat, p: super.foo() }; //// [errorSuperPropertyAccess.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index 03bf31a6a6b..0ba69b601ae 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -73,7 +73,7 @@ interface testInterface2 { //// [errorsInGenericTypeReference.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/es5-umd.js b/tests/baselines/reference/es5-umd.js new file mode 100644 index 00000000000..0175e8e9fe8 --- /dev/null +++ b/tests/baselines/reference/es5-umd.js @@ -0,0 +1,32 @@ +//// [es5-umd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + + +//// [es5-umd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es5-umd.js.map + +//// [es5-umd.d.ts] +declare class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es5-umd.js.map b/tests/baselines/reference/es5-umd.js.map new file mode 100644 index 00000000000..5e29a48796e --- /dev/null +++ b/tests/baselines/reference/es5-umd.js.map @@ -0,0 +1,2 @@ +//// [es5-umd.js.map] +{"version":3,"file":"es5-umd.js","sourceRoot":"","sources":["es5-umd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd.sourcemap.txt b/tests/baselines/reference/es5-umd.sourcemap.txt new file mode 100644 index 00000000000..bdbdec5fa9e --- /dev/null +++ b/tests/baselines/reference/es5-umd.sourcemap.txt @@ -0,0 +1,115 @@ +=================================================================== +JsFile: es5-umd.js +mapUrl: es5-umd.js.map +sourceRoot: +sources: es5-umd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-umd.js +sourceFile:es5-umd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^-> +1->class A + >{ + > +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->constructor () + > { + > + > +2 > } +1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es5-umd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd.symbols b/tests/baselines/reference/es5-umd.symbols new file mode 100644 index 00000000000..f570afd9548 --- /dev/null +++ b/tests/baselines/reference/es5-umd.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es5-umd.ts === + +class A +>A : Symbol(A, Decl(es5-umd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-umd.ts, 6, 5)) + { + return 42; + } +} + diff --git a/tests/baselines/reference/es5-umd.types b/tests/baselines/reference/es5-umd.types new file mode 100644 index 00000000000..60987d429e0 --- /dev/null +++ b/tests/baselines/reference/es5-umd.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es5-umd.ts === + +class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; +>42 : number + } +} + diff --git a/tests/baselines/reference/es5-umd2.js b/tests/baselines/reference/es5-umd2.js new file mode 100644 index 00000000000..cb0265bf92f --- /dev/null +++ b/tests/baselines/reference/es5-umd2.js @@ -0,0 +1,42 @@ +//// [es5-umd2.ts] + +export class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + + +//// [es5-umd2.js] +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports"], function (require, exports) { + var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; + })(); + exports.A = A; +}); +//# sourceMappingURL=es5-umd2.js.map + +//// [es5-umd2.d.ts] +export declare class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es5-umd2.js.map b/tests/baselines/reference/es5-umd2.js.map new file mode 100644 index 00000000000..13a785b2edc --- /dev/null +++ b/tests/baselines/reference/es5-umd2.js.map @@ -0,0 +1,2 @@ +//// [es5-umd2.js.map] +{"version":3,"file":"es5-umd2.js","sourceRoot":"","sources":["es5-umd2.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAXY,SAAC,IAWb,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd2.sourcemap.txt b/tests/baselines/reference/es5-umd2.sourcemap.txt new file mode 100644 index 00000000000..bfadd9615f3 --- /dev/null +++ b/tests/baselines/reference/es5-umd2.sourcemap.txt @@ -0,0 +1,149 @@ +=================================================================== +JsFile: es5-umd2.js +mapUrl: es5-umd2.js.map +sourceRoot: +sources: es5-umd2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-umd2.js +sourceFile:es5-umd2.ts +------------------------------------------------------------------- +>>>(function (deps, factory) { +>>> if (typeof module === 'object' && typeof module.exports === 'object') { +>>> var v = factory(require, exports); if (v !== undefined) module.exports = v; +>>> } +>>> else if (typeof define === 'function' && define.amd) { +>>> define(deps, factory); +>>> } +>>>})(["require", "exports"], function (require, exports) { +>>> var A = (function () { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0) +--- +>>> function A() { +1->^^^^^^^^ +2 > ^^-> +1->export class A + >{ + > +1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->constructor () + > { + > + > +2 > } +1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0) +--- +>>> exports.A = A; +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +1-> +2 > A +3 > + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +4 > +1->Emitted(17, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(17, 14) Source(2, 15) + SourceIndex(0) +3 >Emitted(17, 18) Source(13, 2) + SourceIndex(0) +4 >Emitted(17, 19) Source(13, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=es5-umd2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd2.symbols b/tests/baselines/reference/es5-umd2.symbols new file mode 100644 index 00000000000..3b911d7e6f0 --- /dev/null +++ b/tests/baselines/reference/es5-umd2.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es5-umd2.ts === + +export class A +>A : Symbol(A, Decl(es5-umd2.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-umd2.ts, 6, 5)) + { + return 42; + } +} + diff --git a/tests/baselines/reference/es5-umd2.types b/tests/baselines/reference/es5-umd2.types new file mode 100644 index 00000000000..fab4e9dfc01 --- /dev/null +++ b/tests/baselines/reference/es5-umd2.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es5-umd2.ts === + +export class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; +>42 : number + } +} + diff --git a/tests/baselines/reference/es5-umd3.js b/tests/baselines/reference/es5-umd3.js new file mode 100644 index 00000000000..2d18e2eecc3 --- /dev/null +++ b/tests/baselines/reference/es5-umd3.js @@ -0,0 +1,42 @@ +//// [es5-umd3.ts] + +export default class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + + +//// [es5-umd3.js] +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports"], function (require, exports) { + var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; + })(); + exports.default = A; +}); +//# sourceMappingURL=es5-umd3.js.map + +//// [es5-umd3.d.ts] +export default class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es5-umd3.js.map b/tests/baselines/reference/es5-umd3.js.map new file mode 100644 index 00000000000..8b955f11936 --- /dev/null +++ b/tests/baselines/reference/es5-umd3.js.map @@ -0,0 +1,2 @@ +//// [es5-umd3.js.map] +{"version":3,"file":"es5-umd3.js","sourceRoot":"","sources":["es5-umd3.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAXD,mBAWC,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd3.sourcemap.txt b/tests/baselines/reference/es5-umd3.sourcemap.txt new file mode 100644 index 00000000000..afb879ac713 --- /dev/null +++ b/tests/baselines/reference/es5-umd3.sourcemap.txt @@ -0,0 +1,146 @@ +=================================================================== +JsFile: es5-umd3.js +mapUrl: es5-umd3.js.map +sourceRoot: +sources: es5-umd3.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-umd3.js +sourceFile:es5-umd3.ts +------------------------------------------------------------------- +>>>(function (deps, factory) { +>>> if (typeof module === 'object' && typeof module.exports === 'object') { +>>> var v = factory(require, exports); if (v !== undefined) module.exports = v; +>>> } +>>> else if (typeof define === 'function' && define.amd) { +>>> define(deps, factory); +>>> } +>>>})(["require", "exports"], function (require, exports) { +>>> var A = (function () { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0) +--- +>>> function A() { +1->^^^^^^^^ +2 > ^^-> +1->export default class A + >{ + > +1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->constructor () + > { + > + > +2 > } +1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export default class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0) +--- +>>> exports.default = A; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^ +1-> +2 > export default class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +3 > +1->Emitted(17, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(17, 24) Source(13, 2) + SourceIndex(0) +3 >Emitted(17, 25) Source(13, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=es5-umd3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd3.symbols b/tests/baselines/reference/es5-umd3.symbols new file mode 100644 index 00000000000..3f830ae3637 --- /dev/null +++ b/tests/baselines/reference/es5-umd3.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es5-umd3.ts === + +export default class A +>A : Symbol(A, Decl(es5-umd3.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-umd3.ts, 6, 5)) + { + return 42; + } +} + diff --git a/tests/baselines/reference/es5-umd3.types b/tests/baselines/reference/es5-umd3.types new file mode 100644 index 00000000000..b4b5f0dc366 --- /dev/null +++ b/tests/baselines/reference/es5-umd3.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es5-umd3.ts === + +export default class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; +>42 : number + } +} + diff --git a/tests/baselines/reference/es5-umd4.js b/tests/baselines/reference/es5-umd4.js new file mode 100644 index 00000000000..85683f8f3c2 --- /dev/null +++ b/tests/baselines/reference/es5-umd4.js @@ -0,0 +1,45 @@ +//// [es5-umd4.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +export = A; + + +//// [es5-umd4.js] +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports"], function (require, exports) { + var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; + })(); + return A; +}); +//# sourceMappingURL=es5-umd4.js.map + +//// [es5-umd4.d.ts] +declare class A { + constructor(); + B(): number; +} +export = A; diff --git a/tests/baselines/reference/es5-umd4.js.map b/tests/baselines/reference/es5-umd4.js.map new file mode 100644 index 00000000000..0a47d679ed9 --- /dev/null +++ b/tests/baselines/reference/es5-umd4.js.map @@ -0,0 +1,2 @@ +//// [es5-umd4.js.map] +{"version":3,"file":"es5-umd4.js","sourceRoot":"","sources":["es5-umd4.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAEU,AAAX,OAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd4.sourcemap.txt b/tests/baselines/reference/es5-umd4.sourcemap.txt new file mode 100644 index 00000000000..9afd8effecf --- /dev/null +++ b/tests/baselines/reference/es5-umd4.sourcemap.txt @@ -0,0 +1,143 @@ +=================================================================== +JsFile: es5-umd4.js +mapUrl: es5-umd4.js.map +sourceRoot: +sources: es5-umd4.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-umd4.js +sourceFile:es5-umd4.ts +------------------------------------------------------------------- +>>>(function (deps, factory) { +>>> if (typeof module === 'object' && typeof module.exports === 'object') { +>>> var v = factory(require, exports); if (v !== undefined) module.exports = v; +>>> } +>>> else if (typeof define === 'function' && define.amd) { +>>> define(deps, factory); +>>> } +>>>})(["require", "exports"], function (require, exports) { +>>> var A = (function () { +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0) +--- +>>> function A() { +1->^^^^^^^^ +2 > ^^-> +1->class A + >{ + > +1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->constructor () + > { + > + > +2 > } +1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^-> +1 > +2 > } +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0) +--- +>>> return A; +1->^^^^ +2 > +3 > ^^^^^^^ +4 > ^ +5 > ^ +1-> + > + >export = A; +2 > +3 > export = +4 > A +5 > ; +1->Emitted(17, 5) Source(15, 12) + SourceIndex(0) +2 >Emitted(17, 5) Source(15, 1) + SourceIndex(0) +3 >Emitted(17, 12) Source(15, 10) + SourceIndex(0) +4 >Emitted(17, 13) Source(15, 11) + SourceIndex(0) +5 >Emitted(17, 14) Source(15, 12) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=es5-umd4.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-umd4.symbols b/tests/baselines/reference/es5-umd4.symbols new file mode 100644 index 00000000000..cdf1e135cf7 --- /dev/null +++ b/tests/baselines/reference/es5-umd4.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/es5-umd4.ts === + +class A +>A : Symbol(A, Decl(es5-umd4.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-umd4.ts, 6, 5)) + { + return 42; + } +} + +export = A; +>A : Symbol(A, Decl(es5-umd4.ts, 0, 0)) + diff --git a/tests/baselines/reference/es5-umd4.types b/tests/baselines/reference/es5-umd4.types new file mode 100644 index 00000000000..59d23e6bd8d --- /dev/null +++ b/tests/baselines/reference/es5-umd4.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/es5-umd4.ts === + +class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; +>42 : number + } +} + +export = A; +>A : A + diff --git a/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt b/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt index 65f29984d59..f51ff27a412 100644 --- a/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt +++ b/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/es5ModuleInternalNamedImports.ts(23,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(24,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(25,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(26,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(27,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(28,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(29,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es5ModuleInternalNamedImports.ts(30,5): error TS1194: Export declarations are not permitted in an internal module. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(23,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(24,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(25,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(26,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(27,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(28,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(29,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es5ModuleInternalNamedImports.ts(30,5): error TS1194: Export declarations are not permitted in a namespace. ==== tests/cases/compiler/es5ModuleInternalNamedImports.ts (8 errors) ==== @@ -33,27 +33,27 @@ tests/cases/compiler/es5ModuleInternalNamedImports.ts(30,5): error TS1194: Expor // Reexports export {M_V as v}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_I as i}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_C as c}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_M as m}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_MU as mu}; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_F as f}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_E as e}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_A as a}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. } \ No newline at end of file diff --git a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.errors.txt b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.errors.txt index 25e64fc72d0..faf27a85206 100644 --- a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.errors.txt +++ b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts (1 errors) ==== export class A ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. { constructor () { diff --git a/tests/baselines/reference/es6-amd.errors.txt b/tests/baselines/reference/es6-amd.errors.txt index cb1ef4b1287..b4a6442458b 100644 --- a/tests/baselines/reference/es6-amd.errors.txt +++ b/tests/baselines/reference/es6-amd.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6-amd.ts (0 errors) ==== class A diff --git a/tests/baselines/reference/es6-declaration-amd.errors.txt b/tests/baselines/reference/es6-declaration-amd.errors.txt index 18319504dc9..fe5a254dd54 100644 --- a/tests/baselines/reference/es6-declaration-amd.errors.txt +++ b/tests/baselines/reference/es6-declaration-amd.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6-declaration-amd.ts (0 errors) ==== class A diff --git a/tests/baselines/reference/es6-sourcemap-amd.errors.txt b/tests/baselines/reference/es6-sourcemap-amd.errors.txt index 24a83f8ee12..8ffa16aaa23 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.errors.txt +++ b/tests/baselines/reference/es6-sourcemap-amd.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6-sourcemap-amd.ts (0 errors) ==== class A diff --git a/tests/baselines/reference/es6-umd.errors.txt b/tests/baselines/reference/es6-umd.errors.txt new file mode 100644 index 00000000000..72a58585073 --- /dev/null +++ b/tests/baselines/reference/es6-umd.errors.txt @@ -0,0 +1,18 @@ +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. + + +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. +==== tests/cases/compiler/es6-umd.ts (0 errors) ==== + + class A + { + constructor () + { + + } + + public B() + { + return 42; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/es6-umd.js b/tests/baselines/reference/es6-umd.js new file mode 100644 index 00000000000..74cd671f5ef --- /dev/null +++ b/tests/baselines/reference/es6-umd.js @@ -0,0 +1,30 @@ +//// [es6-umd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es6-umd.js] +class A { + constructor() { + } + B() { + return 42; + } +} +//# sourceMappingURL=es6-umd.js.map + +//// [es6-umd.d.ts] +declare class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es6-umd.js.map b/tests/baselines/reference/es6-umd.js.map new file mode 100644 index 00000000000..a5e82f7ccfd --- /dev/null +++ b/tests/baselines/reference/es6-umd.js.map @@ -0,0 +1,2 @@ +//// [es6-umd.js.map] +{"version":3,"file":"es6-umd.js","sourceRoot":"","sources":["es6-umd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,CAACA;QAEJE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;AACLF,CAACA;AAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-umd.sourcemap.txt b/tests/baselines/reference/es6-umd.sourcemap.txt new file mode 100644 index 00000000000..bb8281ce741 --- /dev/null +++ b/tests/baselines/reference/es6-umd.sourcemap.txt @@ -0,0 +1,91 @@ +=================================================================== +JsFile: es6-umd.js +mapUrl: es6-umd.js.map +sourceRoot: +sources: es6-umd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es6-umd.js +sourceFile:es6-umd.ts +------------------------------------------------------------------- +>>>class A { +1 > +2 >^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +--- +>>> constructor() { +1->^^^^ +2 > ^^-> +1->class A + >{ + > +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^-> +1->constructor () + > { + > + > +2 > } +1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> B() { +1->^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^-> +1-> + > + > public +2 > B +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 6) Source(9, 13) + SourceIndex(0) name (A) +--- +>>> return 42; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1->() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1->Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(7, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 2) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>//# sourceMappingURL=es6-umd.js.map1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +1->Emitted(8, 1) Source(13, 2) + SourceIndex(0) +--- \ No newline at end of file diff --git a/tests/baselines/reference/es6-umd2.errors.txt b/tests/baselines/reference/es6-umd2.errors.txt new file mode 100644 index 00000000000..00becfb105f --- /dev/null +++ b/tests/baselines/reference/es6-umd2.errors.txt @@ -0,0 +1,18 @@ +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. + + +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. +==== tests/cases/compiler/es6-umd2.ts (0 errors) ==== + + export class A + { + constructor () + { + + } + + public B() + { + return 42; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/es6-umd2.js b/tests/baselines/reference/es6-umd2.js new file mode 100644 index 00000000000..b12d35aacf8 --- /dev/null +++ b/tests/baselines/reference/es6-umd2.js @@ -0,0 +1,30 @@ +//// [es6-umd2.ts] + +export class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es6-umd2.js] +export class A { + constructor() { + } + B() { + return 42; + } +} +//# sourceMappingURL=es6-umd2.js.map + +//// [es6-umd2.d.ts] +export declare class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es6-umd2.js.map b/tests/baselines/reference/es6-umd2.js.map new file mode 100644 index 00000000000..81f3d85a6cd --- /dev/null +++ b/tests/baselines/reference/es6-umd2.js.map @@ -0,0 +1,2 @@ +//// [es6-umd2.js.map] +{"version":3,"file":"es6-umd2.js","sourceRoot":"","sources":["es6-umd2.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,CAACA;QAEJE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;AACLF,CAACA;AAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-umd2.sourcemap.txt b/tests/baselines/reference/es6-umd2.sourcemap.txt new file mode 100644 index 00000000000..d032aa3d6c7 --- /dev/null +++ b/tests/baselines/reference/es6-umd2.sourcemap.txt @@ -0,0 +1,91 @@ +=================================================================== +JsFile: es6-umd2.js +mapUrl: es6-umd2.js.map +sourceRoot: +sources: es6-umd2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es6-umd2.js +sourceFile:es6-umd2.ts +------------------------------------------------------------------- +>>>export class A { +1 > +2 >^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +--- +>>> constructor() { +1->^^^^ +2 > ^^-> +1->export class A + >{ + > +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^-> +1->constructor () + > { + > + > +2 > } +1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> B() { +1->^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^-> +1-> + > + > public +2 > B +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 6) Source(9, 13) + SourceIndex(0) name (A) +--- +>>> return 42; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1->() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1->Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(7, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 2) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>//# sourceMappingURL=es6-umd2.js.map1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +1->Emitted(8, 1) Source(13, 2) + SourceIndex(0) +--- \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index c5d668c2f3d..a374778ef45 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -14,7 +14,7 @@ class B extends A { //// [es6ClassSuperCodegenBug.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index 08c184a0df2..bf65840e31c 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -85,7 +85,7 @@ declare module AmbientMod { //// [es6ClassTest.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index f23be04fd17..40f1c15c8f1 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -159,7 +159,7 @@ var ccwc = new ChildClassWithoutConstructor(1, "s"); //// [es6ClassTest2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index 728b4d0a404..c4f7e83b9a2 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -9,7 +9,7 @@ class Bar extends M.Foo { //// [es6ClassTest7.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/es6ExportAssignment2.errors.txt b/tests/baselines/reference/es6ExportAssignment2.errors.txt new file mode 100644 index 00000000000..d5e1dfebd9d --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment2.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/a.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead. + + +==== tests/cases/compiler/a.ts (1 errors) ==== + + var a = 10; + export = a; // Error: export = not allowed in ES6 + ~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead. + +==== tests/cases/compiler/b.ts (0 errors) ==== + import * as a from "a"; + \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAssignment2.js b/tests/baselines/reference/es6ExportAssignment2.js new file mode 100644 index 00000000000..f038f71d494 --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment2.js @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/es6ExportAssignment2.ts] //// + +//// [a.ts] + +var a = 10; +export = a; // Error: export = not allowed in ES6 + +//// [b.ts] +import * as a from "a"; + + +//// [a.js] +var a = 10; +//// [b.js] diff --git a/tests/baselines/reference/es6ExportAssignment3.js b/tests/baselines/reference/es6ExportAssignment3.js new file mode 100644 index 00000000000..1a25ee94023 --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment3.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/es6ExportAssignment3.ts] //// + +//// [a.d.ts] + +declare var a: number; +export = a; // OK, in ambient context + +//// [b.ts] +import * as a from "a"; + + +//// [b.js] diff --git a/tests/baselines/reference/es6ExportAssignment3.symbols b/tests/baselines/reference/es6ExportAssignment3.symbols new file mode 100644 index 00000000000..73346cdc4b8 --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment3.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/a.d.ts === + +declare var a: number; +>a : Symbol(a, Decl(a.d.ts, 1, 11)) + +export = a; // OK, in ambient context +>a : Symbol(a, Decl(a.d.ts, 1, 11)) + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ExportAssignment3.types b/tests/baselines/reference/es6ExportAssignment3.types new file mode 100644 index 00000000000..84f896c301d --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment3.types @@ -0,0 +1,12 @@ +=== tests/cases/compiler/a.d.ts === + +declare var a: number; +>a : number + +export = a; // OK, in ambient context +>a : number + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : number + diff --git a/tests/baselines/reference/es6ExportAssignment4.js b/tests/baselines/reference/es6ExportAssignment4.js new file mode 100644 index 00000000000..a06aa4d49de --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment4.js @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/es6ExportAssignment4.ts] //// + +//// [modules.d.ts] + +declare module "a" { + var a: number; + export = a; // OK, in ambient context +} + +//// [b.ts] +import * as a from "a"; + + +//// [b.js] diff --git a/tests/baselines/reference/es6ExportAssignment4.symbols b/tests/baselines/reference/es6ExportAssignment4.symbols new file mode 100644 index 00000000000..42d4a9d009f --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment4.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/modules.d.ts === + +declare module "a" { + var a: number; +>a : Symbol(a, Decl(modules.d.ts, 2, 7)) + + export = a; // OK, in ambient context +>a : Symbol(a, Decl(modules.d.ts, 2, 7)) +} + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ExportAssignment4.types b/tests/baselines/reference/es6ExportAssignment4.types new file mode 100644 index 00000000000..c32bc14ec90 --- /dev/null +++ b/tests/baselines/reference/es6ExportAssignment4.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/modules.d.ts === + +declare module "a" { + var a: number; +>a : number + + export = a; // OK, in ambient context +>a : number +} + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : number + diff --git a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt index 7cc84187145..98e39cf73e7 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt +++ b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt @@ -1,35 +1,35 @@ tests/cases/compiler/main.ts(15,1): error TS2304: Cannot find name 'z1'. tests/cases/compiler/main.ts(21,4): error TS2339: Property 'a' does not exist on type '() => any'. tests/cases/compiler/main.ts(23,4): error TS2339: Property 'a' does not exist on type 'typeof Foo'. -tests/cases/compiler/main.ts(27,8): error TS1192: External module '"interface"' has no default export. -tests/cases/compiler/main.ts(28,8): error TS1192: External module '"variable"' has no default export. -tests/cases/compiler/main.ts(29,8): error TS1192: External module '"interface-variable"' has no default export. -tests/cases/compiler/main.ts(30,8): error TS1192: External module '"module"' has no default export. -tests/cases/compiler/main.ts(31,8): error TS1192: External module '"interface-module"' has no default export. -tests/cases/compiler/main.ts(32,8): error TS1192: External module '"variable-module"' has no default export. -tests/cases/compiler/main.ts(33,8): error TS1192: External module '"function"' has no default export. -tests/cases/compiler/main.ts(34,8): error TS1192: External module '"function-module"' has no default export. -tests/cases/compiler/main.ts(35,8): error TS1192: External module '"class"' has no default export. -tests/cases/compiler/main.ts(36,8): error TS1192: External module '"class-module"' has no default export. -tests/cases/compiler/main.ts(39,21): error TS2497: External module '"interface"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(45,21): error TS2497: External module '"function"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(47,21): error TS2497: External module '"class"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(62,25): error TS2497: External module '"interface"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(68,25): error TS2497: External module '"function"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(70,25): error TS2497: External module '"class"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(85,25): error TS2497: External module '"interface"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(91,25): error TS2497: External module '"function"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(93,25): error TS2497: External module '"class"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(97,15): error TS2498: External module '"interface"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(98,15): error TS2498: External module '"variable"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(99,15): error TS2498: External module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(100,15): error TS2498: External module '"module"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(101,15): error TS2498: External module '"interface-module"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(102,15): error TS2498: External module '"variable-module"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(103,15): error TS2498: External module '"function"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(104,15): error TS2498: External module '"function-module"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(105,15): error TS2498: External module '"class"' uses 'export =' and cannot be used with 'export *'. -tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-module"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(27,8): error TS1192: Module '"interface"' has no default export. +tests/cases/compiler/main.ts(28,8): error TS1192: Module '"variable"' has no default export. +tests/cases/compiler/main.ts(29,8): error TS1192: Module '"interface-variable"' has no default export. +tests/cases/compiler/main.ts(30,8): error TS1192: Module '"module"' has no default export. +tests/cases/compiler/main.ts(31,8): error TS1192: Module '"interface-module"' has no default export. +tests/cases/compiler/main.ts(32,8): error TS1192: Module '"variable-module"' has no default export. +tests/cases/compiler/main.ts(33,8): error TS1192: Module '"function"' has no default export. +tests/cases/compiler/main.ts(34,8): error TS1192: Module '"function-module"' has no default export. +tests/cases/compiler/main.ts(35,8): error TS1192: Module '"class"' has no default export. +tests/cases/compiler/main.ts(36,8): error TS1192: Module '"class-module"' has no default export. +tests/cases/compiler/main.ts(39,21): error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(45,21): error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(47,21): error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(62,25): error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(68,25): error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(70,25): error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(85,25): error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(91,25): error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(93,25): error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(97,15): error TS2498: Module '"interface"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(98,15): error TS2498: Module '"variable"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(99,15): error TS2498: Module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(100,15): error TS2498: Module '"module"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(101,15): error TS2498: Module '"interface-module"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(102,15): error TS2498: Module '"variable-module"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(103,15): error TS2498: Module '"function"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(104,15): error TS2498: Module '"function-module"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(105,15): error TS2498: Module '"class"' uses 'export =' and cannot be used with 'export *'. +tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and cannot be used with 'export *'. ==== tests/cases/compiler/main.ts (32 errors) ==== @@ -67,39 +67,39 @@ tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-modu // default import import x1 from "interface"; ~~ -!!! error TS1192: External module '"interface"' has no default export. +!!! error TS1192: Module '"interface"' has no default export. import x2 from "variable"; ~~ -!!! error TS1192: External module '"variable"' has no default export. +!!! error TS1192: Module '"variable"' has no default export. import x3 from "interface-variable"; ~~ -!!! error TS1192: External module '"interface-variable"' has no default export. +!!! error TS1192: Module '"interface-variable"' has no default export. import x4 from "module"; ~~ -!!! error TS1192: External module '"module"' has no default export. +!!! error TS1192: Module '"module"' has no default export. import x5 from "interface-module"; ~~ -!!! error TS1192: External module '"interface-module"' has no default export. +!!! error TS1192: Module '"interface-module"' has no default export. import x6 from "variable-module"; ~~ -!!! error TS1192: External module '"variable-module"' has no default export. +!!! error TS1192: Module '"variable-module"' has no default export. import x7 from "function"; ~~ -!!! error TS1192: External module '"function"' has no default export. +!!! error TS1192: Module '"function"' has no default export. import x8 from "function-module"; ~~ -!!! error TS1192: External module '"function-module"' has no default export. +!!! error TS1192: Module '"function-module"' has no default export. import x9 from "class"; ~~ -!!! error TS1192: External module '"class"' has no default export. +!!! error TS1192: Module '"class"' has no default export. import x0 from "class-module"; ~~ -!!! error TS1192: External module '"class-module"' has no default export. +!!! error TS1192: Module '"class-module"' has no default export. // namespace import import * as y1 from "interface"; ~~~~~~~~~~~ -!!! error TS2497: External module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. import * as y2 from "variable"; import * as y3 from "interface-variable"; import * as y4 from "module"; @@ -107,11 +107,11 @@ tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-modu import * as y6 from "variable-module"; import * as y7 from "function"; ~~~~~~~~~~ -!!! error TS2497: External module '"function"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. import * as y8 from "function-module"; import * as y9 from "class"; ~~~~~~~ -!!! error TS2497: External module '"class"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. import * as y0 from "class-module"; y1.a; @@ -128,7 +128,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-modu // named import import { a as a1 } from "interface"; ~~~~~~~~~~~ -!!! error TS2497: External module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. import { a as a2 } from "variable"; import { a as a3 } from "interface-variable"; import { a as a4 } from "module"; @@ -136,11 +136,11 @@ tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-modu import { a as a6 } from "variable-module"; import { a as a7 } from "function"; ~~~~~~~~~~ -!!! error TS2497: External module '"function"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. import { a as a8 } from "function-module"; import { a as a9 } from "class"; ~~~~~~~ -!!! error TS2497: External module '"class"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. import { a as a0 } from "class-module"; a1; @@ -157,7 +157,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-modu // named export export { a as a1 } from "interface"; ~~~~~~~~~~~ -!!! error TS2497: External module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. export { a as a2 } from "variable"; export { a as a3 } from "interface-variable"; export { a as a4 } from "module"; @@ -165,44 +165,44 @@ tests/cases/compiler/main.ts(106,15): error TS2498: External module '"class-modu export { a as a6 } from "variable-module"; export { a as a7 } from "function"; ~~~~~~~~~~ -!!! error TS2497: External module '"function"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. export { a as a8 } from "function-module"; export { a as a9 } from "class"; ~~~~~~~ -!!! error TS2497: External module '"class"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. export { a as a0 } from "class-module"; // export-star export * from "interface"; ~~~~~~~~~~~ -!!! error TS2498: External module '"interface"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"interface"' uses 'export =' and cannot be used with 'export *'. export * from "variable"; ~~~~~~~~~~ -!!! error TS2498: External module '"variable"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"variable"' uses 'export =' and cannot be used with 'export *'. export * from "interface-variable"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2498: External module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. export * from "module"; ~~~~~~~~ -!!! error TS2498: External module '"module"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"module"' uses 'export =' and cannot be used with 'export *'. export * from "interface-module"; ~~~~~~~~~~~~~~~~~~ -!!! error TS2498: External module '"interface-module"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"interface-module"' uses 'export =' and cannot be used with 'export *'. export * from "variable-module"; ~~~~~~~~~~~~~~~~~ -!!! error TS2498: External module '"variable-module"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"variable-module"' uses 'export =' and cannot be used with 'export *'. export * from "function"; ~~~~~~~~~~ -!!! error TS2498: External module '"function"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"function"' uses 'export =' and cannot be used with 'export *'. export * from "function-module"; ~~~~~~~~~~~~~~~~~ -!!! error TS2498: External module '"function-module"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"function-module"' uses 'export =' and cannot be used with 'export *'. export * from "class"; ~~~~~~~ -!!! error TS2498: External module '"class"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"class"' uses 'export =' and cannot be used with 'export *'. export * from "class-module"; ~~~~~~~~~~~~~~ -!!! error TS2498: External module '"class-module"' uses 'export =' and cannot be used with 'export *'. +!!! error TS2498: Module '"class-module"' uses 'export =' and cannot be used with 'export *'. ==== tests/cases/compiler/modules.d.ts (0 errors) ==== diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt index 34bb303a571..2688d4af06f 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0.ts (0 errors) ==== export var a = 10; diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.errors.txt index 409c50d3a3f..451543d78f5 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportDts.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/client.ts(1,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. -tests/cases/compiler/client.ts(2,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. -tests/cases/compiler/client.ts(4,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. -tests/cases/compiler/client.ts(6,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. -tests/cases/compiler/client.ts(9,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. -tests/cases/compiler/client.ts(11,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(1,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(2,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(4,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(6,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(9,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(11,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. ==== tests/cases/compiler/server.ts (0 errors) ==== @@ -18,26 +18,26 @@ tests/cases/compiler/client.ts(11,8): error TS1192: External module '"tests/case ==== tests/cases/compiler/client.ts (6 errors) ==== import defaultBinding1, { } from "server"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. import defaultBinding2, { a } from "server"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x1 = new a(); import defaultBinding3, { a11 as b } from "server"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x2 = new b(); import defaultBinding4, { x, a12 as y } from "server"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x4 = new x(); export var x5 = new y(); import defaultBinding5, { x11 as z, } from "server"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x3 = new z(); import defaultBinding6, { m, } from "server"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x6 = new m(); \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt index 502b1940576..c1c28416ec7 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(2,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(4,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(6,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(9,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(11,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(1,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(2,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(4,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(6,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(9,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(11,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.ts (0 errors) ==== @@ -15,26 +15,26 @@ tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(11 ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts (6 errors) ==== import defaultBinding1, { } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. import defaultBinding2, { a } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. var x1: number = a; import defaultBinding3, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. var x1: number = b; import defaultBinding4, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. var x1: number = x; var x1: number = y; import defaultBinding5, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. var x1: number = z; import defaultBinding6, { m, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; ~~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"' has no default export. var x1: number = m; \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.errors.txt index ce7e8b1dc5d..eb28020ca9e 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts(1,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0"' has no default export. ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts (0 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts(1, ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts (1 errors) ==== import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0"; ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0"' has no default export. var x: number = nameSpaceBinding.a; \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.errors.txt index 8af978d3bb6..19fa0383d52 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/client.ts(1,8): error TS1192: External module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(1,8): error TS1192: Module '"tests/cases/compiler/server"' has no default export. ==== tests/cases/compiler/server.ts (0 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/client.ts(1,8): error TS1192: External module '"tests/cases ==== tests/cases/compiler/client.ts (1 errors) ==== import defaultBinding, * as nameSpaceBinding from "server"; ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x = new nameSpaceBinding.a(); \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.errors.txt index 48829f8e719..dbbbf67118e 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts(1,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"' has no default export. ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts (0 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1. ==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts (1 errors) ==== import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"; ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"' has no default export. var x: number = nameSpaceBinding.a; \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.errors.txt index 4730d493d8e..3da1cf3fda8 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/client.ts(1,1): error TS1191: An import declaration cannot have modifiers. -tests/cases/compiler/client.ts(1,15): error TS1192: External module '"tests/cases/compiler/server"' has no default export. +tests/cases/compiler/client.ts(1,15): error TS1192: Module '"tests/cases/compiler/server"' has no default export. ==== tests/cases/compiler/server.ts (0 errors) ==== @@ -11,5 +11,5 @@ tests/cases/compiler/client.ts(1,15): error TS1192: External module '"tests/case ~~~~~~ !!! error TS1191: An import declaration cannot have modifiers. ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/server"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/server"' has no default export. export var x: number = nameSpaceBinding.a; \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingInEs5.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingInEs5.errors.txt index 5cccfd01094..109b322f4bb 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingInEs5.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingInEs5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts(1,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' has no default export. ==== tests/cases/compiler/es6ImportDefaultBindingInEs5_0.ts (0 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts(1,8): error TS1192: Exter ==== tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts (1 errors) ==== import defaultBinding from "es6ImportDefaultBindingInEs5_0"; ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' has no default export. \ No newline at end of file +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' has no default export. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingNoDefaultProperty.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingNoDefaultProperty.errors.txt index 43eaa16f639..a37a71e7378 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingNoDefaultProperty.errors.txt +++ b/tests/baselines/reference/es6ImportDefaultBindingNoDefaultProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_1.ts(1,8): error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0"' has no default export. +tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_1.ts(1,8): error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0"' has no default export. ==== tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0.ts (0 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_1.ts(1,8): error T ==== tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_1.ts (1 errors) ==== import defaultBinding from "es6ImportDefaultBindingNoDefaultProperty_0"; ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportDefaultBindingNoDefaultProperty_0"' has no default export. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportNameSpaceImport.errors.txt b/tests/baselines/reference/es6ImportNameSpaceImport.errors.txt index 635bb955c00..00a6dcb2cfd 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImport.errors.txt +++ b/tests/baselines/reference/es6ImportNameSpaceImport.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6ImportNameSpaceImport_0.ts (0 errors) ==== export var a = 10; diff --git a/tests/baselines/reference/es6ImportNamedImport.errors.txt b/tests/baselines/reference/es6ImportNamedImport.errors.txt index 5723b5c20d4..12dcf331967 100644 --- a/tests/baselines/reference/es6ImportNamedImport.errors.txt +++ b/tests/baselines/reference/es6ImportNamedImport.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6ImportNamedImport_0.ts (0 errors) ==== export var a = 10; diff --git a/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt b/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt index bba30908b01..cb0a5caff8d 100644 --- a/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt +++ b/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt @@ -1,16 +1,16 @@ tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(2,10): error TS2300: Duplicate identifier 'yield'. -tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(2,23): error TS2307: Cannot find external module 'somemodule'. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(2,23): error TS2307: Cannot find module 'somemodule'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,10): error TS1003: Identifier expected. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,10): error TS2300: Duplicate identifier 'default'. -tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,25): error TS2307: Cannot find external module 'somemodule'. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,25): error TS2307: Cannot find module 'somemodule'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,19): error TS1003: Identifier expected. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,19): error TS2300: Duplicate identifier 'default'. -tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,34): error TS2307: Cannot find external module 'somemodule'. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,34): error TS2307: Cannot find module 'somemodule'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(5,21): error TS2300: Duplicate identifier 'yield'. -tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(5,34): error TS2307: Cannot find external module 'somemodule'. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(5,34): error TS2307: Cannot find module 'somemodule'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,21): error TS1003: Identifier expected. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,21): error TS2300: Duplicate identifier 'default'. -tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,36): error TS2307: Cannot find external module 'somemodule'. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,36): error TS2307: Cannot find module 'somemodule'. ==== tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts (13 errors) ==== @@ -19,30 +19,30 @@ tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,36): error TS23 ~~~~~ !!! error TS2300: Duplicate identifier 'yield'. ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'somemodule'. +!!! error TS2307: Cannot find module 'somemodule'. import { default } from "somemodule"; // Error - as this is keyword that is not allowed as identifier ~~~~~~~ !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS2300: Duplicate identifier 'default'. ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'somemodule'. +!!! error TS2307: Cannot find module 'somemodule'. import { yield as default } from "somemodule"; // error to use default as binding name ~~~~~~~ !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS2300: Duplicate identifier 'default'. ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'somemodule'. +!!! error TS2307: Cannot find module 'somemodule'. import { default as yield } from "somemodule"; // no error ~~~~~ !!! error TS2300: Duplicate identifier 'yield'. ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'somemodule'. +!!! error TS2307: Cannot find module 'somemodule'. import { default as default } from "somemodule"; // default as is ok, error of default binding name ~~~~~~~ !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS2300: Duplicate identifier 'default'. ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'somemodule'. \ No newline at end of file +!!! error TS2307: Cannot find module 'somemodule'. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.errors.txt b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.errors.txt index 41d3f160938..970c51973b2 100644 --- a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.errors.txt +++ b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.errors.txt @@ -1,8 +1,8 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. tests/cases/compiler/es6ImportNamedImportInExportAssignment_1.ts(2,1): error TS1203: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6ImportNamedImportInExportAssignment_0.ts (0 errors) ==== export var a = 10; diff --git a/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt b/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt index c9586d01693..585cc51fb92 100644 --- a/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt +++ b/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,10): error TS1141: tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,12): error TS1109: Expression expected. tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,14): error TS2304: Cannot find name 'from'. tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,19): error TS1005: ';' expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,8): error TS1192: External module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export. +tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,8): error TS1192: Module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export. tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,24): error TS1005: '{' expected. tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,1): error TS1128: Declaration or statement expected. tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,8): error TS1128: Declaration or statement expected. @@ -34,7 +34,7 @@ tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,20): error TS1005: !!! error TS1005: ';' expected. import defaultBinding, from "es6ImportNamedImportParsingError_0"; ~~~~~~~~~~~~~~ -!!! error TS1192: External module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export. +!!! error TS1192: Module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export. ~~~~ !!! error TS1005: '{' expected. import , { a } from "es6ImportNamedImportParsingError_0"; diff --git a/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt b/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt index 4e097ec1a33..fb49f08e2e0 100644 --- a/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt +++ b/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/es6ModuleInternalNamedImports.ts(23,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(24,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(25,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(26,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(27,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(28,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(29,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports.ts(30,5): error TS1194: Export declarations are not permitted in an internal module. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(23,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(24,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(25,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(26,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(27,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(28,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(29,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports.ts(30,5): error TS1194: Export declarations are not permitted in a namespace. ==== tests/cases/compiler/es6ModuleInternalNamedImports.ts (8 errors) ==== @@ -33,27 +33,27 @@ tests/cases/compiler/es6ModuleInternalNamedImports.ts(30,5): error TS1194: Expor // Reexports export {M_V as v}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_I as i}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_C as c}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_M as m}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_MU as mu}; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_F as f}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_E as e}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_A as a}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt b/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt index 77ee76cf9c8..af8de2d7fe2 100644 --- a/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt +++ b/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(25,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(26,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(27,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(28,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(29,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(30,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(31,5): error TS1194: Export declarations are not permitted in an internal module. -tests/cases/compiler/es6ModuleInternalNamedImports2.ts(32,5): error TS1194: Export declarations are not permitted in an internal module. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(25,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(26,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(27,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(28,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(29,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(30,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(31,5): error TS1194: Export declarations are not permitted in a namespace. +tests/cases/compiler/es6ModuleInternalNamedImports2.ts(32,5): error TS1194: Export declarations are not permitted in a namespace. ==== tests/cases/compiler/es6ModuleInternalNamedImports2.ts (8 errors) ==== @@ -35,27 +35,27 @@ tests/cases/compiler/es6ModuleInternalNamedImports2.ts(32,5): error TS1194: Expo // Reexports export {M_V as v}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_I as i}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_C as c}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_M as m}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_MU as mu}; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_F as f}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_E as e}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. export {M_A as a}; ~~~~~~~~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.errors.txt b/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.errors.txt index bbe0d8b78b6..9592a9f899e 100644 --- a/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.errors.txt +++ b/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6ModuleWithModuleGenTargetAmd.ts (0 errors) ==== export class A { diff --git a/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.errors.txt b/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.errors.txt index 87f53cb7810..b7401040099 100644 --- a/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.errors.txt +++ b/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.errors.txt @@ -1,7 +1,7 @@ -error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. -!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher. +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. ==== tests/cases/compiler/es6ModuleWithModuleGenTargetCommonjs.ts (0 errors) ==== export class A { diff --git a/tests/baselines/reference/exportAssignDottedName.errors.txt b/tests/baselines/reference/exportAssignDottedName.errors.txt index a63a62fccbe..39a0a2577ee 100644 --- a/tests/baselines/reference/exportAssignDottedName.errors.txt +++ b/tests/baselines/reference/exportAssignDottedName.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot comp ==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== export function x(){ ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. return true; } \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt b/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt index a3e4702f1e6..753bc567619 100644 --- a/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ==== @@ -7,7 +7,7 @@ tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot comp ==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== export function x(){ ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. return true; } diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt index 2935308909b..09e86ec12c4 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/externalModules/foo3.ts(1,16): error TS9003: 'class' expressions are not currently supported. tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected. @@ -7,7 +7,7 @@ tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression var x = 10; export = typeof x; // Ok ~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== export = "sausages"; // Ok diff --git a/tests/baselines/reference/exportAssignTypes.errors.txt b/tests/baselines/reference/exportAssignTypes.errors.txt index c35e7c0b8f6..ba5538777c5 100644 --- a/tests/baselines/reference/exportAssignTypes.errors.txt +++ b/tests/baselines/reference/exportAssignTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/expString.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/expString.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/consumer.ts (0 errors) ==== @@ -27,7 +27,7 @@ tests/cases/conformance/externalModules/expString.ts(2,1): error TS1148: Cannot var x = "test"; export = x; ~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/expNumber.ts (0 errors) ==== var x = 42; diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js index 0b8c4f2596c..983c328cd98 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -23,7 +23,7 @@ define(["require", "exports"], function (require, exports) { return T; }); //// [exportAssignmentOfGenericType1_1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index 97011f2425f..9894f1fb194 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -19,7 +19,7 @@ var a: Bbb.SomeType; //// [exportDeclarationInInternalModule.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/exportDeclaredModule.errors.txt b/tests/baselines/reference/exportDeclaredModule.errors.txt index 265061fe2f4..47ee543e0c0 100644 --- a/tests/baselines/reference/exportDeclaredModule.errors.txt +++ b/tests/baselines/reference/exportDeclaredModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(6,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(6,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== @@ -12,5 +12,5 @@ tests/cases/conformance/externalModules/foo1.ts(6,1): error TS1148: Cannot compi } export = M1; ~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultVariable.js b/tests/baselines/reference/exportDefaultVariable.js new file mode 100644 index 00000000000..beb8bb84a80 --- /dev/null +++ b/tests/baselines/reference/exportDefaultVariable.js @@ -0,0 +1,12 @@ +//// [exportDefaultVariable.ts] +// Regression test for #3018 + +declare var io: any; + +declare module 'module' { + export default io; +} + + +//// [exportDefaultVariable.js] +// Regression test for #3018 diff --git a/tests/baselines/reference/exportDefaultVariable.symbols b/tests/baselines/reference/exportDefaultVariable.symbols new file mode 100644 index 00000000000..cd7ebed926c --- /dev/null +++ b/tests/baselines/reference/exportDefaultVariable.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/exportDefaultVariable.ts === +// Regression test for #3018 + +declare var io: any; +>io : Symbol(io, Decl(exportDefaultVariable.ts, 2, 11)) + +declare module 'module' { + export default io; +>io : Symbol(default, Decl(exportDefaultVariable.ts, 2, 11)) +} + diff --git a/tests/baselines/reference/exportDefaultVariable.types b/tests/baselines/reference/exportDefaultVariable.types new file mode 100644 index 00000000000..a61c64b4685 --- /dev/null +++ b/tests/baselines/reference/exportDefaultVariable.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/exportDefaultVariable.ts === +// Regression test for #3018 + +declare var io: any; +>io : any + +declare module 'module' { + export default io; +>io : any +} + diff --git a/tests/baselines/reference/exportNonVisibleType.errors.txt b/tests/baselines/reference/exportNonVisibleType.errors.txt index 0eb73b2b04e..04c174b4994 100644 --- a/tests/baselines/reference/exportNonVisibleType.errors.txt +++ b/tests/baselines/reference/exportNonVisibleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo1.ts(7,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(7,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/externalModules/foo1.ts(7,1): error TS1148: Cannot compi var x: I1 = {a: "test", b: 42}; export = x; // Should fail, I1 not exported. ~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== diff --git a/tests/baselines/reference/exportStar-amd.errors.txt b/tests/baselines/reference/exportStar-amd.errors.txt index 87e4c4740a0..adab0516103 100644 --- a/tests/baselines/reference/exportStar-amd.errors.txt +++ b/tests/baselines/reference/exportStar-amd.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: External module '"tests/cases/conformance/es6/modules/t4"' has no default export. +tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: Module '"tests/cases/conformance/es6/modules/t4"' has no default export. ==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ==== @@ -24,7 +24,7 @@ tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: External module ==== tests/cases/conformance/es6/modules/main.ts (1 errors) ==== import hello, { x, y, z, foo } from "./t4"; ~~~~~ -!!! error TS1192: External module '"tests/cases/conformance/es6/modules/t4"' has no default export. +!!! error TS1192: Module '"tests/cases/conformance/es6/modules/t4"' has no default export. hello; x; y; diff --git a/tests/baselines/reference/exportStar.errors.txt b/tests/baselines/reference/exportStar.errors.txt index 87e4c4740a0..adab0516103 100644 --- a/tests/baselines/reference/exportStar.errors.txt +++ b/tests/baselines/reference/exportStar.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: External module '"tests/cases/conformance/es6/modules/t4"' has no default export. +tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: Module '"tests/cases/conformance/es6/modules/t4"' has no default export. ==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ==== @@ -24,7 +24,7 @@ tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: External module ==== tests/cases/conformance/es6/modules/main.ts (1 errors) ==== import hello, { x, y, z, foo } from "./t4"; ~~~~~ -!!! error TS1192: External module '"tests/cases/conformance/es6/modules/t4"' has no default export. +!!! error TS1192: Module '"tests/cases/conformance/es6/modules/t4"' has no default export. hello; x; y; diff --git a/tests/baselines/reference/exportStarFromEmptyModule.errors.txt b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt index 598eb8bc029..c88ac3b3f19 100644 --- a/tests/baselines/reference/exportStarFromEmptyModule.errors.txt +++ b/tests/baselines/reference/exportStarFromEmptyModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/exportStarFromEmptyModule_module3.ts(1,15): error TS2306: File 'tests/cases/compiler/exportStarFromEmptyModule_module2.ts' is not an external module. +tests/cases/compiler/exportStarFromEmptyModule_module3.ts(1,15): error TS2306: File 'tests/cases/compiler/exportStarFromEmptyModule_module2.ts' is not a module. tests/cases/compiler/exportStarFromEmptyModule_module4.ts(4,5): error TS2339: Property 'r' does not exist on type 'typeof A'. @@ -14,7 +14,7 @@ tests/cases/compiler/exportStarFromEmptyModule_module4.ts(4,5): error TS2339: Pr ==== tests/cases/compiler/exportStarFromEmptyModule_module3.ts (1 errors) ==== export * from "exportStarFromEmptyModule_module2"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2306: File 'exportStarFromEmptyModule_module2.ts' is not an external module. +!!! error TS2306: File 'exportStarFromEmptyModule_module2.ts' is not a module. export * from "exportStarFromEmptyModule_module1"; export class A { diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 7997944ee7a..9e7421b906c 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -20,7 +20,7 @@ module N { //// [extBaseClass1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js index eff97549010..e5a717bca80 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -11,7 +11,7 @@ module M { //// [extBaseClass2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index 23c9127175e..c69315dbd61 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -14,7 +14,7 @@ d.baz(); d.foo; //// [extendAndImplementTheSameBaseType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index 234cc59ff70..06ea74880c2 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -17,7 +17,7 @@ var r3: string = d.bar(); var r4: number = d.bar(); //// [extendAndImplementTheSameBaseType2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js index 5034fd96691..7598d771bac 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -4,7 +4,7 @@ class derived extends base { } class base { constructor (public n: number) { } } //// [extendBaseClassBeforeItsDeclared.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index 26f0c776dd8..59da2d7ca2b 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -4,7 +4,7 @@ var x = A; class C extends x { } // error, could not find symbol xs //// [extendNonClassSymbol1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js index 4cb7b1787df..830994e3d26 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -6,7 +6,7 @@ var x = new Foo(); // legal, considered a constructor function class C extends Foo {} // error, could not find symbol Foo //// [extendNonClassSymbol2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js index 09280cd224a..0bf86390b74 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -40,7 +40,7 @@ var Model = (function () { })(); exports.Model = Model; //// [extendingClassFromAliasAndUsageInIndexer_moduleA.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -56,7 +56,7 @@ var VisualizationModel = (function (_super) { })(Backbone.Model); exports.VisualizationModel = VisualizationModel; //// [extendingClassFromAliasAndUsageInIndexer_moduleB.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index 820a6910962..3e7151b8e0d 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -7,7 +7,7 @@ class D extends C extends C { } //// [extendsClauseAlreadySeen.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index ad88446c4c4..9ee428c36ed 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -7,7 +7,7 @@ class D extends C extends C { } //// [extendsClauseAlreadySeen2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt index f061276aa1a..64874c767ee 100644 --- a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt +++ b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts(3,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts(3,17): error TS1148: // Not on line 0 because we want to verify the error is placed in the appropriate location. export module M { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. } \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 3db07d878bf..749c7b47b34 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -81,7 +81,7 @@ for (var x in Color.Blue) { } //// [for-inStatements.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js index 6d42a550a01..e1806272790 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -64,7 +64,7 @@ for (var x in i[42]) { } //// [for-inStatementsInvalid.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/for-of13.symbols b/tests/baselines/reference/for-of13.symbols index c9d3c4d254c..833ea1d6875 100644 --- a/tests/baselines/reference/for-of13.symbols +++ b/tests/baselines/reference/for-of13.symbols @@ -4,6 +4,6 @@ var v: string; for (v of [""].values()) { } >v : Symbol(v, Decl(for-of13.ts, 0, 3)) ->[""].values : Symbol(Array.values, Decl(lib.d.ts, 1423, 37)) ->values : Symbol(Array.values, Decl(lib.d.ts, 1423, 37)) +>[""].values : Symbol(Array.values, Decl(lib.d.ts, 1453, 37)) +>values : Symbol(Array.values, Decl(lib.d.ts, 1453, 37)) diff --git a/tests/baselines/reference/for-of18.symbols b/tests/baselines/reference/for-of18.symbols index 180766144c8..2c08338ce73 100644 --- a/tests/baselines/reference/for-of18.symbols +++ b/tests/baselines/reference/for-of18.symbols @@ -23,7 +23,7 @@ class StringIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of19.symbols b/tests/baselines/reference/for-of19.symbols index 5dd58d671a7..6be3c83964a 100644 --- a/tests/baselines/reference/for-of19.symbols +++ b/tests/baselines/reference/for-of19.symbols @@ -28,7 +28,7 @@ class FooIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of20.symbols b/tests/baselines/reference/for-of20.symbols index 50c191a7ac0..97200f93f35 100644 --- a/tests/baselines/reference/for-of20.symbols +++ b/tests/baselines/reference/for-of20.symbols @@ -28,7 +28,7 @@ class FooIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of21.symbols b/tests/baselines/reference/for-of21.symbols index 0fbef87af15..bbe3504294c 100644 --- a/tests/baselines/reference/for-of21.symbols +++ b/tests/baselines/reference/for-of21.symbols @@ -28,7 +28,7 @@ class FooIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of22.symbols b/tests/baselines/reference/for-of22.symbols index 9714f615a79..4f15b541356 100644 --- a/tests/baselines/reference/for-of22.symbols +++ b/tests/baselines/reference/for-of22.symbols @@ -29,7 +29,7 @@ class FooIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of23.symbols b/tests/baselines/reference/for-of23.symbols index 328cb41ad29..0f409605e28 100644 --- a/tests/baselines/reference/for-of23.symbols +++ b/tests/baselines/reference/for-of23.symbols @@ -28,7 +28,7 @@ class FooIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of25.symbols b/tests/baselines/reference/for-of25.symbols index 1a0b660fc1e..44cc83143af 100644 --- a/tests/baselines/reference/for-of25.symbols +++ b/tests/baselines/reference/for-of25.symbols @@ -11,7 +11,7 @@ class StringIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return x; diff --git a/tests/baselines/reference/for-of26.symbols b/tests/baselines/reference/for-of26.symbols index a2c21c95146..0218a8b9995 100644 --- a/tests/baselines/reference/for-of26.symbols +++ b/tests/baselines/reference/for-of26.symbols @@ -17,7 +17,7 @@ class StringIterator { } [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of27.symbols b/tests/baselines/reference/for-of27.symbols index e03b580551d..82918a19986 100644 --- a/tests/baselines/reference/for-of27.symbols +++ b/tests/baselines/reference/for-of27.symbols @@ -8,6 +8,6 @@ class StringIterator { [Symbol.iterator]: any; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) } diff --git a/tests/baselines/reference/for-of28.symbols b/tests/baselines/reference/for-of28.symbols index 9d6b912bd94..e4324b05779 100644 --- a/tests/baselines/reference/for-of28.symbols +++ b/tests/baselines/reference/for-of28.symbols @@ -11,7 +11,7 @@ class StringIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/for-of31.errors.txt b/tests/baselines/reference/for-of31.errors.txt index 74afff00e99..6d5f6e816be 100644 --- a/tests/baselines/reference/for-of31.errors.txt +++ b/tests/baselines/reference/for-of31.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Ty Type '() => StringIterator' is not assignable to type '() => Iterator'. Type 'StringIterator' is not assignable to type 'Iterator'. Types of property 'next' are incompatible. - Type '() => { value: string; }' is not assignable to type '() => IteratorResult'. + Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. Type '{ value: string; }' is not assignable to type 'IteratorResult'. Property 'done' is missing in type '{ value: string; }'. @@ -16,7 +16,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Ty !!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator'. !!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator'. !!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '() => { value: string; }' is not assignable to type '() => IteratorResult'. +!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult'. !!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult'. !!! error TS2322: Property 'done' is missing in type '{ value: string; }'. diff --git a/tests/baselines/reference/for-of33.errors.txt b/tests/baselines/reference/for-of33.errors.txt index 1c631042d7d..cd2d48566ab 100644 --- a/tests/baselines/reference/for-of33.errors.txt +++ b/tests/baselines/reference/for-of33.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/es6/for-ofStatements/for-of33.ts(1,10): error TS7022: 'v' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. +tests/cases/conformance/es6/for-ofStatements/for-of33.ts(4,5): error TS7023: '[Symbol.iterator]' 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. -==== tests/cases/conformance/es6/for-ofStatements/for-of33.ts (1 errors) ==== +==== tests/cases/conformance/es6/for-ofStatements/for-of33.ts (2 errors) ==== for (var v of new StringIterator) { } ~ !!! error TS7022: 'v' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. class StringIterator { [Symbol.iterator]() { + ~~~~~~~~~~~~~~~~~ +!!! error TS7023: '[Symbol.iterator]' 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. return v; } } \ No newline at end of file diff --git a/tests/baselines/reference/for-of34.errors.txt b/tests/baselines/reference/for-of34.errors.txt index 994302db88b..a4f55ed29ba 100644 --- a/tests/baselines/reference/for-of34.errors.txt +++ b/tests/baselines/reference/for-of34.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/es6/for-ofStatements/for-of34.ts(1,10): error TS7022: 'v' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. +tests/cases/conformance/es6/for-ofStatements/for-of34.ts(4,5): error TS7023: 'next' 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. -==== tests/cases/conformance/es6/for-ofStatements/for-of34.ts (1 errors) ==== +==== tests/cases/conformance/es6/for-ofStatements/for-of34.ts (2 errors) ==== for (var v of new StringIterator) { } ~ !!! error TS7022: 'v' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. class StringIterator { next() { + ~~~~ +!!! error TS7023: 'next' 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. return v; } diff --git a/tests/baselines/reference/for-of35.errors.txt b/tests/baselines/reference/for-of35.errors.txt index f83b6d2ec3c..65529752b9b 100644 --- a/tests/baselines/reference/for-of35.errors.txt +++ b/tests/baselines/reference/for-of35.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/es6/for-ofStatements/for-of35.ts(1,10): error TS7022: 'v' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. +tests/cases/conformance/es6/for-ofStatements/for-of35.ts(4,5): error TS7023: 'next' 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. -==== tests/cases/conformance/es6/for-ofStatements/for-of35.ts (1 errors) ==== +==== tests/cases/conformance/es6/for-ofStatements/for-of35.ts (2 errors) ==== for (var v of new StringIterator) { } ~ !!! error TS7022: 'v' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. class StringIterator { next() { + ~~~~ +!!! error TS7023: 'next' 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. return { done: true, value: v diff --git a/tests/baselines/reference/for-of37.symbols b/tests/baselines/reference/for-of37.symbols index 86841971be7..93f6c4f7dd6 100644 --- a/tests/baselines/reference/for-of37.symbols +++ b/tests/baselines/reference/for-of37.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of37.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of37.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) +>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11)) for (var v of map) { >v : Symbol(v, Decl(for-of37.ts, 1, 8)) diff --git a/tests/baselines/reference/for-of38.symbols b/tests/baselines/reference/for-of38.symbols index 5ee81f2eb15..fab42d91724 100644 --- a/tests/baselines/reference/for-of38.symbols +++ b/tests/baselines/reference/for-of38.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of38.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of38.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) +>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11)) for (var [k, v] of map) { >k : Symbol(k, Decl(for-of38.ts, 1, 10)) diff --git a/tests/baselines/reference/for-of40.symbols b/tests/baselines/reference/for-of40.symbols index a9c0b3fbc30..1cd3538f987 100644 --- a/tests/baselines/reference/for-of40.symbols +++ b/tests/baselines/reference/for-of40.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of40.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of40.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) +>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11)) for (var [k = "", v = false] of map) { >k : Symbol(k, Decl(for-of40.ts, 1, 10)) diff --git a/tests/baselines/reference/for-of44.symbols b/tests/baselines/reference/for-of44.symbols index e01aad51d54..9c6afa04adb 100644 --- a/tests/baselines/reference/for-of44.symbols +++ b/tests/baselines/reference/for-of44.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of44.ts === var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] >array : Symbol(array, Decl(for-of44.ts, 0, 3)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) for (var [num, strBoolSym] of array) { >num : Symbol(num, Decl(for-of44.ts, 1, 10)) diff --git a/tests/baselines/reference/for-of45.symbols b/tests/baselines/reference/for-of45.symbols index e86ee110362..9fda4cb4e0a 100644 --- a/tests/baselines/reference/for-of45.symbols +++ b/tests/baselines/reference/for-of45.symbols @@ -5,7 +5,7 @@ var k: string, v: boolean; var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of45.ts, 1, 3)) ->Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) +>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11)) for ([k = "", v = false] of map) { >k : Symbol(k, Decl(for-of45.ts, 0, 3)) diff --git a/tests/baselines/reference/for-of50.symbols b/tests/baselines/reference/for-of50.symbols index 9076f63300e..c176e1aca0c 100644 --- a/tests/baselines/reference/for-of50.symbols +++ b/tests/baselines/reference/for-of50.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of50.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of50.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) +>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11)) for (const [k, v] of map) { >k : Symbol(k, Decl(for-of50.ts, 1, 12)) diff --git a/tests/baselines/reference/for-of57.symbols b/tests/baselines/reference/for-of57.symbols index 60e87b25587..27aed0777ba 100644 --- a/tests/baselines/reference/for-of57.symbols +++ b/tests/baselines/reference/for-of57.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of57.ts === var iter: Iterable; >iter : Symbol(iter, Decl(for-of57.ts, 0, 3)) ->Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1663, 1)) for (let num of iter) { } >num : Symbol(num, Decl(for-of57.ts, 1, 8)) diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index 2282136be3a..b00e8acef14 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -54,7 +54,7 @@ for(var m: typeof M;;){} for( var m = M.A;;){} //// [forStatementsMultipleInvalidDecl.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.js b/tests/baselines/reference/functionExpressionContextualTyping1.js new file mode 100644 index 00000000000..8d60572b30f --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping1.js @@ -0,0 +1,120 @@ +//// [functionExpressionContextualTyping1.ts] +// When a function expression with no type parameters and no parameter type annotations +// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T + +enum E { red, blue } + +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. + +var a0: (n: number, s: string) => number = (num, str) => { + num.toExponential(); + return 0; +} + +class Class { + foo() { } +} + +var a1: (c: Class) => number = (a1) => { + a1.foo(); + return 1; +} + +// A contextual signature S is extracted from a function type T as follows: +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, +// then S is a signature with the same parameters and a union of the return types. +var b1: ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string); +b1 = (k, h) => { }; +var b2: typeof a0 | ((n: number, s: string) => string); +b2 = (foo, bar) => { return foo + 1; } +b2 = (foo, bar) => { return "hello"; } +var b3: (name: string, num: number, boo: boolean) => void; +b3 = (name, number) => { }; + +var b4: (n: E) => string = (number = 1) => { return "hello"; }; +var b5: (n: {}) => string = (number = "string") => { return "hello"; }; + +// A contextual signature S is extracted from a function type T as follows: +// Otherwise, no contextual signature can be extracted from T and S is undefined. +var b6: ((s: string, w: boolean) => void) | ((n: number) => number); +var b7: ((s: string, w: boolean) => void) | ((s: string, w: number) => string); +b6 = (k) => { k.toLowerCase() }; +b6 = (i) => { + i.toExponential(); + return i; +}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = (j, m) => { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) + +class C { + constructor() { + var k: ((j: T, k: U) => (T|U)[]) | ((j: number,k :U) => number[]) = (j, k) => { + return [j, k]; + } // Per spec, no contextual signature can be extracted in this case. + } +} + +//// [functionExpressionContextualTyping1.js] +// When a function expression with no type parameters and no parameter type annotations +// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T +var E; +(function (E) { + E[E["red"] = 0] = "red"; + E[E["blue"] = 1] = "blue"; +})(E || (E = {})); +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. +var a0 = function (num, str) { + num.toExponential(); + return 0; +}; +var Class = (function () { + function Class() { + } + Class.prototype.foo = function () { }; + return Class; +})(); +var a1 = function (a1) { + a1.foo(); + return 1; +}; +// A contextual signature S is extracted from a function type T as follows: +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, +// then S is a signature with the same parameters and a union of the return types. +var b1; +b1 = function (k, h) { }; +var b2; +b2 = function (foo, bar) { return foo + 1; }; +b2 = function (foo, bar) { return "hello"; }; +var b3; +b3 = function (name, number) { }; +var b4 = function (number) { + if (number === void 0) { number = 1; } + return "hello"; +}; +var b5 = function (number) { + if (number === void 0) { number = "string"; } + return "hello"; +}; +// A contextual signature S is extracted from a function type T as follows: +// Otherwise, no contextual signature can be extracted from T and S is undefined. +var b6; +var b7; +b6 = function (k) { k.toLowerCase(); }; +b6 = function (i) { + i.toExponential(); + return i; +}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = function (j, m) { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +var C = (function () { + function C() { + var k = function (j, k) { + return [j, k]; + }; // Per spec, no contextual signature can be extracted in this case. + } + return C; +})(); diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.symbols b/tests/baselines/reference/functionExpressionContextualTyping1.symbols new file mode 100644 index 00000000000..6182e4bb9a8 --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping1.symbols @@ -0,0 +1,169 @@ +=== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping1.ts === +// When a function expression with no type parameters and no parameter type annotations +// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T + +enum E { red, blue } +>E : Symbol(E, Decl(functionExpressionContextualTyping1.ts, 0, 0)) +>red : Symbol(E.red, Decl(functionExpressionContextualTyping1.ts, 3, 8)) +>blue : Symbol(E.blue, Decl(functionExpressionContextualTyping1.ts, 3, 13)) + +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. + +var a0: (n: number, s: string) => number = (num, str) => { +>a0 : Symbol(a0, Decl(functionExpressionContextualTyping1.ts, 8, 3)) +>n : Symbol(n, Decl(functionExpressionContextualTyping1.ts, 8, 9)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 8, 19)) +>num : Symbol(num, Decl(functionExpressionContextualTyping1.ts, 8, 44)) +>str : Symbol(str, Decl(functionExpressionContextualTyping1.ts, 8, 48)) + + num.toExponential(); +>num.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>num : Symbol(num, Decl(functionExpressionContextualTyping1.ts, 8, 44)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + + return 0; +} + +class Class { +>Class : Symbol(Class, Decl(functionExpressionContextualTyping1.ts, 11, 1)) +>T : Symbol(T, Decl(functionExpressionContextualTyping1.ts, 13, 12)) + + foo() { } +>foo : Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 13, 16)) +} + +var a1: (c: Class) => number = (a1) => { +>a1 : Symbol(a1, Decl(functionExpressionContextualTyping1.ts, 17, 3)) +>c : Symbol(c, Decl(functionExpressionContextualTyping1.ts, 17, 9)) +>Class : Symbol(Class, Decl(functionExpressionContextualTyping1.ts, 11, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>a1 : Symbol(a1, Decl(functionExpressionContextualTyping1.ts, 17, 40)) + + a1.foo(); +>a1.foo : Symbol(Class.foo, Decl(functionExpressionContextualTyping1.ts, 13, 16)) +>a1 : Symbol(a1, Decl(functionExpressionContextualTyping1.ts, 17, 40)) +>foo : Symbol(Class.foo, Decl(functionExpressionContextualTyping1.ts, 13, 16)) + + return 1; +} + +// A contextual signature S is extracted from a function type T as follows: +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, +// then S is a signature with the same parameters and a union of the return types. +var b1: ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string); +>b1 : Symbol(b1, Decl(functionExpressionContextualTyping1.ts, 27, 3)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 27, 10)) +>w : Symbol(w, Decl(functionExpressionContextualTyping1.ts, 27, 20)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 27, 46)) +>w : Symbol(w, Decl(functionExpressionContextualTyping1.ts, 27, 56)) + +b1 = (k, h) => { }; +>b1 : Symbol(b1, Decl(functionExpressionContextualTyping1.ts, 27, 3)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 28, 6)) +>h : Symbol(h, Decl(functionExpressionContextualTyping1.ts, 28, 8)) + +var b2: typeof a0 | ((n: number, s: string) => string); +>b2 : Symbol(b2, Decl(functionExpressionContextualTyping1.ts, 29, 3)) +>a0 : Symbol(a0, Decl(functionExpressionContextualTyping1.ts, 8, 3)) +>n : Symbol(n, Decl(functionExpressionContextualTyping1.ts, 29, 22)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 29, 32)) + +b2 = (foo, bar) => { return foo + 1; } +>b2 : Symbol(b2, Decl(functionExpressionContextualTyping1.ts, 29, 3)) +>foo : Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 30, 6)) +>bar : Symbol(bar, Decl(functionExpressionContextualTyping1.ts, 30, 10)) +>foo : Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 30, 6)) + +b2 = (foo, bar) => { return "hello"; } +>b2 : Symbol(b2, Decl(functionExpressionContextualTyping1.ts, 29, 3)) +>foo : Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 31, 6)) +>bar : Symbol(bar, Decl(functionExpressionContextualTyping1.ts, 31, 10)) + +var b3: (name: string, num: number, boo: boolean) => void; +>b3 : Symbol(b3, Decl(functionExpressionContextualTyping1.ts, 32, 3)) +>name : Symbol(name, Decl(functionExpressionContextualTyping1.ts, 32, 9)) +>num : Symbol(num, Decl(functionExpressionContextualTyping1.ts, 32, 22)) +>boo : Symbol(boo, Decl(functionExpressionContextualTyping1.ts, 32, 35)) + +b3 = (name, number) => { }; +>b3 : Symbol(b3, Decl(functionExpressionContextualTyping1.ts, 32, 3)) +>name : Symbol(name, Decl(functionExpressionContextualTyping1.ts, 33, 6)) +>number : Symbol(number, Decl(functionExpressionContextualTyping1.ts, 33, 11)) + +var b4: (n: E) => string = (number = 1) => { return "hello"; }; +>b4 : Symbol(b4, Decl(functionExpressionContextualTyping1.ts, 35, 3)) +>n : Symbol(n, Decl(functionExpressionContextualTyping1.ts, 35, 9)) +>E : Symbol(E, Decl(functionExpressionContextualTyping1.ts, 0, 0)) +>number : Symbol(number, Decl(functionExpressionContextualTyping1.ts, 35, 28)) + +var b5: (n: {}) => string = (number = "string") => { return "hello"; }; +>b5 : Symbol(b5, Decl(functionExpressionContextualTyping1.ts, 36, 3)) +>n : Symbol(n, Decl(functionExpressionContextualTyping1.ts, 36, 9)) +>number : Symbol(number, Decl(functionExpressionContextualTyping1.ts, 36, 29)) + +// A contextual signature S is extracted from a function type T as follows: +// Otherwise, no contextual signature can be extracted from T and S is undefined. +var b6: ((s: string, w: boolean) => void) | ((n: number) => number); +>b6 : Symbol(b6, Decl(functionExpressionContextualTyping1.ts, 40, 3)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 40, 10)) +>w : Symbol(w, Decl(functionExpressionContextualTyping1.ts, 40, 20)) +>n : Symbol(n, Decl(functionExpressionContextualTyping1.ts, 40, 46)) + +var b7: ((s: string, w: boolean) => void) | ((s: string, w: number) => string); +>b7 : Symbol(b7, Decl(functionExpressionContextualTyping1.ts, 41, 3)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 41, 10)) +>w : Symbol(w, Decl(functionExpressionContextualTyping1.ts, 41, 20)) +>s : Symbol(s, Decl(functionExpressionContextualTyping1.ts, 41, 46)) +>w : Symbol(w, Decl(functionExpressionContextualTyping1.ts, 41, 56)) + +b6 = (k) => { k.toLowerCase() }; +>b6 : Symbol(b6, Decl(functionExpressionContextualTyping1.ts, 40, 3)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 42, 6)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 42, 6)) + +b6 = (i) => { +>b6 : Symbol(b6, Decl(functionExpressionContextualTyping1.ts, 40, 3)) +>i : Symbol(i, Decl(functionExpressionContextualTyping1.ts, 43, 6)) + + i.toExponential(); +>i : Symbol(i, Decl(functionExpressionContextualTyping1.ts, 43, 6)) + + return i; +>i : Symbol(i, Decl(functionExpressionContextualTyping1.ts, 43, 6)) + +}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = (j, m) => { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +>b7 : Symbol(b7, Decl(functionExpressionContextualTyping1.ts, 41, 3)) +>j : Symbol(j, Decl(functionExpressionContextualTyping1.ts, 47, 6)) +>m : Symbol(m, Decl(functionExpressionContextualTyping1.ts, 47, 8)) + +class C { +>C : Symbol(C, Decl(functionExpressionContextualTyping1.ts, 47, 19)) +>T : Symbol(T, Decl(functionExpressionContextualTyping1.ts, 49, 8)) +>U : Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10)) + + constructor() { + var k: ((j: T, k: U) => (T|U)[]) | ((j: number,k :U) => number[]) = (j, k) => { +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 11)) +>j : Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 17)) +>T : Symbol(T, Decl(functionExpressionContextualTyping1.ts, 49, 8)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 22)) +>U : Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10)) +>T : Symbol(T, Decl(functionExpressionContextualTyping1.ts, 49, 8)) +>U : Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10)) +>j : Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 45)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 55)) +>U : Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10)) +>j : Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 77)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 79)) + + return [j, k]; +>j : Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 77)) +>k : Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 79)) + + } // Per spec, no contextual signature can be extracted in this case. + } +} diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.types b/tests/baselines/reference/functionExpressionContextualTyping1.types new file mode 100644 index 00000000000..61d16bf6a4f --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping1.types @@ -0,0 +1,206 @@ +=== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping1.ts === +// When a function expression with no type parameters and no parameter type annotations +// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T + +enum E { red, blue } +>E : E +>red : E +>blue : E + +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. + +var a0: (n: number, s: string) => number = (num, str) => { +>a0 : (n: number, s: string) => number +>n : number +>s : string +>(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => number +>num : number +>str : string + + num.toExponential(); +>num.toExponential() : string +>num.toExponential : (fractionDigits?: number) => string +>num : number +>toExponential : (fractionDigits?: number) => string + + return 0; +>0 : number +} + +class Class { +>Class : Class +>T : T + + foo() { } +>foo : () => void +} + +var a1: (c: Class) => number = (a1) => { +>a1 : (c: Class) => number +>c : Class +>Class : Class +>Number : Number +>(a1) => { a1.foo(); return 1;} : (a1: Class) => number +>a1 : Class + + a1.foo(); +>a1.foo() : void +>a1.foo : () => void +>a1 : Class +>foo : () => void + + return 1; +>1 : number +} + +// A contextual signature S is extracted from a function type T as follows: +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, +// then S is a signature with the same parameters and a union of the return types. +var b1: ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string); +>b1 : ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string) +>s : string +>w : boolean +>s : string +>w : boolean + +b1 = (k, h) => { }; +>b1 = (k, h) => { } : (k: string, h: boolean) => void +>b1 : ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string) +>(k, h) => { } : (k: string, h: boolean) => void +>k : string +>h : boolean + +var b2: typeof a0 | ((n: number, s: string) => string); +>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string) +>a0 : (n: number, s: string) => number +>n : number +>s : string + +b2 = (foo, bar) => { return foo + 1; } +>b2 = (foo, bar) => { return foo + 1; } : (foo: number, bar: string) => number +>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string) +>(foo, bar) => { return foo + 1; } : (foo: number, bar: string) => number +>foo : number +>bar : string +>foo + 1 : number +>foo : number +>1 : number + +b2 = (foo, bar) => { return "hello"; } +>b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string +>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string) +>(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string +>foo : number +>bar : string +>"hello" : string + +var b3: (name: string, num: number, boo: boolean) => void; +>b3 : (name: string, num: number, boo: boolean) => void +>name : string +>num : number +>boo : boolean + +b3 = (name, number) => { }; +>b3 = (name, number) => { } : (name: string, number: number) => void +>b3 : (name: string, num: number, boo: boolean) => void +>(name, number) => { } : (name: string, number: number) => void +>name : string +>number : number + +var b4: (n: E) => string = (number = 1) => { return "hello"; }; +>b4 : (n: E) => string +>n : E +>E : E +>(number = 1) => { return "hello"; } : (number?: E) => string +>number : E +>1 : number +>"hello" : string + +var b5: (n: {}) => string = (number = "string") => { return "hello"; }; +>b5 : (n: {}) => string +>n : {} +>(number = "string") => { return "hello"; } : (number?: {}) => string +>number : {} +>"string" : string +>"hello" : string + +// A contextual signature S is extracted from a function type T as follows: +// Otherwise, no contextual signature can be extracted from T and S is undefined. +var b6: ((s: string, w: boolean) => void) | ((n: number) => number); +>b6 : ((s: string, w: boolean) => void) | ((n: number) => number) +>s : string +>w : boolean +>n : number + +var b7: ((s: string, w: boolean) => void) | ((s: string, w: number) => string); +>b7 : ((s: string, w: boolean) => void) | ((s: string, w: number) => string) +>s : string +>w : boolean +>s : string +>w : number + +b6 = (k) => { k.toLowerCase() }; +>b6 = (k) => { k.toLowerCase() } : (k: any) => void +>b6 : ((s: string, w: boolean) => void) | ((n: number) => number) +>(k) => { k.toLowerCase() } : (k: any) => void +>k : any +>k.toLowerCase() : any +>k.toLowerCase : any +>k : any +>toLowerCase : any + +b6 = (i) => { +>b6 = (i) => { i.toExponential(); return i;} : (i: any) => any +>b6 : ((s: string, w: boolean) => void) | ((n: number) => number) +>(i) => { i.toExponential(); return i;} : (i: any) => any +>i : any + + i.toExponential(); +>i.toExponential() : any +>i.toExponential : any +>i : any +>toExponential : any + + return i; +>i : any + +}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = (j, m) => { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +>b7 = (j, m) => { } : (j: any, m: any) => void +>b7 : ((s: string, w: boolean) => void) | ((s: string, w: number) => string) +>(j, m) => { } : (j: any, m: any) => void +>j : any +>m : any + +class C { +>C : C +>T : T +>U : U + + constructor() { + var k: ((j: T, k: U) => (T|U)[]) | ((j: number,k :U) => number[]) = (j, k) => { +>k : ((j: T, k: U) => (T | U)[]) | ((j: number, k: U) => number[]) +>j : T +>T : T +>k : U +>U : U +>T : T +>U : U +>j : number +>k : U +>U : U +>(j, k) => { return [j, k]; } : (j: any, k: any) => any[] +>j : any +>k : any + + return [j, k]; +>[j, k] : any[] +>j : any +>k : any + + } // Per spec, no contextual signature can be extracted in this case. + } +} diff --git a/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt new file mode 100644 index 00000000000..6a3a7998f09 --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts(11,1): error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. + Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'. + Type 'boolean' is not assignable to type 'string'. + + +==== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts (1 errors) ==== + // A contextual signature S is extracted from a function type T as follows: + // If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. + // If T is a union type, let U be the set of element types in T that have call signatures. + // If each type in U has exactly one call signature and that call signature is non- generic, + // and if all of the signatures are identical ignoring return types, then S is a signature + // with the same parameters and a union of the return types. + // Otherwise, no contextual signature can be extracted from T and S is undefined. + + var a0: (n: number, s: string) => number + var a1: typeof a0 | ((n: number, s: string) => string); + a1 = (foo, bar) => { return true; } // Error + ~~ +!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'. +!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionExpressionContextualTyping2.js b/tests/baselines/reference/functionExpressionContextualTyping2.js new file mode 100644 index 00000000000..dae30a79036 --- /dev/null +++ b/tests/baselines/reference/functionExpressionContextualTyping2.js @@ -0,0 +1,24 @@ +//// [functionExpressionContextualTyping2.ts] +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, then S is a signature +// with the same parameters and a union of the return types. +// Otherwise, no contextual signature can be extracted from T and S is undefined. + +var a0: (n: number, s: string) => number +var a1: typeof a0 | ((n: number, s: string) => string); +a1 = (foo, bar) => { return true; } // Error + +//// [functionExpressionContextualTyping2.js] +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, then S is a signature +// with the same parameters and a union of the return types. +// Otherwise, no contextual signature can be extracted from T and S is undefined. +var a0; +var a1; +a1 = function (foo, bar) { return true; }; // Error diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 5eaf9027335..6c1daffdaf1 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -74,7 +74,7 @@ var f13 = () => { //// [functionImplementationErrors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index c478f892fd5..0370c4c0027 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -157,7 +157,7 @@ var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherC } //// [functionImplementations.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index c527ca9696a..b0168975677 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -15,7 +15,7 @@ class StringEvent extends EventBase { // should work //// [functionSubtypingOfVarArgs.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.js b/tests/baselines/reference/functionSubtypingOfVarArgs2.js index e11c03404a9..7efd35cc2d2 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -15,7 +15,7 @@ class StringEvent extends EventBase { //// [functionSubtypingOfVarArgs2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt b/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt index 1fc68fff709..02aa57937ba 100644 --- a/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt +++ b/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/funduleSplitAcrossFiles_module.ts(1,8): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/compiler/funduleSplitAcrossFiles_module.ts(1,8): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged ==== tests/cases/compiler/funduleSplitAcrossFiles_function.ts (0 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/funduleSplitAcrossFiles_module.ts(1,8): error TS2433: A mod ==== tests/cases/compiler/funduleSplitAcrossFiles_module.ts (1 errors) ==== module D { ~ -!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged export var y = "hi"; } D.y; \ No newline at end of file diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index a88929669fd..3c2c704ddb0 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -355,7 +355,7 @@ var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; retur var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); //// [generatedContextualTyping.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericArrayExtenstions.errors.txt b/tests/baselines/reference/genericArrayExtenstions.errors.txt index e3004eb2838..f3035497910 100644 --- a/tests/baselines/reference/genericArrayExtenstions.errors.txt +++ b/tests/baselines/reference/genericArrayExtenstions.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. Property 'length' is missing in type 'ObservableArray'. @@ -6,7 +6,7 @@ tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2420: Class 'Obse ==== tests/cases/compiler/genericArrayExtenstions.ts (2 errors) ==== export declare class ObservableArray implements Array { // MS.Entertainment.ObservableArray ~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~~~~~~~~~ !!! error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. !!! error TS2420: Property 'length' is missing in type 'ObservableArray'. diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index bde7fa69302..5e365531461 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -13,7 +13,7 @@ class SubClass extends BaseClass { } //// [genericBaseClassLiteralProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js index f558f424302..8a19d857bb6 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -16,7 +16,7 @@ class DataView2 extends BaseCollection2 { //// [genericBaseClassLiteralProperty2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js index be6ef0e4124..f00468dcbc5 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -109,7 +109,7 @@ var r11 = i.foo8(); // Base //// [genericCallWithConstraintsTypeArgumentInference.js] // Basic type inference with generic calls and constraints, no errors expected -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 3a72feff979..910e3860b49 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -33,7 +33,7 @@ var i: I; var r4 = f2(i); // Base => Derived //// [genericCallWithObjectTypeArgs2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index c1f0945ba10..9cb2425f9d0 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -41,7 +41,7 @@ var r7 = f3(null, x => x); // any //// [genericCallWithObjectTypeArgsAndConstraints2.js] // Generic call with constraints infering type parameter from object member properties // No errors expected -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index b9c722f80be..3c5a4c24b53 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -39,7 +39,7 @@ var r6 = f3(x => x, null); //// [genericCallWithObjectTypeArgsAndConstraints3.js] // Generic call with constraints infering type parameter from object member properties -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index e63c7a98272..16abb2683e7 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -24,7 +24,7 @@ module M { } //// [genericCallbacksAndClassHierarchy.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index 489ecd0f059..22bb975e7d7 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -6,7 +6,7 @@ class C { } //// [genericClassInheritsConstructorFromNonGenericClass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 4f26e35d1b0..43d1e53a615 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -76,7 +76,7 @@ class ViewModel implements Contract { //// [genericClassPropertyInheritanceSpecialization.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js index 71dafd8ee8b..23e1874c0ed 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -11,7 +11,7 @@ class Bar extends Foo { //// [genericClassStaticMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 621142c2e9a..373052d78e3 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -18,7 +18,7 @@ var z = v2.b; //// [genericClasses3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index e2babf511b4..561c24cd50e 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -27,7 +27,7 @@ module EndGate.Tweening { } //// [genericConstraintOnExtendedBuiltinTypes.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index ccbbf9d11a6..2420e082e3d 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -26,7 +26,7 @@ module EndGate.Tweening { } //// [genericConstraintOnExtendedBuiltinTypes2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index 7f639415490..69ae509bf54 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -13,7 +13,7 @@ x = y; // error //// [genericDerivedTypeWithSpecializedBase.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 4b28d4b7f1c..1c4f27b5ebe 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -13,7 +13,7 @@ x = y; // error //// [genericDerivedTypeWithSpecializedBase2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index 9a48ef679dc..b91b345481e 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -16,7 +16,7 @@ class MyEventWrapper extends BaseEventWrapper { } //// [genericPrototypeProperty2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index 522b3a11e1b..de093886ea4 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -15,7 +15,7 @@ class MyEventWrapper extends BaseEventWrapper { } //// [genericPrototypeProperty3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index 4d5c6810f75..b73239626d0 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -27,7 +27,7 @@ module TypeScript2 { //// [genericRecursiveImplicitConstructorErrors2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index e01c9045345..0d4a3315acd 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -31,7 +31,7 @@ module TypeScript { //// [genericRecursiveImplicitConstructorErrors3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 3c904c7a30e..a3b88f599b9 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -14,7 +14,7 @@ var r4: A = >new A(); var r5: A = >[]; // error //// [genericTypeAssertions2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index a607fb07428..95ca5482b2e 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -26,7 +26,7 @@ function foo2(x: T) { } //// [genericTypeAssertions4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js index d6061d8cf0a..d19da506680 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -25,7 +25,7 @@ var b: B; var c: A = >b; //// [genericTypeAssertions6.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 4be1cce27a9..5ec0a25af3d 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -40,7 +40,7 @@ var k = null; //// [genericTypeReferenceWithoutTypeArgument.js] // it is an error to use a generic type without type arguments // all of these are errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 803d499705a..2f36a74de76 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -40,7 +40,7 @@ var k = null; //// [genericTypeReferenceWithoutTypeArgument2.js] // it is an error to use a generic type without type arguments // all of these are errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index fdd2e470a55..8142cd86407 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -15,7 +15,7 @@ export class ListItem extends CollectionItem { //// [genericWithIndexerOfTypeParameterType2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt b/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt new file mode 100644 index 00000000000..5b076b078c5 --- /dev/null +++ b/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt @@ -0,0 +1,31 @@ +tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts(8,16): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts (1 errors) ==== + // In the body of a get accessor with no return type annotation, + // if a matching set accessor exists and that set accessor has a parameter type annotation, + // return expressions are contextually typed by the type given in the set accessor's parameter type annotation. + + class C { + set X(x: number) { } + get X() { + return "string"; // Error; get contextual type by set accessor parameter type annotation + ~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + } + + set Y(y) { } + get Y() { + return true; + } + + set W(w) { } + get W(): boolean { + return true; + } + + set Z(z: number) { } + get Z() { + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/getSetAccessorContextualTyping.js b/tests/baselines/reference/getSetAccessorContextualTyping.js new file mode 100644 index 00000000000..d1415e1d4e7 --- /dev/null +++ b/tests/baselines/reference/getSetAccessorContextualTyping.js @@ -0,0 +1,68 @@ +//// [getSetAccessorContextualTyping.ts] +// In the body of a get accessor with no return type annotation, +// if a matching set accessor exists and that set accessor has a parameter type annotation, +// return expressions are contextually typed by the type given in the set accessor's parameter type annotation. + +class C { + set X(x: number) { } + get X() { + return "string"; // Error; get contextual type by set accessor parameter type annotation + } + + set Y(y) { } + get Y() { + return true; + } + + set W(w) { } + get W(): boolean { + return true; + } + + set Z(z: number) { } + get Z() { + return 1; + } +} + +//// [getSetAccessorContextualTyping.js] +// In the body of a get accessor with no return type annotation, +// if a matching set accessor exists and that set accessor has a parameter type annotation, +// return expressions are contextually typed by the type given in the set accessor's parameter type annotation. +var C = (function () { + function C() { + } + Object.defineProperty(C.prototype, "X", { + get: function () { + return "string"; // Error; get contextual type by set accessor parameter type annotation + }, + set: function (x) { }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "Y", { + get: function () { + return true; + }, + set: function (y) { }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "W", { + get: function () { + return true; + }, + set: function (w) { }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C.prototype, "Z", { + get: function () { + return 1; + }, + set: function (z) { }, + enumerable: true, + configurable: true + }); + return C; +})(); diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index 4ac929305c0..26d1b09a6fc 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -133,7 +133,7 @@ function foo4(t: T, u: U) { //// [heterogeneousArrayLiterals.js] // type of an array is the best common type of its elements (plus its contextual type if it exists) -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index 793094584bf..d389f705707 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -163,7 +163,7 @@ do { }while(fn) //// [ifDoWhileStatements.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 0bdcebed9c5..57a382fe625 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -21,7 +21,7 @@ class Derived extends Base { } //// [illegalSuperCallsInConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index e8f0b96f485..7501c231dc8 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -3,7 +3,7 @@ class C { foo: number } class D implements C extends C { } //// [implementClausePrecedingExtends.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index 767851fd16d..3d80d344850 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -86,7 +86,7 @@ module M2 { } //// [implementingAnInterfaceExtendingClassWithPrivates2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index 1a79496bd12..1fa40bf7aa2 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -42,7 +42,7 @@ class Bar8 extends Foo implements I { //// [implementingAnInterfaceExtendingClassWithProtecteds.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt b/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt index 18292c635e6..8d0aaf04c03 100644 --- a/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt +++ b/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt @@ -1,31 +1,35 @@ -tests/cases/compiler/implicitAnyFromCircularInference.ts(3,5): error TS7021: 'a' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. -tests/cases/compiler/implicitAnyFromCircularInference.ts(7,5): error TS7021: 'c' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. -tests/cases/compiler/implicitAnyFromCircularInference.ts(10,5): error TS7021: 'd' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(3,5): error TS2502: 'a' is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(6,5): error TS2502: 'b' is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(7,5): error TS2502: 'c' is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(10,5): error TS2502: 'd' is referenced directly or indirectly in its own type annotation. tests/cases/compiler/implicitAnyFromCircularInference.ts(15,10): error TS7023: 'g' 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. tests/cases/compiler/implicitAnyFromCircularInference.ts(18,10): error TS7024: Function 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. tests/cases/compiler/implicitAnyFromCircularInference.ts(23,10): error TS7024: Function 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. tests/cases/compiler/implicitAnyFromCircularInference.ts(26,10): error TS7023: 'h' 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. +tests/cases/compiler/implicitAnyFromCircularInference.ts(28,14): error TS7023: 'foo' 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. tests/cases/compiler/implicitAnyFromCircularInference.ts(41,5): error TS7022: 's' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. tests/cases/compiler/implicitAnyFromCircularInference.ts(46,5): error TS7023: 'x' 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. -==== tests/cases/compiler/implicitAnyFromCircularInference.ts (9 errors) ==== +==== tests/cases/compiler/implicitAnyFromCircularInference.ts (11 errors) ==== // Error expected var a: typeof a; ~ -!!! error TS7021: 'a' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +!!! error TS2502: 'a' is referenced directly or indirectly in its own type annotation. // Error expected on b or c var b: typeof c; + ~ +!!! error TS2502: 'b' is referenced directly or indirectly in its own type annotation. var c: typeof b; ~ -!!! error TS7021: 'c' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +!!! error TS2502: 'c' is referenced directly or indirectly in its own type annotation. // Error expected var d: Array; ~ -!!! error TS7021: 'd' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +!!! error TS2502: 'd' is referenced directly or indirectly in its own type annotation. function f() { return f; } @@ -52,6 +56,8 @@ tests/cases/compiler/implicitAnyFromCircularInference.ts(46,5): error TS7023: 'x !!! error TS7023: 'h' 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. return foo(); function foo() { + ~~~ +!!! error TS7023: 'foo' 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. return h() || "hello"; } } diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt index abd9ee65196..d12854648e5 100644 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts(1,15): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts (0 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts( ==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts (1 errors) ==== export module m { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export function foo() { } } \ No newline at end of file diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index 8114e88ca4b..24f7e0477d6 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -19,7 +19,7 @@ var Greeter = (function () { })(); exports.Greeter = Greeter; //// [importAsBaseClass_1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt index 7603a694348..e46ff8bea13 100644 --- a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find external module 'externalModule'. -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find external module 'externalModule'. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. +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. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find module 'externalModule'. ==== tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts (4 errors) ==== import b = require("externalModule"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'externalModule'. +!!! error TS2307: Cannot find module 'externalModule'. declare module "m1" { ~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. import im2 = require("externalModule"); ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'externalModule'. +!!! error TS2307: Cannot find module 'externalModule'. } \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index 56da8354977..13991aea7f7 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2305: Module 'x' has no exported member 'c'. @@ -10,7 +10,7 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2305: Modul } declare export import a = x.c; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~ diff --git a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt index e8e9de076ad..1f31509147f 100644 --- a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt +++ b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/importDeclarationInModuleDeclaration1.ts(2,25): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/importDeclarationInModuleDeclaration1.ts(2,25): error TS1147: Import declarations in a namespace cannot reference a module. ==== tests/cases/compiler/importDeclarationInModuleDeclaration1.ts (1 errors) ==== module m2 { import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } \ No newline at end of file diff --git a/tests/baselines/reference/importInsideModule.errors.txt b/tests/baselines/reference/importInsideModule.errors.txt index efe9b78125f..fcf82bd2494 100644 --- a/tests/baselines/reference/importInsideModule.errors.txt +++ b/tests/baselines/reference/importInsideModule.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS2307: Cannot find external module 'importInsideModule_file1'. +tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS2307: Cannot find module 'importInsideModule_file1'. ==== tests/cases/compiler/importInsideModule_file2.ts (2 errors) ==== export module myModule { import foo = require("importInsideModule_file1"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'importInsideModule_file1'. +!!! error TS2307: Cannot find module 'importInsideModule_file1'. var a = foo.x; } ==== tests/cases/compiler/importInsideModule_file1.ts (0 errors) ==== diff --git a/tests/baselines/reference/importNonExternalModule.errors.txt b/tests/baselines/reference/importNonExternalModule.errors.txt index bce2c86d0f0..fb8294c5c03 100644 --- a/tests/baselines/reference/importNonExternalModule.errors.txt +++ b/tests/baselines/reference/importNonExternalModule.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2306: File 'tests/cases/conformance/externalModules/foo_0.ts' is not an external module. +tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2306: File 'tests/cases/conformance/externalModules/foo_0.ts' is not a module. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); ~~~~~~~~~ -!!! error TS2306: File 'foo_0.ts' is not an external module. +!!! error TS2306: File 'foo_0.ts' is not a module. // Import should fail. foo_0 not an external module if(foo.answer === 42){ diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js index 0f673097dc2..6db46eb41b1 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -20,7 +20,7 @@ define(["require", "exports"], function (require, exports) { return Foo; }); //// [Bar.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index 3c9f296d2c2..3e07ee084f3 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -19,7 +19,7 @@ var Super = (function () { })(); exports.Super = Super; //// [importUsedInExtendsList1_1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt index 8948c67f78b..aed680b89aa 100644 --- a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt +++ b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/importedModuleAddToGlobal.ts(15,23): error TS2304: Cannot find name 'b'. +tests/cases/compiler/importedModuleAddToGlobal.ts(15,23): error TS2503: Cannot find namespace 'b'. ==== tests/cases/compiler/importedModuleAddToGlobal.ts (1 errors) ==== @@ -18,5 +18,5 @@ tests/cases/compiler/importedModuleAddToGlobal.ts(15,23): error TS2304: Cannot f import a = A; function hello(): b.B { return null; } ~ -!!! error TS2304: Cannot find name 'b'. +!!! error TS2503: Cannot find namespace 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js index df5dbf22f35..7d3966688db 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -29,7 +29,7 @@ class K extends J { } //// [indexerConstraints2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index eb5503c4db9..3652d2962d0 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -3,7 +3,7 @@ class a extends b{ } class b extends a{ } //// [indirectSelfReference.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index eb861bcf294..079a37dc201 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -3,7 +3,7 @@ class a extends b { } class b extends a { } //// [indirectSelfReferenceGeneric.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index cc80c0b43ce..71390b03c83 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -25,7 +25,7 @@ o(A); //// [infinitelyExpandingTypesNonGenericBase.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index 8611563af69..ccf445a26bf 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -3,7 +3,7 @@ class C extends T { } interface I extends T { } //// [inheritFromGenericTypeParameter.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index b201108a7e2..850741c3666 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -11,7 +11,7 @@ interface A extends C, C2 { // ok } //// [inheritSameNamePrivatePropertiesFromSameOrigin.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index f7a274b1990..f2b5be9335e 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -35,7 +35,7 @@ class Baad extends Good { //// [inheritance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js index f00a46922bf..e0d4fa974c5 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -62,7 +62,7 @@ l1 = sc; l1 = c; //// [inheritance1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index 4544df2dcf2..0f016233ef3 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -11,7 +11,7 @@ class C extends B { //// [inheritanceGrandParentPrivateMemberCollision.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index df6e5943173..596982a4794 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -11,7 +11,7 @@ class C extends B { //// [inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index 682a8ab4402..ec8ae03b3e3 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -11,7 +11,7 @@ class C extends B { //// [inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js index d1eb53c4ec7..2da2bcbe6fe 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -18,7 +18,7 @@ class b extends a { } //// [inheritanceMemberAccessorOverridingAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js index d234eb89582..8b58a7f2b35 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -15,7 +15,7 @@ class b extends a { } //// [inheritanceMemberAccessorOverridingMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js index b307f3bfedb..1864e62b237 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -13,7 +13,7 @@ class b extends a { } //// [inheritanceMemberAccessorOverridingProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js index e05ed9633cc..0b24db92a35 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -15,7 +15,7 @@ class b extends a { } //// [inheritanceMemberFuncOverridingAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js index 747a56b3b3b..bf1186a5cde 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -12,7 +12,7 @@ class b extends a { } //// [inheritanceMemberFuncOverridingMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js index 1f33f0dfb07..2ecf7edb0e8 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -10,7 +10,7 @@ class b extends a { } //// [inheritanceMemberFuncOverridingProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js index 7d92b494416..512ca023dee 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -14,7 +14,7 @@ class b extends a { } //// [inheritanceMemberPropertyOverridingAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index cf0f4b0b58c..975727031e3 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -10,7 +10,7 @@ class b extends a { } //// [inheritanceMemberPropertyOverridingMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index 8cfd68eb30d..b924932e0b4 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -8,7 +8,7 @@ class b extends a { } //// [inheritanceMemberPropertyOverridingProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index 7c1eb291327..d62c62410b7 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -8,7 +8,7 @@ var b3 = new B(); // error, could not select overload for 'new' expression //// [inheritanceOfGenericConstructorMethod1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index 0db872e52dd..c54f8b4d317 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -15,7 +15,7 @@ var n3 = new N.D2(); // no error, D2 //// [inheritanceOfGenericConstructorMethod2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js index f7ed912d030..120efc11e27 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -18,7 +18,7 @@ class b extends a { } //// [inheritanceStaticAccessorOverridingAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js index dbef001740e..7200f37f94b 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -15,7 +15,7 @@ class b extends a { } //// [inheritanceStaticAccessorOverridingMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js index 3536ca8accb..2fd5e18dab9 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -13,7 +13,7 @@ class b extends a { } //// [inheritanceStaticAccessorOverridingProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js index b3cc7d3461e..812ac57bfe4 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -15,7 +15,7 @@ class b extends a { } //// [inheritanceStaticFuncOverridingAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js index bb77561153e..224c0326a87 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -12,7 +12,7 @@ class b extends a { } //// [inheritanceStaticFuncOverridingAccessorOfFuncType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js index e05a5b245cd..375f07fd905 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -12,7 +12,7 @@ class b extends a { } //// [inheritanceStaticFuncOverridingMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js index cc8f081f1c6..c4d3f7ca420 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -10,7 +10,7 @@ class b extends a { } //// [inheritanceStaticFuncOverridingProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js index 3eb016b1e09..f9513f68585 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -10,7 +10,7 @@ class b extends a { } //// [inheritanceStaticFuncOverridingPropertyOfFuncType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js index 3585fbc3532..f64615e8a7c 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -10,7 +10,7 @@ class b extends a { } //// [inheritanceStaticFunctionOverridingInstanceProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js index 5fe4a2d002d..f1e288c57f5 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -8,7 +8,7 @@ class b extends a { } //// [inheritanceStaticMembersCompatible.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 48b54dd47d3..66ad8612538 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -8,7 +8,7 @@ class b extends a { } //// [inheritanceStaticMembersIncompatible.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index da3a42eafe1..310f2127e7e 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -12,7 +12,7 @@ class b extends a { } //// [inheritanceStaticPropertyOverridingAccessor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index db25abeafd9..3e8a444d772 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -10,7 +10,7 @@ class b extends a { } //// [inheritanceStaticPropertyOverridingMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index f75becd518c..088cfa9b1f9 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -8,7 +8,7 @@ class b extends a { } //// [inheritanceStaticPropertyOverridingProperty.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index b924fe25db9..45f4fe72535 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -15,7 +15,7 @@ new Derived("", 3); new Derived(3); //// [inheritedConstructorWithRestParams.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index 2c59c91dde7..eeb0413d1ec 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -35,7 +35,7 @@ new Derived("", 3, "", 3); new Derived("", 3, "", ""); //// [inheritedConstructorWithRestParams2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index 0c9bcd81905..75a2f13fed7 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -22,7 +22,7 @@ class E extends D { //// [inheritedModuleMembersForClodule.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/inlineSourceMap.errors.txt b/tests/baselines/reference/inlineSourceMap.errors.txt new file mode 100644 index 00000000000..8d92d6a161d --- /dev/null +++ b/tests/baselines/reference/inlineSourceMap.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/inlineSourceMap.ts(3,1): error TS2304: Cannot find name 'console'. + + +==== tests/cases/compiler/inlineSourceMap.ts (1 errors) ==== + + var x = 0; + console.log(x); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap.js b/tests/baselines/reference/inlineSourceMap.js new file mode 100644 index 00000000000..94ad43d4487 --- /dev/null +++ b/tests/baselines/reference/inlineSourceMap.js @@ -0,0 +1,9 @@ +//// [inlineSourceMap.ts] + +var x = 0; +console.log(x); + +//// [inlineSourceMap.js] +var x = 0; +console.log(x); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lU291cmNlTWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW5saW5lU291cmNlTWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap.sourcemap.txt b/tests/baselines/reference/inlineSourceMap.sourcemap.txt new file mode 100644 index 00000000000..6625cc46b21 --- /dev/null +++ b/tests/baselines/reference/inlineSourceMap.sourcemap.txt @@ -0,0 +1,61 @@ +=================================================================== +JsFile: inlineSourceMap.js +mapUrl: inlineSourceMap.js.map +sourceRoot: +sources: inlineSourceMap.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/inlineSourceMap.js +sourceFile:inlineSourceMap.ts +------------------------------------------------------------------- +>>>var x = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^-> +1 > + > +2 >var +3 > x +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +--- +>>>console.log(x); +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >console +3 > . +4 > log +5 > ( +6 > x +7 > ) +8 > ; +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 8) Source(3, 8) + SourceIndex(0) +3 >Emitted(2, 9) Source(3, 9) + SourceIndex(0) +4 >Emitted(2, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(3, 13) + SourceIndex(0) +6 >Emitted(2, 14) Source(3, 14) + SourceIndex(0) +7 >Emitted(2, 15) Source(3, 15) + SourceIndex(0) +8 >Emitted(2, 16) Source(3, 16) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lU291cmNlTWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW5saW5lU291cmNlTWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap2.errors.txt b/tests/baselines/reference/inlineSourceMap2.errors.txt new file mode 100644 index 00000000000..75db5689c66 --- /dev/null +++ b/tests/baselines/reference/inlineSourceMap2.errors.txt @@ -0,0 +1,17 @@ +error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. +error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'. +error TS5048: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. +tests/cases/compiler/inlineSourceMap2.ts(5,1): error TS2304: Cannot find name 'console'. + + +!!! error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. +!!! error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'. +!!! error TS5048: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. +==== tests/cases/compiler/inlineSourceMap2.ts (1 errors) ==== + + // configuration errors + + var x = 0; + console.log(x); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap2.js b/tests/baselines/reference/inlineSourceMap2.js new file mode 100644 index 00000000000..9cf27863346 --- /dev/null +++ b/tests/baselines/reference/inlineSourceMap2.js @@ -0,0 +1,12 @@ +//// [inlineSourceMap2.ts] + +// configuration errors + +var x = 0; +console.log(x); + +//// [outfile.js] +// configuration errors +var x = 0; +console.log(x); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0ZmlsZS5qcyIsInNvdXJjZVJvb3QiOiJmaWxlOi8vL2ZvbGRlci8iLCJzb3VyY2VzIjpbImlubGluZVNvdXJjZU1hcDIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsdUJBQXVCO0FBRXZCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap2.sourcemap.txt b/tests/baselines/reference/inlineSourceMap2.sourcemap.txt new file mode 100644 index 00000000000..4d7f499b55a --- /dev/null +++ b/tests/baselines/reference/inlineSourceMap2.sourcemap.txt @@ -0,0 +1,71 @@ +=================================================================== +JsFile: outfile.js +mapUrl: file:///folder/outfile.js.map +sourceRoot: file:///folder/ +sources: inlineSourceMap2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outfile.js +sourceFile:inlineSourceMap2.ts +------------------------------------------------------------------- +>>>// configuration errors +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +1 > + > +2 >// configuration errors +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 24) Source(2, 24) + SourceIndex(0) +--- +>>>var x = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^-> +1 > + > + > +2 >var +3 > x +4 > = +5 > 0 +6 > ; +1 >Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(4, 6) + SourceIndex(0) +4 >Emitted(2, 9) Source(4, 9) + SourceIndex(0) +5 >Emitted(2, 10) Source(4, 10) + SourceIndex(0) +6 >Emitted(2, 11) Source(4, 11) + SourceIndex(0) +--- +>>>console.log(x); +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >console +3 > . +4 > log +5 > ( +6 > x +7 > ) +8 > ; +1->Emitted(3, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(3, 8) Source(5, 8) + SourceIndex(0) +3 >Emitted(3, 9) Source(5, 9) + SourceIndex(0) +4 >Emitted(3, 12) Source(5, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(5, 13) + SourceIndex(0) +6 >Emitted(3, 14) Source(5, 14) + SourceIndex(0) +7 >Emitted(3, 15) Source(5, 15) + SourceIndex(0) +8 >Emitted(3, 16) Source(5, 16) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0ZmlsZS5qcyIsInNvdXJjZVJvb3QiOiJmaWxlOi8vL2ZvbGRlci8iLCJzb3VyY2VzIjpbImlubGluZVNvdXJjZU1hcDIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsdUJBQXVCO0FBRXZCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources.errors.txt b/tests/baselines/reference/inlineSources.errors.txt new file mode 100644 index 00000000000..1c86dcf4d99 --- /dev/null +++ b/tests/baselines/reference/inlineSources.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/a.ts(3,1): error TS2304: Cannot find name 'console'. +tests/cases/compiler/b.ts(2,1): error TS2304: Cannot find name 'console'. + + +==== tests/cases/compiler/a.ts (1 errors) ==== + + var a = 0; + console.log(a); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. + +==== tests/cases/compiler/b.ts (1 errors) ==== + var b = 0; + console.log(b); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources.js b/tests/baselines/reference/inlineSources.js new file mode 100644 index 00000000000..c700af7e4c6 --- /dev/null +++ b/tests/baselines/reference/inlineSources.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/inlineSources.ts] //// + +//// [a.ts] + +var a = 0; +console.log(a); + +//// [b.ts] +var b = 0; +console.log(b); + +//// [out.js] +var a = 0; +console.log(a); +var b = 0; +console.log(b); +//# sourceMappingURL=out.js.map \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources.js.map b/tests/baselines/reference/inlineSources.js.map new file mode 100644 index 00000000000..7e09d95a35c --- /dev/null +++ b/tests/baselines/reference/inlineSources.js.map @@ -0,0 +1,2 @@ +//// [out.js.map] +{"version":3,"file":"out.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACFf,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC","sourcesContent":["\nvar a = 0;\nconsole.log(a);\n","var b = 0;\nconsole.log(b);"]} \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources.sourcemap.txt b/tests/baselines/reference/inlineSources.sourcemap.txt new file mode 100644 index 00000000000..47d762f044e --- /dev/null +++ b/tests/baselines/reference/inlineSources.sourcemap.txt @@ -0,0 +1,114 @@ +=================================================================== +JsFile: out.js +mapUrl: out.js.map +sourceRoot: +sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts +sourcesContent: ["\nvar a = 0;\nconsole.log(a);\n","var b = 0;\nconsole.log(b);"] +=================================================================== +------------------------------------------------------------------- +emittedFile:out.js +sourceFile:tests/cases/compiler/a.ts +------------------------------------------------------------------- +>>>var a = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^-> +1 > + > +2 >var +3 > a +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +--- +>>>console.log(a); +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> + > +2 >console +3 > . +4 > log +5 > ( +6 > a +7 > ) +8 > ; +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 8) Source(3, 8) + SourceIndex(0) +3 >Emitted(2, 9) Source(3, 9) + SourceIndex(0) +4 >Emitted(2, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(3, 13) + SourceIndex(0) +6 >Emitted(2, 14) Source(3, 14) + SourceIndex(0) +7 >Emitted(2, 15) Source(3, 15) + SourceIndex(0) +8 >Emitted(2, 16) Source(3, 16) + SourceIndex(0) +--- +------------------------------------------------------------------- +emittedFile:out.js +sourceFile:tests/cases/compiler/b.ts +------------------------------------------------------------------- +>>>var b = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^-> +1 > +2 >var +3 > b +4 > = +5 > 0 +6 > ; +1 >Emitted(3, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(3, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(3, 6) Source(1, 6) + SourceIndex(1) +4 >Emitted(3, 9) Source(1, 9) + SourceIndex(1) +5 >Emitted(3, 10) Source(1, 10) + SourceIndex(1) +6 >Emitted(3, 11) Source(1, 11) + SourceIndex(1) +--- +>>>console.log(b); +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^^^^^-> +1-> + > +2 >console +3 > . +4 > log +5 > ( +6 > b +7 > ) +8 > ; +1->Emitted(4, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(4, 8) Source(2, 8) + SourceIndex(1) +3 >Emitted(4, 9) Source(2, 9) + SourceIndex(1) +4 >Emitted(4, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(4, 13) Source(2, 13) + SourceIndex(1) +6 >Emitted(4, 14) Source(2, 14) + SourceIndex(1) +7 >Emitted(4, 15) Source(2, 15) + SourceIndex(1) +8 >Emitted(4, 16) Source(2, 16) + SourceIndex(1) +--- +>>>//# sourceMappingURL=out.js.map \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources2.errors.txt b/tests/baselines/reference/inlineSources2.errors.txt new file mode 100644 index 00000000000..1c86dcf4d99 --- /dev/null +++ b/tests/baselines/reference/inlineSources2.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/a.ts(3,1): error TS2304: Cannot find name 'console'. +tests/cases/compiler/b.ts(2,1): error TS2304: Cannot find name 'console'. + + +==== tests/cases/compiler/a.ts (1 errors) ==== + + var a = 0; + console.log(a); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. + +==== tests/cases/compiler/b.ts (1 errors) ==== + var b = 0; + console.log(b); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources2.js b/tests/baselines/reference/inlineSources2.js new file mode 100644 index 00000000000..7f4c82f2ac2 --- /dev/null +++ b/tests/baselines/reference/inlineSources2.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/inlineSources2.ts] //// + +//// [a.ts] + +var a = 0; +console.log(a); + +//// [b.ts] +var b = 0; +console.log(b); + +//// [out.js] +var a = 0; +console.log(a); +var b = 0; +console.log(b); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidGVzdHMvY2FzZXMvY29tcGlsZXIvYS50cyIsInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQ0ZmLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbnZhciBhID0gMDtcbmNvbnNvbGUubG9nKGEpO1xuIiwidmFyIGIgPSAwO1xuY29uc29sZS5sb2coYik7Il19 \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources2.sourcemap.txt b/tests/baselines/reference/inlineSources2.sourcemap.txt new file mode 100644 index 00000000000..e3e14d01e9e --- /dev/null +++ b/tests/baselines/reference/inlineSources2.sourcemap.txt @@ -0,0 +1,114 @@ +=================================================================== +JsFile: out.js +mapUrl: out.js.map +sourceRoot: +sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts +sourcesContent: ["\nvar a = 0;\nconsole.log(a);\n","var b = 0;\nconsole.log(b);"] +=================================================================== +------------------------------------------------------------------- +emittedFile:out.js +sourceFile:tests/cases/compiler/a.ts +------------------------------------------------------------------- +>>>var a = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^-> +1 > + > +2 >var +3 > a +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +--- +>>>console.log(a); +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> + > +2 >console +3 > . +4 > log +5 > ( +6 > a +7 > ) +8 > ; +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 8) Source(3, 8) + SourceIndex(0) +3 >Emitted(2, 9) Source(3, 9) + SourceIndex(0) +4 >Emitted(2, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(3, 13) + SourceIndex(0) +6 >Emitted(2, 14) Source(3, 14) + SourceIndex(0) +7 >Emitted(2, 15) Source(3, 15) + SourceIndex(0) +8 >Emitted(2, 16) Source(3, 16) + SourceIndex(0) +--- +------------------------------------------------------------------- +emittedFile:out.js +sourceFile:tests/cases/compiler/b.ts +------------------------------------------------------------------- +>>>var b = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^-> +1 > +2 >var +3 > b +4 > = +5 > 0 +6 > ; +1 >Emitted(3, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(3, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(3, 6) Source(1, 6) + SourceIndex(1) +4 >Emitted(3, 9) Source(1, 9) + SourceIndex(1) +5 >Emitted(3, 10) Source(1, 10) + SourceIndex(1) +6 >Emitted(3, 11) Source(1, 11) + SourceIndex(1) +--- +>>>console.log(b); +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >console +3 > . +4 > log +5 > ( +6 > b +7 > ) +8 > ; +1->Emitted(4, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(4, 8) Source(2, 8) + SourceIndex(1) +3 >Emitted(4, 9) Source(2, 9) + SourceIndex(1) +4 >Emitted(4, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(4, 13) Source(2, 13) + SourceIndex(1) +6 >Emitted(4, 14) Source(2, 14) + SourceIndex(1) +7 >Emitted(4, 15) Source(2, 15) + SourceIndex(1) +8 >Emitted(4, 16) Source(2, 16) + SourceIndex(1) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidGVzdHMvY2FzZXMvY29tcGlsZXIvYS50cyIsInRlc3RzL2Nhc2VzL2NvbXBpbGVyL2IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQ0ZmLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbnZhciBhID0gMDtcbmNvbnNvbGUubG9nKGEpO1xuIiwidmFyIGIgPSAwO1xuY29uc29sZS5sb2coYik7Il19 \ No newline at end of file diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index 7ab3b4a0aa3..9e8e6d26b31 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -43,7 +43,7 @@ module Generic { } //// [instancePropertiesInheritedIntoClassType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index f2b709194b3..e02a2b2afad 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -8,7 +8,7 @@ class C2 extends C1 { } //// [instanceSubtypeCheck2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index 6b84c40d8fd..678f324797f 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -31,7 +31,7 @@ return null; //// [instantiatedReturnTypeContravariance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index d376f2dca98..5e72b36ef30 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -19,7 +19,7 @@ class Location { //// [interfaceExtendsClass1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index 521a71199ad..dac502b9ca3 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -28,7 +28,7 @@ c = d; d = c; // error //// [interfaceExtendsClassWithPrivate1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index c177f2e7a90..c6a11c1d3ab 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -24,7 +24,7 @@ class D2 extends C implements I { // error } //// [interfaceExtendsClassWithPrivate2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index e6848b5baf9..64b4c453829 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -41,7 +41,7 @@ class C8 extends C7 implements i2{ //// [interfaceImplementation8.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt index 7794fb027d7..fb29c829947 100644 --- a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,12): error TS2304: Cannot find name 'V'. -tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2304: Cannot find name 'C'. -tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(17,12): error TS2304: Cannot find name 'E'. -tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2304: Cannot find name 'I'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,12): error TS2503: Cannot find namespace 'V'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2503: Cannot find namespace 'C'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(17,12): error TS2503: Cannot find namespace 'E'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2503: Cannot find namespace 'I'. ==== tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts (4 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde import v = V; ~ -!!! error TS2304: Cannot find name 'V'. +!!! error TS2503: Cannot find namespace 'V'. class C { name: string; @@ -19,7 +19,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde import c = C; ~ -!!! error TS2304: Cannot find name 'C'. +!!! error TS2503: Cannot find namespace 'C'. enum E { Red, Blue @@ -27,7 +27,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde import e = E; ~ -!!! error TS2304: Cannot find name 'E'. +!!! error TS2503: Cannot find namespace 'E'. interface I { id: number; @@ -35,5 +35,5 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde import i = I; ~ -!!! error TS2304: Cannot find name 'I'. +!!! error TS2503: Cannot find namespace 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidInstantiatedModule.errors.txt b/tests/baselines/reference/invalidInstantiatedModule.errors.txt index 8bd7e6492c0..540f22f5951 100644 --- a/tests/baselines/reference/invalidInstantiatedModule.errors.txt +++ b/tests/baselines/reference/invalidInstantiatedModule.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(2,18): error TS2300: Duplicate identifier 'Point'. tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(3,16): error TS2300: Duplicate identifier 'Point'. -tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(12,8): error TS2304: Cannot find name 'm'. +tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(12,8): error TS2503: Cannot find namespace 'm'. ==== tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts (3 errors) ==== @@ -21,7 +21,7 @@ tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedMo var m = M2; var p: m.Point; // Error ~ -!!! error TS2304: Cannot find name 'm'. +!!! error TS2503: Cannot find namespace 'm'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index 077d7ddbcdc..4b3ab1b6d88 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -80,7 +80,7 @@ module YYY4 { //// [invalidModuleWithStatementsOfEveryKind.js] // All of these should be an error -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 824bee92227..31d0e44c918 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -54,7 +54,7 @@ var m: typeof M; var m = M.A; //// [invalidMultipleVariableDeclarations.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/invalidNestedModules.errors.txt b/tests/baselines/reference/invalidNestedModules.errors.txt index 972c177fc0e..1f9551a0f0b 100644 --- a/tests/baselines/reference/invalidNestedModules.errors.txt +++ b/tests/baselines/reference/invalidNestedModules.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(1,12): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(1,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(17,18): error TS2300: Duplicate identifier 'Point'. tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(24,20): error TS2300: Duplicate identifier 'Point'. @@ -6,7 +6,7 @@ tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules. ==== tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts (3 errors) ==== module A.B.C { ~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged export class Point { x: number; y: number; diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index d637158780a..50977334f4c 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -21,7 +21,7 @@ function fn11(): D { return new C(); } //// [invalidReturnStatements.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/iterableArrayPattern1.symbols b/tests/baselines/reference/iterableArrayPattern1.symbols index ae0acb823a0..c6025123179 100644 --- a/tests/baselines/reference/iterableArrayPattern1.symbols +++ b/tests/baselines/reference/iterableArrayPattern1.symbols @@ -13,7 +13,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iterableArrayPattern1.ts, 3, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iterableArrayPattern1.ts, 4, 28)) @@ -23,7 +23,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern11.symbols b/tests/baselines/reference/iterableArrayPattern11.symbols index 38a9b18e2d1..07b1fb52af8 100644 --- a/tests/baselines/reference/iterableArrayPattern11.symbols +++ b/tests/baselines/reference/iterableArrayPattern11.symbols @@ -37,7 +37,7 @@ class FooIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern12.symbols b/tests/baselines/reference/iterableArrayPattern12.symbols index 118bea4d0b4..001cb99b486 100644 --- a/tests/baselines/reference/iterableArrayPattern12.symbols +++ b/tests/baselines/reference/iterableArrayPattern12.symbols @@ -37,7 +37,7 @@ class FooIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern13.symbols b/tests/baselines/reference/iterableArrayPattern13.symbols index 832d8ecf69c..7085fd224f4 100644 --- a/tests/baselines/reference/iterableArrayPattern13.symbols +++ b/tests/baselines/reference/iterableArrayPattern13.symbols @@ -36,7 +36,7 @@ class FooIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern2.symbols b/tests/baselines/reference/iterableArrayPattern2.symbols index 0f4e7682235..09a6984cb3c 100644 --- a/tests/baselines/reference/iterableArrayPattern2.symbols +++ b/tests/baselines/reference/iterableArrayPattern2.symbols @@ -13,7 +13,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iterableArrayPattern2.ts, 3, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iterableArrayPattern2.ts, 4, 28)) @@ -23,7 +23,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern3.symbols b/tests/baselines/reference/iterableArrayPattern3.symbols index 32907a90b20..4ee65a10825 100644 --- a/tests/baselines/reference/iterableArrayPattern3.symbols +++ b/tests/baselines/reference/iterableArrayPattern3.symbols @@ -38,7 +38,7 @@ class FooIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern30.symbols b/tests/baselines/reference/iterableArrayPattern30.symbols index d291c3b128b..0f50713b43d 100644 --- a/tests/baselines/reference/iterableArrayPattern30.symbols +++ b/tests/baselines/reference/iterableArrayPattern30.symbols @@ -4,5 +4,5 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >v1 : Symbol(v1, Decl(iterableArrayPattern30.ts, 0, 11)) >k2 : Symbol(k2, Decl(iterableArrayPattern30.ts, 0, 18)) >v2 : Symbol(v2, Decl(iterableArrayPattern30.ts, 0, 21)) ->Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) +>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11)) diff --git a/tests/baselines/reference/iterableArrayPattern4.symbols b/tests/baselines/reference/iterableArrayPattern4.symbols index 473262707b0..aa5ce5783a0 100644 --- a/tests/baselines/reference/iterableArrayPattern4.symbols +++ b/tests/baselines/reference/iterableArrayPattern4.symbols @@ -38,7 +38,7 @@ class FooIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableArrayPattern9.symbols b/tests/baselines/reference/iterableArrayPattern9.symbols index 7e188f1c94e..01cfba0f09e 100644 --- a/tests/baselines/reference/iterableArrayPattern9.symbols +++ b/tests/baselines/reference/iterableArrayPattern9.symbols @@ -33,7 +33,7 @@ class FooIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iterableContextualTyping1.symbols b/tests/baselines/reference/iterableContextualTyping1.symbols index 90b025ddbb0..76d94dc2923 100644 --- a/tests/baselines/reference/iterableContextualTyping1.symbols +++ b/tests/baselines/reference/iterableContextualTyping1.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/expressions/contextualTyping/iterableContextualTyping1.ts === var iter: Iterable<(x: string) => number> = [s => s.length]; >iter : Symbol(iter, Decl(iterableContextualTyping1.ts, 0, 3)) ->Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1663, 1)) >x : Symbol(x, Decl(iterableContextualTyping1.ts, 0, 20)) >s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) >s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) diff --git a/tests/baselines/reference/iteratorSpreadInArray.symbols b/tests/baselines/reference/iteratorSpreadInArray.symbols index c535fe5426f..f53e8266baa 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray.ts, 4, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray.ts, 5, 28)) @@ -22,7 +22,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInArray11.symbols b/tests/baselines/reference/iteratorSpreadInArray11.symbols index 7df50594c22..b128803aa50 100644 --- a/tests/baselines/reference/iteratorSpreadInArray11.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray11.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts === var iter: Iterable; >iter : Symbol(iter, Decl(iteratorSpreadInArray11.ts, 0, 3)) ->Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1663, 1)) var array = [...iter]; >array : Symbol(array, Decl(iteratorSpreadInArray11.ts, 1, 3)) diff --git a/tests/baselines/reference/iteratorSpreadInArray2.symbols b/tests/baselines/reference/iteratorSpreadInArray2.symbols index 48f2f853db8..db8da1bac9d 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray2.symbols @@ -13,7 +13,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray2.ts, 4, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray2.ts, 5, 28)) @@ -23,7 +23,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; @@ -49,7 +49,7 @@ class NumberIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInArray3.symbols b/tests/baselines/reference/iteratorSpreadInArray3.symbols index b55f8e415ff..bdc200c25ec 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray3.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray3.ts, 4, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray3.ts, 5, 28)) @@ -22,7 +22,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInArray4.symbols b/tests/baselines/reference/iteratorSpreadInArray4.symbols index a1cba88d942..c49ea74dc23 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray4.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray4.ts, 4, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray4.ts, 5, 28)) @@ -22,7 +22,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInArray7.symbols b/tests/baselines/reference/iteratorSpreadInArray7.symbols index c9b8bba1090..e7fbdac2264 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray7.symbols @@ -17,7 +17,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray7.ts, 5, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray7.ts, 6, 28)) @@ -27,7 +27,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt index e0e3d061f16..90b8bdbeb46 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray9.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322 Type '() => SymbolIterator' is not assignable to type '() => Iterator'. Type 'SymbolIterator' is not assignable to type 'Iterator'. Types of property 'next' are incompatible. - Type '() => { value: symbol; }' is not assignable to type '() => IteratorResult'. + Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. Property 'done' is missing in type '{ value: symbol; }'. @@ -16,7 +16,7 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322 !!! error TS2322: Type '() => SymbolIterator' is not assignable to type '() => Iterator'. !!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator'. !!! error TS2322: Types of property 'next' are incompatible. -!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '() => IteratorResult'. +!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult'. !!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult'. !!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'. diff --git a/tests/baselines/reference/iteratorSpreadInCall11.symbols b/tests/baselines/reference/iteratorSpreadInCall11.symbols index fbc31e96020..54ac770c5df 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall11.symbols @@ -19,7 +19,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall11.ts, 6, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall11.ts, 7, 28)) @@ -29,7 +29,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInCall12.symbols b/tests/baselines/reference/iteratorSpreadInCall12.symbols index 66a8fc2f667..8b24ba5d1b7 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall12.symbols @@ -22,7 +22,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall12.ts, 8, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall12.ts, 9, 28)) @@ -32,7 +32,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; @@ -58,7 +58,7 @@ class StringIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInCall3.symbols b/tests/baselines/reference/iteratorSpreadInCall3.symbols index 121c10ec977..d43a7f9b4fc 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall3.symbols @@ -16,7 +16,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall3.ts, 5, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall3.ts, 6, 28)) @@ -26,7 +26,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/iteratorSpreadInCall5.symbols b/tests/baselines/reference/iteratorSpreadInCall5.symbols index 5e88a2be8a1..9d86858eb8e 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall5.symbols @@ -17,7 +17,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall5.ts, 5, 16)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall5.ts, 6, 28)) @@ -27,7 +27,7 @@ class SymbolIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; @@ -53,7 +53,7 @@ class StringIterator { [Symbol.iterator]() { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) return this; diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js index d3de40dcb0b..0f71ae803d6 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -35,7 +35,7 @@ class ItemSetEvent extends Event { //// [lambdaArgCrash.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/lambdaPropSelf.errors.txt b/tests/baselines/reference/lambdaPropSelf.errors.txt index ffdbc006423..e0311c364cd 100644 --- a/tests/baselines/reference/lambdaPropSelf.errors.txt +++ b/tests/baselines/reference/lambdaPropSelf.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/lambdaPropSelf.ts(21,13): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/compiler/lambdaPropSelf.ts(21,13): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/compiler/lambdaPropSelf.ts (1 errors) ==== @@ -24,6 +24,6 @@ tests/cases/compiler/lambdaPropSelf.ts(21,13): error TS2331: 'this' cannot be re module M { var x = this; ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } \ No newline at end of file diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index 33f8200530b..eaaf94e7024 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -18,7 +18,7 @@ class C extends B { //// [lift.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index bd5a0f24c61..72829316fb8 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -27,7 +27,7 @@ var y3: C1 = {}; //// [m7Bugs.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index e9f16103535..389bbfa63dd 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -32,7 +32,7 @@ var r = a.x; // error var r2 = a.w; // error //// [mergedInterfacesWithInheritedPrivates2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index a58a62de267..d088aab3d3c 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -39,7 +39,7 @@ module M { } //// [mergedInterfacesWithInheritedPrivates3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt index 25000ce2f5c..d9b7fa55d71 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/mergedModuleDeclarationCodeGen.ts(1,15): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/mergedModuleDeclarationCodeGen.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/compiler/mergedModuleDeclarationCodeGen.ts (1 errors) ==== export module X { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export module Y { class A { constructor(Y: any) { diff --git a/tests/baselines/reference/missingDecoratorType.js b/tests/baselines/reference/missingDecoratorType.js index 974c884ecd1..4460abdc798 100644 --- a/tests/baselines/reference/missingDecoratorType.js +++ b/tests/baselines/reference/missingDecoratorType.js @@ -22,7 +22,7 @@ class C { //// [a.js] //// [b.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index 2537611ddbc..c2246be8795 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -5,7 +5,7 @@ interface I extends M { } class C2 implements M { } //// [moduleAsBaseType.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index 62518b7ae01..e8e08eed26c 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -15,7 +15,7 @@ class Test1 extends C1 { define(["require", "exports"], function (require, exports) { }); //// [moduleImportedForTypeArgumentPosition_1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/moduleScoping.errors.txt b/tests/baselines/reference/moduleScoping.errors.txt index 1468d3e33bf..21471bc93a5 100644 --- a/tests/baselines/reference/moduleScoping.errors.txt +++ b/tests/baselines/reference/moduleScoping.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/file3.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/file3.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/file1.ts (0 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/externalModules/file3.ts(1,1): error TS1148: Cannot comp ==== tests/cases/conformance/externalModules/file3.ts (1 errors) ==== export var v3 = true; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. var v2 = [1,2,3]; // Module scope. Should not appear in global scope ==== tests/cases/conformance/externalModules/file4.ts (0 errors) ==== diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index 8ce4cb693f7..6c0f625f986 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -59,7 +59,7 @@ module Y { //// [moduleWithStatementsOfEveryKind.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt b/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt index c85e7584139..14b7769d22f 100644 --- a/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt +++ b/tests/baselines/reference/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.ts(2,18): error TS2304: Cannot find name 'Role'. -tests/cases/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.ts(4,26): error TS2304: Cannot find name 'ng'. +tests/cases/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.ts(4,26): error TS2503: Cannot find namespace 'ng'. ==== tests/cases/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.ts (3 errors) ==== @@ -13,5 +13,5 @@ tests/cases/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.ts(4,26): er this.roleService.add(role) .then((data: ng.IHttpPromiseCallbackArg) => data.data)); ~~ -!!! error TS2304: Cannot find name 'ng'. +!!! error TS2503: Cannot find namespace 'ng'. \ No newline at end of file diff --git a/tests/baselines/reference/multipleExports.errors.txt b/tests/baselines/reference/multipleExports.errors.txt index 254717843cf..430b8618daf 100644 --- a/tests/baselines/reference/multipleExports.errors.txt +++ b/tests/baselines/reference/multipleExports.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/multipleExports.ts(10,5): error TS1194: Export declarations are not permitted in an internal module. +tests/cases/compiler/multipleExports.ts(10,5): error TS1194: Export declarations are not permitted in a namespace. tests/cases/compiler/multipleExports.ts(10,13): error TS2484: Export declaration conflicts with exported declaration of 'x' @@ -14,7 +14,7 @@ tests/cases/compiler/multipleExports.ts(10,13): error TS2484: Export declaration v; export {x}; ~~~~~~~~~~~ -!!! error TS1194: Export declarations are not permitted in an internal module. +!!! error TS1194: Export declarations are not permitted in a namespace. ~ !!! error TS2484: Export declaration conflicts with exported declaration of 'x' } diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 269d5c2ea19..ea4a7156df9 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -39,7 +39,7 @@ class Baad extends Good { //// [multipleInheritance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js index 76fd13aa320..9b3d6f31291 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -11,7 +11,7 @@ var test = new foo(); //// [mutuallyRecursiveGenericBaseTypes2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js new file mode 100644 index 00000000000..6a7041a6733 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js @@ -0,0 +1,25 @@ +//// [nameCollisionWithBlockScopedVariable1.ts] +module M { + export class C { } +} +module M { + { + let M = 0; + new C(); + } +} + +//// [nameCollisionWithBlockScopedVariable1.js] +var M; +(function (M) { + class C { + } + M.C = C; +})(M || (M = {})); +var M; +(function (M_1) { + { + let M = 0; + new M_1.C(); + } +})(M || (M = {})); diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols new file mode 100644 index 00000000000..9c0d01bd8e9 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts === +module M { +>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 0), Decl(nameCollisionWithBlockScopedVariable1.ts, 2, 1)) + + export class C { } +>C : Symbol(C, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 10)) +} +module M { +>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 0), Decl(nameCollisionWithBlockScopedVariable1.ts, 2, 1)) + { + let M = 0; +>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 5, 11)) + + new C(); +>C : Symbol(C, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 10)) + } +} diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types new file mode 100644 index 00000000000..7a3c07af187 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts === +module M { +>M : typeof M + + export class C { } +>C : C +} +module M { +>M : typeof M + { + let M = 0; +>M : number +>0 : number + + new C(); +>new C() : C +>C : typeof C + } +} diff --git a/tests/baselines/reference/nameCollisions.errors.txt b/tests/baselines/reference/nameCollisions.errors.txt index baa7c6cbfd5..5eb7ea2cf80 100644 --- a/tests/baselines/reference/nameCollisions.errors.txt +++ b/tests/baselines/reference/nameCollisions.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/nameCollisions.ts(2,9): error TS2300: Duplicate identifier tests/cases/compiler/nameCollisions.ts(4,12): error TS2300: Duplicate identifier 'x'. tests/cases/compiler/nameCollisions.ts(10,12): error TS2300: Duplicate identifier 'z'. tests/cases/compiler/nameCollisions.ts(13,9): error TS2300: Duplicate identifier 'z'. -tests/cases/compiler/nameCollisions.ts(15,12): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/nameCollisions.ts(15,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged tests/cases/compiler/nameCollisions.ts(24,9): error TS2300: Duplicate identifier 'f'. tests/cases/compiler/nameCollisions.ts(25,14): error TS2300: Duplicate identifier 'f'. tests/cases/compiler/nameCollisions.ts(27,14): error TS2300: Duplicate identifier 'f2'. @@ -42,7 +42,7 @@ tests/cases/compiler/nameCollisions.ts(46,11): error TS2300: Duplicate identifie module y { ~ -!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged var b; } diff --git a/tests/baselines/reference/nameWithFileExtension.errors.txt b/tests/baselines/reference/nameWithFileExtension.errors.txt index ed4a1165e7e..2aa341271cd 100644 --- a/tests/baselines/reference/nameWithFileExtension.errors.txt +++ b/tests/baselines/reference/nameWithFileExtension.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find external module './foo_0.js'. +tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find module './foo_0.js'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require('./foo_0.js'); ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './foo_0.js'. +!!! error TS2307: Cannot find module './foo_0.js'. var x = foo.foo + 42; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/newLineFlagWithCRLF.js b/tests/baselines/reference/newLineFlagWithCRLF.js new file mode 100644 index 00000000000..9aaaea41fad --- /dev/null +++ b/tests/baselines/reference/newLineFlagWithCRLF.js @@ -0,0 +1,9 @@ +//// [newLineFlagWithCRLF.ts] +var x=1; +x=2; + + + +//// [newLineFlagWithCRLF.js] +var x = 1; +x = 2; diff --git a/tests/baselines/reference/newLineFlagWithCRLF.symbols b/tests/baselines/reference/newLineFlagWithCRLF.symbols new file mode 100644 index 00000000000..0bf676067e4 --- /dev/null +++ b/tests/baselines/reference/newLineFlagWithCRLF.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/newLineFlagWithCRLF.ts === +var x=1; +>x : Symbol(x, Decl(newLineFlagWithCRLF.ts, 0, 3)) + +x=2; +>x : Symbol(x, Decl(newLineFlagWithCRLF.ts, 0, 3)) + + diff --git a/tests/baselines/reference/newLineFlagWithCRLF.types b/tests/baselines/reference/newLineFlagWithCRLF.types new file mode 100644 index 00000000000..4898d2495b2 --- /dev/null +++ b/tests/baselines/reference/newLineFlagWithCRLF.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/newLineFlagWithCRLF.ts === +var x=1; +>x : number +>1 : number + +x=2; +>x=2 : number +>x : number +>2 : number + + diff --git a/tests/baselines/reference/newLineFlagWithLF.js b/tests/baselines/reference/newLineFlagWithLF.js new file mode 100644 index 00000000000..f516cb9b7fc --- /dev/null +++ b/tests/baselines/reference/newLineFlagWithLF.js @@ -0,0 +1,9 @@ +//// [newLineFlagWithLF.ts] +var x=1; +x=2; + + + +//// [newLineFlagWithLF.js] +var x = 1; +x = 2; diff --git a/tests/baselines/reference/newLineFlagWithLF.symbols b/tests/baselines/reference/newLineFlagWithLF.symbols new file mode 100644 index 00000000000..a8964eebd14 --- /dev/null +++ b/tests/baselines/reference/newLineFlagWithLF.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/newLineFlagWithLF.ts === +var x=1; +>x : Symbol(x, Decl(newLineFlagWithLF.ts, 0, 3)) + +x=2; +>x : Symbol(x, Decl(newLineFlagWithLF.ts, 0, 3)) + + diff --git a/tests/baselines/reference/newLineFlagWithLF.types b/tests/baselines/reference/newLineFlagWithLF.types new file mode 100644 index 00000000000..bfdf6072e0e --- /dev/null +++ b/tests/baselines/reference/newLineFlagWithLF.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/newLineFlagWithLF.ts === +var x=1; +>x : number +>1 : number + +x=2; +>x=2 : number +>x : number +>2 : number + + diff --git a/tests/baselines/reference/noEmitHelpers.js b/tests/baselines/reference/noEmitHelpers.js new file mode 100644 index 00000000000..bfe5a4f4445 --- /dev/null +++ b/tests/baselines/reference/noEmitHelpers.js @@ -0,0 +1,19 @@ +//// [noEmitHelpers.ts] + +class A { } +class B extends A { } + + +//// [noEmitHelpers.js] +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); diff --git a/tests/baselines/reference/noEmitHelpers.symbols b/tests/baselines/reference/noEmitHelpers.symbols new file mode 100644 index 00000000000..654f1a6cad5 --- /dev/null +++ b/tests/baselines/reference/noEmitHelpers.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/noEmitHelpers.ts === + +class A { } +>A : Symbol(A, Decl(noEmitHelpers.ts, 0, 0)) + +class B extends A { } +>B : Symbol(B, Decl(noEmitHelpers.ts, 1, 11)) +>A : Symbol(A, Decl(noEmitHelpers.ts, 0, 0)) + diff --git a/tests/baselines/reference/noEmitHelpers.types b/tests/baselines/reference/noEmitHelpers.types new file mode 100644 index 00000000000..01c5d5acb3d --- /dev/null +++ b/tests/baselines/reference/noEmitHelpers.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/noEmitHelpers.ts === + +class A { } +>A : A + +class B extends A { } +>B : B +>A : A + diff --git a/tests/baselines/reference/noEmitHelpers2.js b/tests/baselines/reference/noEmitHelpers2.js new file mode 100644 index 00000000000..1bd42377679 --- /dev/null +++ b/tests/baselines/reference/noEmitHelpers2.js @@ -0,0 +1,22 @@ +//// [noEmitHelpers2.ts] + +function decorator() { } + +@decorator +class A { + constructor(a: number, @decorator b: string) { + } +} + +//// [noEmitHelpers2.js] +function decorator() { } +var A = (function () { + function A(a, b) { + } + A = __decorate([ + decorator, + __param(1, decorator), + __metadata('design:paramtypes', [Number, String]) + ], A); + return A; +})(); diff --git a/tests/baselines/reference/noEmitHelpers2.symbols b/tests/baselines/reference/noEmitHelpers2.symbols new file mode 100644 index 00000000000..3a3e3ec94c7 --- /dev/null +++ b/tests/baselines/reference/noEmitHelpers2.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/noEmitHelpers2.ts === + +function decorator() { } +>decorator : Symbol(decorator, Decl(noEmitHelpers2.ts, 0, 0)) + +@decorator +>decorator : Symbol(decorator, Decl(noEmitHelpers2.ts, 0, 0)) + +class A { +>A : Symbol(A, Decl(noEmitHelpers2.ts, 1, 24)) + + constructor(a: number, @decorator b: string) { +>a : Symbol(a, Decl(noEmitHelpers2.ts, 5, 16)) +>decorator : Symbol(decorator, Decl(noEmitHelpers2.ts, 0, 0)) +>b : Symbol(b, Decl(noEmitHelpers2.ts, 5, 26)) + } +} diff --git a/tests/baselines/reference/noEmitHelpers2.types b/tests/baselines/reference/noEmitHelpers2.types new file mode 100644 index 00000000000..2a5b5413a7e --- /dev/null +++ b/tests/baselines/reference/noEmitHelpers2.types @@ -0,0 +1,17 @@ +=== tests/cases/compiler/noEmitHelpers2.ts === + +function decorator() { } +>decorator : () => void + +@decorator +>decorator : () => void + +class A { +>A : A + + constructor(a: number, @decorator b: string) { +>a : number +>decorator : () => void +>b : string + } +} diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index 560c8c3cbd7..b687162c154 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -6,7 +6,7 @@ class Foo { class Bar extends Foo { } // Valid //// [nonGenericClassExtendingGenericClassWithAny.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index 0474abef393..fe1e4768672 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -47,7 +47,7 @@ var b: { [x: number]: A } = { //// [numericIndexerConstrainsPropertyDeclarations2.js] // String indexer providing a constraint of a user defined type -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js index 4f4fd826c25..724db29f557 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -13,7 +13,7 @@ class C { } //// [numericIndexerConstraint3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index 531c450e7e1..404a9394bf7 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -12,7 +12,7 @@ var x: { } = { data: new B() } //// [numericIndexerConstraint4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 424f56b6214..c5e91e9dfc0 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -13,7 +13,7 @@ var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere //// [numericIndexerTyping2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index f3c5760ae63..45d56a1d716 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -56,7 +56,7 @@ var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Co //// [objectCreationOfElementAccessExpression.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectLiteralContextualTyping.js b/tests/baselines/reference/objectLiteralContextualTyping.js index 48686042754..52a2db3d0c8 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.js +++ b/tests/baselines/reference/objectLiteralContextualTyping.js @@ -1,5 +1,8 @@ //// [objectLiteralContextualTyping.ts] -// Tests related to #1774 +// In a contextually typed object literal, each property value expression is contextually typed by +// the type of the property with a matching name in the contextual type, if any, or otherwise +// for a numerically named property, the numeric index type of the contextual type, if any, or otherwise +// the string index type of the contextual type, if any. interface Item { name: string; @@ -28,7 +31,10 @@ var b: {}; //// [objectLiteralContextualTyping.js] -// Tests related to #1774 +// In a contextually typed object literal, each property value expression is contextually typed by +// the type of the property with a matching name in the contextual type, if any, or otherwise +// for a numerically named property, the numeric index type of the contextual type, if any, or otherwise +// the string index type of the contextual type, if any. var x = foo({ name: "Sprocket" }); var x; var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); diff --git a/tests/baselines/reference/objectLiteralContextualTyping.symbols b/tests/baselines/reference/objectLiteralContextualTyping.symbols index 6e8f2e5f333..23a468eac3f 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.symbols +++ b/tests/baselines/reference/objectLiteralContextualTyping.symbols @@ -1,71 +1,74 @@ === tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts === -// Tests related to #1774 +// In a contextually typed object literal, each property value expression is contextually typed by +// the type of the property with a matching name in the contextual type, if any, or otherwise +// for a numerically named property, the numeric index type of the contextual type, if any, or otherwise +// the string index type of the contextual type, if any. interface Item { >Item : Symbol(Item, Decl(objectLiteralContextualTyping.ts, 0, 0)) name: string; ->name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 2, 16)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 5, 16)) description?: string; ->description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 3, 17)) +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 6, 17)) } declare function foo(item: Item): string; ->foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) ->item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 7, 21)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 8, 1), Decl(objectLiteralContextualTyping.ts, 10, 41)) +>item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 10, 21)) >Item : Symbol(Item, Decl(objectLiteralContextualTyping.ts, 0, 0)) declare function foo(item: any): number; ->foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) ->item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 8, 21)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 8, 1), Decl(objectLiteralContextualTyping.ts, 10, 41)) +>item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 11, 21)) var x = foo({ name: "Sprocket" }); ->x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 10, 3), Decl(objectLiteralContextualTyping.ts, 11, 3)) ->foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) ->name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 10, 13)) +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 8, 1), Decl(objectLiteralContextualTyping.ts, 10, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 13, 13)) var x: string; ->x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 10, 3), Decl(objectLiteralContextualTyping.ts, 11, 3)) +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); ->y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) ->foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) ->name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 13, 13)) ->description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 13, 31)) - -var y: string; ->y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) - -var z = foo({ name: "Sprocket", description: false }); ->z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) ->foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 8, 1), Decl(objectLiteralContextualTyping.ts, 10, 41)) >name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 16, 13)) >description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 16, 31)) +var y: string; +>y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) + +var z = foo({ name: "Sprocket", description: false }); +>z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 8, 1), Decl(objectLiteralContextualTyping.ts, 10, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 19, 13)) +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 19, 31)) + var z: number; ->z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) +>z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) var w = foo({ a: 10 }); ->w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) ->foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) ->a : Symbol(a, Decl(objectLiteralContextualTyping.ts, 19, 13)) +>w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 22, 3), Decl(objectLiteralContextualTyping.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 8, 1), Decl(objectLiteralContextualTyping.ts, 10, 41)) +>a : Symbol(a, Decl(objectLiteralContextualTyping.ts, 22, 13)) var w: number; ->w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) +>w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 22, 3), Decl(objectLiteralContextualTyping.ts, 23, 3)) declare function bar(param: { x?: T }): T; ->bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 20, 14)) ->T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) ->param : Symbol(param, Decl(objectLiteralContextualTyping.ts, 22, 24)) ->x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 22, 32)) ->T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) ->T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) +>bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 23, 14)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 25, 21)) +>param : Symbol(param, Decl(objectLiteralContextualTyping.ts, 25, 24)) +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 25, 32)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 25, 21)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 25, 21)) var b = bar({}); ->b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 24, 3), Decl(objectLiteralContextualTyping.ts, 25, 3)) ->bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 20, 14)) +>b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 27, 3), Decl(objectLiteralContextualTyping.ts, 28, 3)) +>bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 23, 14)) var b: {}; ->b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 24, 3), Decl(objectLiteralContextualTyping.ts, 25, 3)) +>b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 27, 3), Decl(objectLiteralContextualTyping.ts, 28, 3)) diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index 7668b01d32c..8100b7a5446 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -1,5 +1,8 @@ === tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts === -// Tests related to #1774 +// In a contextually typed object literal, each property value expression is contextually typed by +// the type of the property with a matching name in the contextual type, if any, or otherwise +// for a numerically named property, the numeric index type of the contextual type, if any, or otherwise +// the string index type of the contextual type, if any. interface Item { >Item : Item diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 16268c1331c..339f6b23f6a 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -55,7 +55,7 @@ var b: { var r4: void = b.valueOf(); //// [objectTypeHidingMembersOfExtendedObject.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index 1dc6505456a..8f6d1706e40 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -124,7 +124,7 @@ function foo16(x: any) { } //// [objectTypesIdentityWithNumericIndexers1.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index e2fd1b99bfa..8f5b6449a88 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -127,7 +127,7 @@ function foo16(x: any) { } //// [objectTypesIdentityWithNumericIndexers2.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index 11d64efc9d5..2fc8c0c946d 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -124,7 +124,7 @@ function foo16(x: any) { } //// [objectTypesIdentityWithNumericIndexers3.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index 5c8a0afed72..a68eba8c6a2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -122,7 +122,7 @@ function foo16(x: any) { } //// [objectTypesIdentityWithPrivates.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index 36c3e67c70e..92aac37ecdb 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -40,7 +40,7 @@ function foo6(x: any): any { } //// [objectTypesIdentityWithPrivates2.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index 7c8dac97250..c202f684895 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -26,7 +26,7 @@ var c3: C3; c3; // Should fail (private x originates in the same declaration, but different types) //// [objectTypesIdentityWithPrivates3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index 37c5537aa4b..98693b4e6ee 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -124,7 +124,7 @@ function foo16(x: any) { } //// [objectTypesIdentityWithStringIndexers.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index e90dc8598e4..7e9abbad7e6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -127,7 +127,7 @@ function foo16(x: any) { } //// [objectTypesIdentityWithStringIndexers2.js] // object types are identical structurally -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 5204d7f8307..2ac23c39be5 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -11,7 +11,7 @@ d2.foo(); //// [optionalConstructorArgInSuper.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 5598f8d0872..7538397566a 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -126,7 +126,7 @@ fnOpt2(1, [2, 3], [1], true); //// [optionalParamArgsTest.js] // Optional parameter and default argument tests -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index cfdfce368d0..aa76f41644c 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -8,7 +8,7 @@ class Y extends Z { //// [optionalParamInOverride.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/out-flag.js.map b/tests/baselines/reference/out-flag.js.map index 1d33d382eba..ec4c14aac2b 100644 --- a/tests/baselines/reference/out-flag.js.map +++ b/tests/baselines/reference/out-flag.js.map @@ -1,2 +1,2 @@ //// [out-flag.js.map] -{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAEf,oBAAoB;AACpB;IAAAA;IAYAC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"} \ No newline at end of file +{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAAA,eAAe;AAGf,AADA,oBAAoB;;IACpBA;IAYAC,CAACA;IAVGD,uBAAuBA;IAChBA,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;QAEzBG,EAAEA;IACNA,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"} \ No newline at end of file diff --git a/tests/baselines/reference/out-flag.sourcemap.txt b/tests/baselines/reference/out-flag.sourcemap.txt index 397cfe346a3..0e69e34d62f 100644 --- a/tests/baselines/reference/out-flag.sourcemap.txt +++ b/tests/baselines/reference/out-flag.sourcemap.txt @@ -19,26 +19,25 @@ sourceFile:out-flag.ts --- >>>// my class comments 1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^-> +2 > +3 >^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^-> 1-> > + >// my class comments > -2 >// my class comments -1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(2, 21) Source(3, 21) + SourceIndex(0) +2 > +3 >// my class comments +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 1) Source(3, 1) + SourceIndex(0) +3 >Emitted(2, 21) Source(3, 21) + SourceIndex(0) --- >>>var MyClass = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(4, 1) + SourceIndex(0) ---- >>> function MyClass() { 1->^^^^ 2 > ^^-> -1-> +1-> + > 1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (MyClass) --- >>> } diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index c7134966cec..b308c0e8d83 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -40,7 +40,7 @@ var v=x.g; //// [overload1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index eb613586118..4588bef017b 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -23,7 +23,7 @@ class D implements MyDoc { } //// [overloadOnConstConstraintChecks1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index 25759d0a839..709f7808ac1 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -12,7 +12,7 @@ function foo(name: any): A { } //// [overloadOnConstConstraintChecks2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index 5980c852f41..7104c441938 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -13,7 +13,7 @@ function foo(name: any): A { //// [overloadOnConstConstraintChecks3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index b2ae1125750..4483b42a941 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -14,7 +14,7 @@ function foo(name: any): Z { //// [overloadOnConstConstraintChecks4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index cf9bc526b51..efcad011ab5 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -12,7 +12,7 @@ function foo(name: "DIV"): Derived2 { foo("HI"); //// [overloadOnConstantsInvalidOverload1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index 1ee5e077c08..d234ea4a69a 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -95,7 +95,7 @@ var s = fn5((n) => n.substr(0)); //// [overloadResolution.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 2571a0e02db..fc7dbd9cebe 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -102,7 +102,7 @@ new fn5((n) => n.blah); // Error //// [overloadResolutionClassConstructors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 9e10215b1cb..b3c2b2ef764 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -103,7 +103,7 @@ var s = new fn5((n) => n.substr(0)); //// [overloadResolutionConstructors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index 7ebeeb2890f..4274841d60f 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -26,7 +26,7 @@ var htmlDivElement2: Derived1 = d2.createElement("div"); var htmlSpanElement2: Derived1 = d2.createElement("span"); //// [overloadingOnConstants1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index 4a3f49d1b06..2414ec4eab2 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -28,7 +28,7 @@ var e: E = bar("bye", []); // E var f: C = bar("um", []); // C //// [overloadingOnConstants2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index 2174f9e298b..56ecfec66c0 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -8,7 +8,7 @@ class Derived2 extends Base2 { } //// [overridingPrivateStaticMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index d08a4920171..66facdeadf0 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -3,7 +3,7 @@ class C extends A # { } //// [parseErrorInHeritageClause1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt index 43a8945ffea..97527418337 100644 --- a/tests/baselines/reference/parser0_004152.errors.txt +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected. tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected. @@ -38,7 +38,7 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T ==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (35 errors) ==== export class Game { ~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0); ~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'DisplayPosition'. diff --git a/tests/baselines/reference/parser509546.errors.txt b/tests/baselines/reference/parser509546.errors.txt index ad8bf69dc12..6b98dc2aa30 100644 --- a/tests/baselines/reference/parser509546.errors.txt +++ b/tests/baselines/reference/parser509546.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts (1 errors) ==== export class Logger { ~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. public } \ No newline at end of file diff --git a/tests/baselines/reference/parser509546_1.errors.txt b/tests/baselines/reference/parser509546_1.errors.txt index 2620036c5b6..5987aadff24 100644 --- a/tests/baselines/reference/parser509546_1.errors.txt +++ b/tests/baselines/reference/parser509546_1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts (1 errors) ==== export class Logger { ~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. public } \ No newline at end of file diff --git a/tests/baselines/reference/parser509546_2.errors.txt b/tests/baselines/reference/parser509546_2.errors.txt index f945ccaac00..617fec94321 100644 --- a/tests/baselines/reference/parser509546_2.errors.txt +++ b/tests/baselines/reference/parser509546_2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts(3,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts(3,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts(3,1 export class Logger { ~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. public } \ No newline at end of file diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index 0d5a96884f3..20e00ea01ed 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -7,7 +7,7 @@ class Any extends Type { //// [parser509630.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parser519458.errors.txt b/tests/baselines/reference/parser519458.errors.txt index e618e38723f..66dae596b81 100644 --- a/tests/baselines/reference/parser519458.errors.txt +++ b/tests/baselines/reference/parser519458.errors.txt @@ -1,11 +1,14 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts(1,15): error TS2304: Cannot find name 'module'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts(1,15): error TS2503: Cannot find namespace 'module'. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts(1,21): error TS1005: ';' expected. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser519458.ts (3 errors) ==== import rect = module("rect"); var bar = new rect.Rect(); ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~~~~~~ +!!! error TS2503: Cannot find namespace 'module'. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parser618973.errors.txt b/tests/baselines/reference/parser618973.errors.txt index 83cbfb3eb67..95e08726661 100644 --- a/tests/baselines/reference/parser618973.errors.txt +++ b/tests/baselines/reference/parser618973.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts(1,8): error TS1030: 'export' modifier already seen. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts(1,21): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts(1,21): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts (2 errors) ==== @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts(1,21) ~~~~~~ !!! error TS1030: 'export' modifier already seen. ~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. public Bar() { } } \ No newline at end of file diff --git a/tests/baselines/reference/parserArgumentList1.errors.txt b/tests/baselines/reference/parserArgumentList1.errors.txt index f20b47fa964..36d1a0fad37 100644 --- a/tests/baselines/reference/parserArgumentList1.errors.txt +++ b/tests/baselines/reference/parserArgumentList1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(1,35): error TS2304: Cannot find name 'HTMLElement'. tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(2,42): error TS2304: Cannot find name '_classNameRegexp'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(2,42): error T ==== tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts (3 errors) ==== export function removeClass (node:HTMLElement, className:string) { ~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~~~~~ !!! error TS2304: Cannot find name 'HTMLElement'. node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 64c8f5c0612..ec88d11b0c9 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -220,7 +220,7 @@ class c6 extends c5 { } //// [parserAstSpans1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserClass1.errors.txt b/tests/baselines/reference/parserClass1.errors.txt index 62309f4ad61..da4fc8d870d 100644 --- a/tests/baselines/reference/parserClass1.errors.txt +++ b/tests/baselines/reference/parserClass1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts(1,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts(1,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts(1,40): error TS2304: Cannot find name 'ILogger'. ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts (2 errors) ==== export class NullLogger implements ILogger { ~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~ !!! error TS2304: Cannot find name 'ILogger'. public information(): boolean { return false; } diff --git a/tests/baselines/reference/parserClass2.errors.txt b/tests/baselines/reference/parserClass2.errors.txt index d5ff6ff8910..39476805e1d 100644 --- a/tests/baselines/reference/parserClass2.errors.txt +++ b/tests/baselines/reference/parserClass2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(3,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(3,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(3,43): error TS2304: Cannot find name 'ILogger'. tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(4,37): error TS2304: Cannot find name 'ILogger'. tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(5,18): error TS2339: Property '_information' does not exist on type 'LoggerAdapter'. @@ -9,7 +9,7 @@ tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(5,1 export class LoggerAdapter implements ILogger { ~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~ !!! error TS2304: Cannot find name 'ILogger'. constructor (public logger: ILogger) { diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index 1e4fc0d5bcf..9ef865adb75 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -3,7 +3,7 @@ class C extends A extends B { } //// [parserClassDeclaration1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index 99d34bedaed..644c4fcb54a 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -3,7 +3,7 @@ class C implements A extends B { } //// [parserClassDeclaration3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index 3552c74f184..d7cd9ca6cac 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -3,7 +3,7 @@ class C extends A implements B extends C { } //// [parserClassDeclaration4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index 6a7846fd036..4f75eb96668 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -3,7 +3,7 @@ class C extends A implements B implements C { } //// [parserClassDeclaration5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index 24e55a48344..a653a7e4042 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -3,7 +3,7 @@ class C extends A, B { } //// [parserClassDeclaration6.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserEnum1.errors.txt b/tests/baselines/reference/parserEnum1.errors.txt index e4550bbed3b..ca89c5fc104 100644 --- a/tests/baselines/reference/parserEnum1.errors.txt +++ b/tests/baselines/reference/parserEnum1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts(3,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts(3,17) export enum SignatureFlags { ~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. None = 0, IsIndexer = 1, IsStringIndexer = 1 << 1, diff --git a/tests/baselines/reference/parserEnum2.errors.txt b/tests/baselines/reference/parserEnum2.errors.txt index d2e2407387d..f8a841fd9ba 100644 --- a/tests/baselines/reference/parserEnum2.errors.txt +++ b/tests/baselines/reference/parserEnum2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts(3,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts(3,17) export enum SignatureFlags { ~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. None = 0, IsIndexer = 1, IsStringIndexer = 1 << 1, diff --git a/tests/baselines/reference/parserEnum3.errors.txt b/tests/baselines/reference/parserEnum3.errors.txt index 7628a5e1fec..463f338159a 100644 --- a/tests/baselines/reference/parserEnum3.errors.txt +++ b/tests/baselines/reference/parserEnum3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts(3,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts(3,17) export enum SignatureFlags { ~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. } \ No newline at end of file diff --git a/tests/baselines/reference/parserEnum4.errors.txt b/tests/baselines/reference/parserEnum4.errors.txt index 33c1f85a29d..9f2cd1d1862 100644 --- a/tests/baselines/reference/parserEnum4.errors.txt +++ b/tests/baselines/reference/parserEnum4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts(3,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts(4,9): error TS1132: Enum member expected. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts(4,9): export enum SignatureFlags { ~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. , ~ !!! error TS1132: Enum member expected. diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js index babceb0f752..43ebfa2bb0e 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -3,7 +3,7 @@ class C extends A, { } //// [parserErrorRecovery_ExtendsOrImplementsClause2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js index 5c0e793173a..732508b8d85 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -3,7 +3,7 @@ class C extends A implements { } //// [parserErrorRecovery_ExtendsOrImplementsClause4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js index 40dbcf61820..58f4f4631dc 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -3,7 +3,7 @@ class C extends A, implements B, { } //// [parserErrorRecovery_ExtendsOrImplementsClause5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserExportAssignment1.errors.txt b/tests/baselines/reference/parserExportAssignment1.errors.txt index e6711946d25..cd153319f1a 100644 --- a/tests/baselines/reference/parserExportAssignment1.errors.txt +++ b/tests/baselines/reference/parserExportAssignment1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,10): error TS2304: Cannot find name 'foo'. ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts (2 errors) ==== export = foo ~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~ !!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment2.errors.txt b/tests/baselines/reference/parserExportAssignment2.errors.txt index 8a376dbe6d3..60eb0c1f43e 100644 --- a/tests/baselines/reference/parserExportAssignment2.errors.txt +++ b/tests/baselines/reference/parserExportAssignment2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,10): error TS2304: Cannot find name 'foo'. ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts (2 errors) ==== export = foo; ~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~ !!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment3.errors.txt b/tests/baselines/reference/parserExportAssignment3.errors.txt index 9836671be1e..b1e94a27469 100644 --- a/tests/baselines/reference/parserExportAssignment3.errors.txt +++ b/tests/baselines/reference/parserExportAssignment3.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,9): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts (2 errors) ==== export = ~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment4.errors.txt b/tests/baselines/reference/parserExportAssignment4.errors.txt index b6815753962..93e311bdb23 100644 --- a/tests/baselines/reference/parserExportAssignment4.errors.txt +++ b/tests/baselines/reference/parserExportAssignment4.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,10): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts (2 errors) ==== export = ; ~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment5.errors.txt b/tests/baselines/reference/parserExportAssignment5.errors.txt index 8444cdbce64..7b07e1d225f 100644 --- a/tests/baselines/reference/parserExportAssignment5.errors.txt +++ b/tests/baselines/reference/parserExportAssignment5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in an internal module. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in a namespace. ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts (1 errors) ==== module M { export = A; ~~~~~~~~~~~ -!!! error TS1063: An export assignment cannot be used in an internal module. +!!! error TS1063: An export assignment cannot be used in a namespace. } \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment7.errors.txt b/tests/baselines/reference/parserExportAssignment7.errors.txt index a6650c23540..7e54f2a4bce 100644 --- a/tests/baselines/reference/parserExportAssignment7.errors.txt +++ b/tests/baselines/reference/parserExportAssignment7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(4,10): error TS2304: Cannot find name 'B'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignm ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts (3 errors) ==== export class C { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. } export = B; diff --git a/tests/baselines/reference/parserExportAssignment8.errors.txt b/tests/baselines/reference/parserExportAssignment8.errors.txt index ac8feeeec58..71b37c99db7 100644 --- a/tests/baselines/reference/parserExportAssignment8.errors.txt +++ b/tests/baselines/reference/parserExportAssignment8.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,10): error TS2304: Cannot find name 'B'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignm ==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts (3 errors) ==== export = B; ~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~~~~~ !!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~ diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt b/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt index 8b9304d9165..75652c829ee 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(1,33): error TS2304: Cannot find name 'B'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(4,9): error TS2315: Type 'C' is not generic. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(5,9): error TS2304: Cannot find name 'D'. -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(6,9): error TS2304: Cannot find name 'E'. -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(7,9): error TS2304: Cannot find name 'G'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(6,9): error TS2503: Cannot find namespace 'E'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(7,9): error TS2503: Cannot find namespace 'G'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(8,9): error TS2304: Cannot find name 'K'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(11,16): error TS2304: Cannot find name 'E'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts1.ts(14,16): error TS2304: Cannot find name 'F'. @@ -26,10 +26,10 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts !!! error TS2304: Cannot find name 'D'. var v3: E.F; ~ -!!! error TS2304: Cannot find name 'E'. +!!! error TS2503: Cannot find namespace 'E'. var v3: G.H.I; ~ -!!! error TS2304: Cannot find name 'G'. +!!! error TS2503: Cannot find namespace 'G'. var v6: K[]; ~ !!! error TS2304: Cannot find name 'K'. diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index a8f6729b3d1..5c2369e61c7 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -18,7 +18,7 @@ function f2(): F { //// [parserGenericsInTypeContexts1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt b/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt index 0ef716d1804..c365f461b7c 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(1,45): error TS2304: Cannot find name 'B'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(4,9): error TS2315: Type 'C' is not generic. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(5,9): error TS2304: Cannot find name 'D'. -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(6,9): error TS2304: Cannot find name 'E'. -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(7,9): error TS2304: Cannot find name 'G'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(6,9): error TS2503: Cannot find namespace 'E'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(7,9): error TS2503: Cannot find namespace 'G'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(8,9): error TS2304: Cannot find name 'K'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(11,16): error TS2304: Cannot find name 'E'. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts2.ts(14,16): error TS2304: Cannot find name 'F'. @@ -26,10 +26,10 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInTypeContexts !!! error TS2304: Cannot find name 'D'. var v3: E.F, Y>>; ~ -!!! error TS2304: Cannot find name 'E'. +!!! error TS2503: Cannot find namespace 'E'. var v4: G.H.I, Y>>; ~ -!!! error TS2304: Cannot find name 'G'. +!!! error TS2503: Cannot find namespace 'G'. var v6: K, Y>>[]; ~ !!! error TS2304: Cannot find name 'K'. diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index 9735d7cab3c..487038e1959 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -18,7 +18,7 @@ function f2(): F, Y>> { //// [parserGenericsInTypeContexts2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserImportDeclaration1.errors.txt b/tests/baselines/reference/parserImportDeclaration1.errors.txt index ec3397cd196..099474d3d41 100644 --- a/tests/baselines/reference/parserImportDeclaration1.errors.txt +++ b/tests/baselines/reference/parserImportDeclaration1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/parserImportDeclaration1.ts(1,21): error TS2304: Cannot find name 'TypeScriptServices'. +tests/cases/conformance/parser/ecmascript5/parserImportDeclaration1.ts(1,21): error TS2503: Cannot find namespace 'TypeScriptServices'. ==== tests/cases/conformance/parser/ecmascript5/parserImportDeclaration1.ts (1 errors) ==== import TypeScript = TypeScriptServices.TypeScript; ~~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScriptServices'. \ No newline at end of file +!!! error TS2503: Cannot find namespace 'TypeScriptServices'. \ No newline at end of file diff --git a/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt b/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt index d697e5d8526..ab6985c5ab1 100644 --- a/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt +++ b/tests/baselines/reference/parserInterfaceDeclaration6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts(1,8): error TS1030: 'export' modifier already seen. -tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts(1,25): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts(1,25): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts (2 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterface ~~~~~~ !!! error TS1030: 'export' modifier already seen. ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. } \ No newline at end of file diff --git a/tests/baselines/reference/parserInterfaceDeclaration7.errors.txt b/tests/baselines/reference/parserInterfaceDeclaration7.errors.txt index acd7e83b606..344a5d9deb8 100644 --- a/tests/baselines/reference/parserInterfaceDeclaration7.errors.txt +++ b/tests/baselines/reference/parserInterfaceDeclaration7.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts(1,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts(1,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts (1 errors) ==== export interface I { ~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. } \ No newline at end of file diff --git a/tests/baselines/reference/parserModifierOnStatementInBlock1.errors.txt b/tests/baselines/reference/parserModifierOnStatementInBlock1.errors.txt index 1530281b36b..973920e3584 100644 --- a/tests/baselines/reference/parserModifierOnStatementInBlock1.errors.txt +++ b/tests/baselines/reference/parserModifierOnStatementInBlock1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts(2,4): error TS1184: Modifiers cannot appear here. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts (2 errors) ==== export function foo() { ~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export var x = this; ~~~~~~ !!! error TS1184: Modifiers cannot appear here. diff --git a/tests/baselines/reference/parserModifierOnStatementInBlock3.errors.txt b/tests/baselines/reference/parserModifierOnStatementInBlock3.errors.txt index cff0ba1d50d..7a3fb004225 100644 --- a/tests/baselines/reference/parserModifierOnStatementInBlock3.errors.txt +++ b/tests/baselines/reference/parserModifierOnStatementInBlock3.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts(2,4): error TS1184: Modifiers cannot appear here. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts (2 errors) ==== export function foo() { ~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export function bar() { ~~~~~~ !!! error TS1184: Modifiers cannot appear here. diff --git a/tests/baselines/reference/parserModule1.errors.txt b/tests/baselines/reference/parserModule1.errors.txt index de879f9563c..3a145493dd9 100644 --- a/tests/baselines/reference/parserModule1.errors.txt +++ b/tests/baselines/reference/parserModule1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModule1.ts(1,19): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModule1.ts(1,19): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModule1.ts (1 errors) ==== export module CompilerDiagnostics { ~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export var debug = false; export interface IDiagnosticWriter { Alert(output: string): void; diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 2ddc7a8dce2..4c241abba0e 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -458,7 +458,7 @@ module TypeScript { //// [parserRealSource10.js] // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index 72fec692184..c6a08062820 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2367,7 +2367,7 @@ module TypeScript { //// [parserRealSource11.js] // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserSymbolProperty1.symbols b/tests/baselines/reference/parserSymbolProperty1.symbols index 4d7a9b669e4..54d674ea0a8 100644 --- a/tests/baselines/reference/parserSymbolProperty1.symbols +++ b/tests/baselines/reference/parserSymbolProperty1.symbols @@ -4,6 +4,6 @@ interface I { [Symbol.iterator]: string; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) } diff --git a/tests/baselines/reference/parserSymbolProperty2.symbols b/tests/baselines/reference/parserSymbolProperty2.symbols index ff110a6fe03..51fdb40efd4 100644 --- a/tests/baselines/reference/parserSymbolProperty2.symbols +++ b/tests/baselines/reference/parserSymbolProperty2.symbols @@ -3,7 +3,7 @@ interface I { >I : Symbol(I, Decl(parserSymbolProperty2.ts, 0, 0)) [Symbol.unscopables](): string; ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) } diff --git a/tests/baselines/reference/parserSymbolProperty3.symbols b/tests/baselines/reference/parserSymbolProperty3.symbols index b75a737af0a..11b6d8de94f 100644 --- a/tests/baselines/reference/parserSymbolProperty3.symbols +++ b/tests/baselines/reference/parserSymbolProperty3.symbols @@ -3,7 +3,7 @@ declare class C { >C : Symbol(C, Decl(parserSymbolProperty3.ts, 0, 0)) [Symbol.unscopables](): string; ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) } diff --git a/tests/baselines/reference/parserSymbolProperty4.symbols b/tests/baselines/reference/parserSymbolProperty4.symbols index 122a46180d2..b2ffc2c89d2 100644 --- a/tests/baselines/reference/parserSymbolProperty4.symbols +++ b/tests/baselines/reference/parserSymbolProperty4.symbols @@ -3,7 +3,7 @@ declare class C { >C : Symbol(C, Decl(parserSymbolProperty4.ts, 0, 0)) [Symbol.toPrimitive]: string; ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/parserSymbolProperty5.symbols b/tests/baselines/reference/parserSymbolProperty5.symbols index f6049c352e9..e896ebbd2a2 100644 --- a/tests/baselines/reference/parserSymbolProperty5.symbols +++ b/tests/baselines/reference/parserSymbolProperty5.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty5.ts, 0, 0)) [Symbol.toPrimitive]: string; ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/parserSymbolProperty6.symbols b/tests/baselines/reference/parserSymbolProperty6.symbols index 6f8a8d820be..1859c954ba4 100644 --- a/tests/baselines/reference/parserSymbolProperty6.symbols +++ b/tests/baselines/reference/parserSymbolProperty6.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty6.ts, 0, 0)) [Symbol.toStringTag]: string = ""; ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) } diff --git a/tests/baselines/reference/parserSymbolProperty7.symbols b/tests/baselines/reference/parserSymbolProperty7.symbols index abcffb9a1fd..a91a8227ae4 100644 --- a/tests/baselines/reference/parserSymbolProperty7.symbols +++ b/tests/baselines/reference/parserSymbolProperty7.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty7.ts, 0, 0)) [Symbol.toStringTag](): void { } ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) } diff --git a/tests/baselines/reference/parserSymbolProperty8.symbols b/tests/baselines/reference/parserSymbolProperty8.symbols index 4b2adf9c750..dee98ed1e77 100644 --- a/tests/baselines/reference/parserSymbolProperty8.symbols +++ b/tests/baselines/reference/parserSymbolProperty8.symbols @@ -3,7 +3,7 @@ var x: { >x : Symbol(x, Decl(parserSymbolProperty8.ts, 0, 3)) [Symbol.toPrimitive](): string ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/parserSymbolProperty9.symbols b/tests/baselines/reference/parserSymbolProperty9.symbols index cca16d768e6..cffbded17e6 100644 --- a/tests/baselines/reference/parserSymbolProperty9.symbols +++ b/tests/baselines/reference/parserSymbolProperty9.symbols @@ -3,7 +3,7 @@ var x: { >x : Symbol(x, Decl(parserSymbolProperty9.ts, 0, 3)) [Symbol.toPrimitive]: string ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt b/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt index 569c960404c..7eed3dbe026 100644 --- a/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt +++ b/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNameBeforeKeyword1.ts(1,8): error TS2304: Cannot find name 'TypeModule1'. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNameBeforeKeyword1.ts(1,8): error TS2503: Cannot find namespace 'TypeModule1'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNameBeforeKeyword1.ts(2,8): error TS1005: '=' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNameBeforeKeyword1.ts(2,8): error TS2304: Cannot find name 'TypeModule2'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNameBeforeKeyword1.ts(2,20): error TS1005: ',' expected. @@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNam ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnfinishedTypeNameBeforeKeyword1.ts (4 errors) ==== var x: TypeModule1. ~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeModule1'. +!!! error TS2503: Cannot find namespace 'TypeModule1'. module TypeModule2 { ~~~~~~~~~~~ !!! error TS1005: '=' expected. diff --git a/tests/baselines/reference/parserVariableDeclaration3.errors.txt b/tests/baselines/reference/parserVariableDeclaration3.errors.txt index bb4e5eceaf6..a2130449f4b 100644 --- a/tests/baselines/reference/parserVariableDeclaration3.errors.txt +++ b/tests/baselines/reference/parserVariableDeclaration3.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration3.ts(2,23): error TS2304: Cannot find name 'Harness'. tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration3.ts(3,22): error TS2304: Cannot find name 'Harness'. -tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration3.ts(4,21): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration3.ts(4,21): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration3.ts(4,55): error TS2304: Cannot find name 'TypeScript'. @@ -14,7 +14,7 @@ tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDe !!! error TS2304: Cannot find name 'Harness'. , compiler = new TypeScript.TypeScriptCompiler(outerr) ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. , code; diff --git a/tests/baselines/reference/parserharness.errors.txt b/tests/baselines/reference/parserharness.errors.txt index 2452cd76a18..66afa3d010f 100644 --- a/tests/baselines/reference/parserharness.errors.txt +++ b/tests/baselines/reference/parserharness.errors.txt @@ -13,25 +13,25 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(351,17): e 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(691,50): error TS2304: Cannot find name 'ITextWriter'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(716,47): error TS2304: Cannot find name 'TypeScript'. +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'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(724,29): error TS2304: Cannot find name 'ITextWriter'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(754,53): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(764,56): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(764,56): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(765,37): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(767,47): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(776,13): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(776,42): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(781,23): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(781,23): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(794,49): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(795,49): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,53): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,89): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,115): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,115): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(987,145): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(988,43): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(999,40): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1041,43): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(999,40): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1041,43): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1044,26): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1045,26): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1046,26): error TS2304: Cannot find name 'TypeScript'. @@ -44,69 +44,69 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1052,26): tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1053,26): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1055,26): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1058,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1059,34): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1059,34): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1061,26): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1064,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1065,34): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1065,34): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1067,26): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1070,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1071,34): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1071,34): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1073,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1074,34): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1074,34): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1076,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1077,34): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1077,34): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1079,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1080,35): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1080,74): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1107,173): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1176,132): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1080,35): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1080,74): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1107,173): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1176,132): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1193,29): error TS2304: Cannot find name 'WScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1256,126): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1257,25): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1263,31): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1256,126): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1257,25): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1263,31): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1280,45): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1286,124): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1286,209): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1294,142): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1294,227): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1286,124): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1286,209): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1294,142): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1294,227): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1302,43): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1304,39): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1307,38): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1311,45): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1321,21): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1340,38): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1344,165): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1345,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1426,25): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1340,38): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1344,165): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1345,26): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1426,25): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1430,9): error TS1128: Declaration or statement expected. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1430,17): error TS2304: Cannot find name 'optionRegex'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1440,29): error TS2304: Cannot find name 'optionRegex'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1461,23): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1461,23): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1466,36): error TS2304: Cannot find name 'optionRegex'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1484,21): error TS2304: Cannot find name 'optionRegex'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1548,57): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1548,57): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1571,32): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1582,59): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1582,59): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1591,24): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1600,24): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1604,42): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1605,21): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1705,38): error TS2304: Cannot find name 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1604,42): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1605,21): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1705,38): error TS2503: Cannot find namespace 'Services'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1706,26): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1713,62): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1713,87): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1713,62): error TS2503: Cannot find namespace 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1713,87): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1714,30): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1724,34): error TS2304: Cannot find name 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1739,20): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1746,80): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1746,80): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1750,26): error TS2304: Cannot find name 'TypeScript'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1758,84): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1769,51): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1784,39): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1784,61): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1785,25): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1787,38): error TS2304: Cannot find name 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1787,68): error TS2304: Cannot find name 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1758,84): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1769,51): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1784,39): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1784,61): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1785,25): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1787,38): error TS2503: Cannot find namespace 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. @@ -858,7 +858,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /** Mimics having multiple files, later concatenated to a single file. */ export class EmitterIOHost implements TypeScript.EmitterIOHost { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. private fileCollection = {}; @@ -914,7 +914,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): export function makeDefaultCompilerForTest(c?: TypeScript.TypeScriptCompiler) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var compiler = c || new TypeScript.TypeScriptCompiler(stderr); ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. @@ -941,7 +941,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): var compiler: TypeScript.TypeScriptCompiler; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. recreate(); // pullUpdateUnit is sufficient if an existing unit is updated, if a new unit is added we need to do a full typecheck @@ -1157,7 +1157,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. var entries = new TypeScript.ScopeTraversal(compiler).getScopeEntries(enclosingScopeContext); @@ -1175,7 +1175,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): for (var m = 0; m < compiler.scripts.members.length; m++) { var script2 = compiler.scripts.members[m]; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. if (script2.locationInfo.filename !== 'lib.d.ts') { if (targetPosition > -1) { var tyInfo = compiler.pullGetTypeInfoAtPosition(targetPosition, script2); @@ -1219,7 +1219,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): private getTypeInfoName(ast : TypeScript.AST) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var name = ''; switch (ast.nodeType) { case TypeScript.NodeType.Name: // Type Name? @@ -1263,7 +1263,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): !!! error TS2304: Cannot find name 'TypeScript'. name = (ast).text; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. break; case TypeScript.NodeType.QString: ~~~~~~~~~~ @@ -1275,7 +1275,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): !!! error TS2304: Cannot find name 'TypeScript'. name = (ast).text; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. break; case TypeScript.NodeType.Return: ~~~~~~~~~~ @@ -1287,30 +1287,30 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): !!! error TS2304: Cannot find name 'TypeScript'. name = (ast).name.actualText; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. break; case TypeScript.NodeType.ModuleDeclaration: ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. name = (ast).name.actualText; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. break; case TypeScript.NodeType.ClassDeclaration: ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. name = (ast).name.actualText; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. break; case TypeScript.NodeType.FuncDecl: ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. name = !(ast).name ? "" : (ast).name.actualText; // name == null for lambdas ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. break; default: // TODO: is there a reason to mess with all the special cases above and not just do this (ie take whatever property is there and works?) @@ -1339,7 +1339,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): */ export function generateDeclFile(code: string, verifyNoDeclFile: boolean, unitName?: string, compilationContext?: Harness.Compiler.CompilationContext, references?: TypeScript.IFileReference[]): string { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. reset(); compiler.settings.generateDeclarationFiles = true; @@ -1410,7 +1410,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /** @param fileResults an array of strings for the filename and an ITextWriter with its code */ constructor(public fileResults: { filename: string; file: WriterAggregator; }[], errorLines: string[], public scripts: TypeScript.Script[]) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var lines = []; fileResults.forEach(v => lines = lines.concat(v.file.lines)); this.code = lines.join("\n") @@ -1494,10 +1494,10 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): export function addUnit(code: string, unitName?: string, isResident?: boolean, isDeclareFile?: boolean, references?: TypeScript.IFileReference[]) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var script: TypeScript.Script = null; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var uName = unitName || '0' + (isDeclareFile ? '.d.ts' : '.ts'); for (var i = 0; i < compiler.units.length; i++) { @@ -1505,7 +1505,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): updateUnit(code, uName); script = compiler.scripts.members[i]; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. } } if (!script) { @@ -1532,9 +1532,9 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): export function compileFile(path: string, callback: (res: CompilerResult) => void , settingsCallback?: (settings?: TypeScript.CompilationSettings) => void , context?: CompilationContext, references?: TypeScript.IFileReference[]) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. path = switchToForwardSlashes(path); var filename = path.match(/[^\/]*$/)[0]; var code = readFile(path); @@ -1544,9 +1544,9 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): export function compileUnit(code: string, filename: string, callback: (res: CompilerResult) => void , settingsCallback?: (settings?: TypeScript.CompilationSettings) => void , context?: CompilationContext, references?: TypeScript.IFileReference[]) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. // not recursive function clone/* */(source: any, target: any) { for (var prop in source) { @@ -1604,16 +1604,16 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): export function emit(ioHost: TypeScript.EmitterIOHost, usePullEmitter?: boolean) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. compiler.emit(ioHost, usePullEmitter); } export function compileString(code: string, unitName: string, callback: (res: Compiler.CompilerResult) => void , context?: CompilationContext, references?: TypeScript.IFileReference[]) { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var scripts: TypeScript.Script[] = []; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. reset(); @@ -1696,7 +1696,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): originalFilePath: string; references: TypeScript.IFileReference[]; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. } // Regex for parsing options in the format "@Alpha: Value of any sort" @@ -1739,7 +1739,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): var currentFileName = null; var refs: TypeScript.IFileReference[] = []; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. for (var i = 0; i < lines.length; i++) { var line = lines[i]; @@ -1832,7 +1832,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): public version: number; public editRanges: { length: number; editRange: TypeScript.ScriptEditRange; }[] = []; ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. constructor(public name: string, public content: string, public isResident: boolean, public maxScriptVersions: number) { this.version = 1; @@ -1870,7 +1870,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): public getEditRangeSinceVersion(version: number): TypeScript.ScriptEditRange { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. if (this.version == version) { // No edits! return null; @@ -1898,10 +1898,10 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): export class TypeScriptLS implements Services.ILanguageServiceShimHost { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. private ls: Services.ILanguageServiceShim = null; ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. public scripts: ScriptInfo[] = []; public maxScriptVersions = 100; @@ -2003,7 +2003,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): */ public getLanguageService(): Services.ILanguageServiceShim { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. var ls = new Services.TypeScriptServicesFactory().createLanguageServiceShim(this); ~~~~~~~~ !!! error TS2304: Cannot find name 'Services'. @@ -2015,9 +2015,9 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /** Parse file given its source text */ public parseSourceText(fileName: string, sourceText: TypeScript.ISourceText): TypeScript.Script { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var parser = new TypeScript.Parser(); ~~~~~~~~~~ !!! error TS2304: Cannot find name 'TypeScript'. @@ -2058,7 +2058,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): */ public positionToZeroBasedLineCol(fileName: string, position: number): TypeScript.ILineCol { ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. var script = this.ls.languageService.getScriptAST(fileName); assert.notNull(script); @@ -2074,7 +2074,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /** Verify that applying edits to sourceFileName result in the content of the file baselineFileName */ public checkEdits(sourceFileName: string, baselineFileName: string, edits: Services.TextEdit[]) { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. var script = readFile(sourceFileName); var formattedScript = this.applyEdits(script, edits); var baseline = readFile(baselineFileName); @@ -2087,7 +2087,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /** Apply an array of text edits to a string, and return the resulting string. */ public applyEdits(content: string, edits: Services.TextEdit[]): string { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. var result = content; edits = this.normalizeEdits(edits); @@ -2104,18 +2104,18 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): /** Normalize an array of edits by removing overlapping entries and sorting entries on the minChar position. */ private normalizeEdits(edits: Services.TextEdit[]): Services.TextEdit[] { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. var result: Services.TextEdit[] = []; ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. function mapEdits(edits: Services.TextEdit[]): { edit: Services.TextEdit; index: number; }[] { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. var result = []; for (var i = 0; i < edits.length; i++) { result.push({ edit: edits[i], index: i }); diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 02304380013..d74e81fad27 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2096,7 +2096,7 @@ module Harness { // See the License for the specific language governing permissions and // limitations under the License. // -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/parserindenter.errors.txt b/tests/baselines/reference/parserindenter.errors.txt index 3d8e5f7cc45..a332abab7bb 100644 --- a/tests/baselines/reference/parserindenter.errors.txt +++ b/tests/baselines/reference/parserindenter.errors.txt @@ -2,10 +2,10 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(16,1): er tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(27,28): error TS2304: Cannot find name 'TypeScript'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(27,28): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(28,26): error TS2304: Cannot find name 'ParseTree'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(29,30): error TS2304: Cannot find name 'ITextSnapshot'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(31,35): error TS2304: Cannot find name 'Services'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(31,35): error TS2503: Cannot find namespace 'Services'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(32,32): error TS2304: Cannot find name 'TokenSpan'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(35,39): error TS2304: Cannot find name 'IndentationBag'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(37,48): error TS2304: Cannot find name 'Dictionary_int_int'. @@ -27,9 +27,9 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(152,51): tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(152,63): error TS2304: Cannot find name 'List_TextEditInfo'. 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 TS2304: Cannot find name 'Services'. +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(186,67): error TS2304: Cannot find name 'Services'. +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'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(207,79): error TS2304: Cannot find name 'IndentationInfo'. @@ -165,7 +165,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38): constructor( public logger: TypeScript.ILogger, ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScript'. +!!! error TS2503: Cannot find namespace 'TypeScript'. public tree: ParseTree, ~~~~~~~~~ !!! error TS2304: Cannot find name 'ParseTree'. @@ -175,7 +175,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38): public languageHostIndentation: string, public editorOptions: Services.EditorOptions, ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. public firstToken: TokenSpan, ~~~~~~~~~ !!! error TS2304: Cannot find name 'TokenSpan'. @@ -370,7 +370,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38): static GetIndentSizeFromIndentText(indentText: string, editorOptions: Services.EditorOptions): number { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. return GetIndentSizeFromText(indentText, editorOptions, /*includeNonIndentChars:*/ false); ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'GetIndentSizeFromText'. @@ -378,7 +378,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38): static GetIndentSizeFromText(text: string, editorOptions: Services.EditorOptions, includeNonIndentChars: boolean): number { ~~~~~~~~ -!!! error TS2304: Cannot find name 'Services'. +!!! error TS2503: Cannot find namespace 'Services'. var indentSize = 0; for (var i = 0; i < text.length; i++) { diff --git a/tests/baselines/reference/parservoidInQualifiedName2.errors.txt b/tests/baselines/reference/parservoidInQualifiedName2.errors.txt index ad96679f0fd..7ca94a8989a 100644 --- a/tests/baselines/reference/parservoidInQualifiedName2.errors.txt +++ b/tests/baselines/reference/parservoidInQualifiedName2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts(1,9): error TS2304: Cannot find name 'x'. +tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts(1,9): error TS2503: Cannot find namespace 'x'. tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts(1,11): error TS1003: Identifier expected. tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts(1,15): error TS1109: Expression expected. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts(1,15): ==== tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts (3 errors) ==== var v : x.void; ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2503: Cannot find namespace 'x'. ~~~~ !!! error TS1003: Identifier expected. ~ diff --git a/tests/baselines/reference/primaryExpressionMods.errors.txt b/tests/baselines/reference/primaryExpressionMods.errors.txt index 8de3d60c27d..197970591eb 100644 --- a/tests/baselines/reference/primaryExpressionMods.errors.txt +++ b/tests/baselines/reference/primaryExpressionMods.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/primaryExpressionMods.ts(7,8): error TS2304: Cannot find name 'M'. -tests/cases/compiler/primaryExpressionMods.ts(11,8): error TS2304: Cannot find name 'm'. +tests/cases/compiler/primaryExpressionMods.ts(11,8): error TS2503: Cannot find namespace 'm'. ==== tests/cases/compiler/primaryExpressionMods.ts (2 errors) ==== @@ -17,5 +17,5 @@ tests/cases/compiler/primaryExpressionMods.ts(11,8): error TS2304: Cannot find n var x2 = m.a; // Same as M.a var q: m.P; // Error ~ -!!! error TS2304: Cannot find name 'm'. +!!! error TS2503: Cannot find namespace 'm'. \ No newline at end of file diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index 629d55ed0f7..a49d6f7ee1c 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -32,7 +32,7 @@ class foo extends baz { public bar(){ return undefined}; } //// [primitiveMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js index 564d49721f1..4d6d0a72e4a 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -128,7 +128,7 @@ export class glo_C12_public extends glo_c_private implements glo_i_private, glo } //// [privacyClass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js index 6a7d716d50d..044c30f3797 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -98,7 +98,7 @@ class publicClassExtendingPublicClassInGlobal extends publicClassInGlobal { //// [privacyClassExtendsClauseDeclFile_externalModule.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; @@ -285,7 +285,7 @@ var publicClassExtendingFromPrivateModuleClass = (function (_super) { })(privateModule.publicClassInPrivateModule); exports.publicClassExtendingFromPrivateModuleClass = publicClassExtendingFromPrivateModuleClass; //// [privacyClassExtendsClauseDeclFile_GlobalFile.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index 5cd5ace3247..58877eae167 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -61,7 +61,7 @@ class glo_C11_public extends glo_c_public implements glo_i_public { //// [privacyGloClass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index ac19571b8c0..d6d24ebcb30 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules. tests/cases/compiler/privacyGloImportParseErrors.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. -tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS2307: Cannot find external module 'm1_M3_public'. -tests/cases/compiler/privacyGloImportParseErrors.ts(69,37): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(69,37): error TS2307: Cannot find external module 'm1_M4_private'. +tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS2307: Cannot find module 'm1_M3_public'. +tests/cases/compiler/privacyGloImportParseErrors.ts(69,37): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyGloImportParseErrors.ts(69,37): error TS2307: Cannot find module 'm1_M4_private'. tests/cases/compiler/privacyGloImportParseErrors.ts(80,35): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. -tests/cases/compiler/privacyGloImportParseErrors.ts(81,43): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(82,43): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(81,43): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyGloImportParseErrors.ts(82,43): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Import declarations in a namespace cannot reference a module. 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 external modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient modules cannot be nested in other modules. +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) ==== @@ -42,7 +42,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor export declare module "m1_M3_public" { ~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -52,7 +52,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor declare module "m1_M4_private" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -85,9 +85,9 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor import m1_im3_private = require("m1_M3_public"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'm1_M3_public'. +!!! error TS2307: Cannot find module 'm1_M3_public'. export var m1_im3_private_v1_public = m1_im3_private.c1; export var m1_im3_private_v2_public = new m1_im3_private.c1(); export var m1_im3_private_v3_public = m1_im3_private.f1; @@ -99,9 +99,9 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor import m1_im4_private = require("m1_M4_private"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'm1_M4_private'. +!!! error TS2307: Cannot find module 'm1_M4_private'. export var m1_im4_private_v1_public = m1_im4_private.c1; export var m1_im4_private_v2_public = new m1_im4_private.c1(); export var m1_im4_private_v3_public = m1_im4_private.f1; @@ -117,10 +117,10 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor !!! error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. export import m1_im3_public = require("m1_M3_public"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. export import m1_im4_public = require("m1_M4_private"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } module glo_M1_public { @@ -161,13 +161,13 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor module m2 { import errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. import nonerrorImport = glo_M1_public; module m5 { import m5_errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. import m5_nonerrorImport = glo_M1_public; } } @@ -179,31 +179,31 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module m2 { module "abc2" { ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module m2 { import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } } \ No newline at end of file diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index a81bfbe738b..06277c63b23 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,52 +1,52 @@ -tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS2307: Cannot find external module 'm1_M3_public'. -tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS2307: Cannot find external module 'm1_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(81,43): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(82,43): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(106,27): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS2307: Cannot find external module 'm2_M3_public'. -tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS2307: Cannot find external module 'm2_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(166,43): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(167,43): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(218,34): error TS2307: Cannot find external module 'glo_M2_public'. -tests/cases/compiler/privacyImportParseErrors.ts(238,34): error TS2307: Cannot find external module 'glo_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(251,40): error TS2307: Cannot find external module 'glo_M2_public'. -tests/cases/compiler/privacyImportParseErrors.ts(252,40): error TS2307: Cannot find external module 'glo_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS2307: Cannot find module 'm1_M3_public'. +tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS1147: Import declarations in a namespace cannot reference a module. +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,27): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS2307: Cannot find module 'm2_M3_public'. +tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS1147: Import declarations in a namespace cannot reference a module. +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. +tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2435: Ambient modules cannot be nested in other modules. +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. 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 external module 'glo_M2_public'. -tests/cases/compiler/privacyImportParseErrors.ts(273,38): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(277,45): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2435: Ambient external modules cannot be nested in other modules. +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. 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 external module 'glo_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(302,38): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(306,45): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2435: Ambient external modules cannot be nested in other modules. +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. 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 external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(319,16): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(322,12): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(314,24): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(319,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(322,12): error TS2435: Ambient modules cannot be nested in other modules. 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 external modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2435: Ambient modules cannot be nested in other modules. 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 external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient external modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(341,25): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(344,29): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(350,25): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(328,24): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(341,25): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyImportParseErrors.ts(344,29): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyImportParseErrors.ts(350,25): error TS1147: Import declarations in a namespace cannot reference a module. +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) ==== @@ -73,7 +73,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "m1_M3_public" { ~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -83,7 +83,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "m1_M4_private" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -114,9 +114,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import m1_im3_private = require("m1_M3_public"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'm1_M3_public'. +!!! error TS2307: Cannot find module 'm1_M3_public'. export var m1_im3_private_v1_public = m1_im3_private.c1; export var m1_im3_private_v2_public = new m1_im3_private.c1(); export var m1_im3_private_v3_public = m1_im3_private.f1; @@ -128,9 +128,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import m1_im4_private = require("m1_M4_private"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'm1_M4_private'. +!!! error TS2307: Cannot find module 'm1_M4_private'. export var m1_im4_private_v1_public = m1_im4_private.c1; export var m1_im4_private_v2_public = new m1_im4_private.c1(); export var m1_im4_private_v3_public = m1_im4_private.f1; @@ -144,10 +144,10 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export import m1_im2_public = m1_M2_private; export import m1_im3_public = require("m1_M3_public"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. export import m1_im4_public = require("m1_M4_private"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } module m2 { @@ -173,7 +173,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "m2_M3_public" { ~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -183,7 +183,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "m2_M4_private" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -214,9 +214,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import m1_im3_private = require("m2_M3_public"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'm2_M3_public'. +!!! error TS2307: Cannot find module 'm2_M3_public'. export var m1_im3_private_v1_public = m1_im3_private.c1; export var m1_im3_private_v2_public = new m1_im3_private.c1(); export var m1_im3_private_v3_public = m1_im3_private.f1; @@ -228,9 +228,9 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import m1_im4_private = require("m2_M4_private"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'm2_M4_private'. +!!! error TS2307: Cannot find module 'm2_M4_private'. export var m1_im4_private_v1_public = m1_im4_private.c1; export var m1_im4_private_v2_public = new m1_im4_private.c1(); export var m1_im4_private_v3_public = m1_im4_private.f1; @@ -245,10 +245,10 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export import m1_im2_public = m2_M2_private; export import m1_im3_public = require("m2_M3_public"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. export import m1_im4_public = require("m2_M4_private"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } export module glo_M1_public { @@ -263,7 +263,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "glo_M2_public" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -283,7 +283,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "glo_M4_private" { ~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. export function f1(); export class c1 { } @@ -305,7 +305,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import glo_im2_private = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'glo_M2_public'. +!!! error TS2307: Cannot find module 'glo_M2_public'. export var glo_im2_private_v1_public = glo_im2_private.c1; export var glo_im2_private_v2_public = new glo_im2_private.c1(); export var glo_im2_private_v3_public = glo_im2_private.f1; @@ -327,7 +327,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import glo_im4_private = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'glo_M4_private'. +!!! error TS2307: Cannot find module 'glo_M4_private'. export var glo_im4_private_v1_public = glo_im4_private.c1; export var glo_im4_private_v2_public = new glo_im4_private.c1(); export var glo_im4_private_v3_public = glo_im4_private.f1; @@ -342,15 +342,15 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export import glo_im2_public = glo_M3_private; export import glo_im3_public = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'glo_M2_public'. +!!! error TS2307: Cannot find module 'glo_M2_public'. export import glo_im4_public = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'glo_M4_private'. +!!! error TS2307: Cannot find module 'glo_M4_private'. export declare module "use_glo_M1_public" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. 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; @@ -365,7 +365,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import use_glo_M2_public = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'glo_M2_public'. +!!! error TS2307: Cannot find module 'glo_M2_public'. export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; }; export var use_glo_M2_public_v2_public: use_glo_M2_public; export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; @@ -376,13 +376,13 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d module m2 { import errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. import nonerrorImport = glo_M1_public; module m5 { import m5_errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. import m5_nonerrorImport = glo_M1_public; } } @@ -391,7 +391,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "use_glo_M3_private" { ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. 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; @@ -406,7 +406,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d import use_glo_M4_private = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'glo_M4_private'. +!!! error TS2307: Cannot find module 'glo_M4_private'. export var use_glo_M4_private_v1_public: { new (): use_glo_M4_private.c1; }; export var use_glo_M4_private_v2_public: use_glo_M4_private; export var use_glo_M4_private_v3_public: () => use_glo_M4_private.c1; @@ -417,13 +417,13 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d module m2 { import errorImport = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. import nonerrorImport = glo_M3_private; module m5 { import m5_errorImport = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. import m5_nonerrorImport = glo_M3_private; } } @@ -431,25 +431,25 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "anotherParseError" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. module m2 { declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module m2 { module "abc2" { ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } @@ -457,37 +457,37 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. module m2 { declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module m2 { module "abc2" { ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules. } } module m2 { import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } } @@ -495,12 +495,12 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export module m3 { import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. } } \ No newline at end of file diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js index 0d56cf415ac..7004a535952 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -10,7 +10,7 @@ class D extends Base { } //// [privateAccessInSubclass1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index a719e54768b..4158ef6a8f7 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -14,7 +14,7 @@ class Derived extends Base { } //// [privateInstanceMemberAccessibility.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index fdcb2663299..013c606f829 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -9,7 +9,7 @@ class Derived extends Base { } //// [privateStaticMemberAccessibility.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index a4562e02b65..3db3a636c7d 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -16,7 +16,7 @@ module D { //// [privateStaticNotAccessibleInClodule2.js] // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt b/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt index cd1e6ff521c..7c071fdc208 100644 --- a/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt +++ b/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt @@ -1,18 +1,18 @@ -decl.ts(1,26): error TS2307: Cannot find external module './foo/bar.js'. -decl.ts(2,26): error TS2307: Cannot find external module 'baz'. -decl.ts(3,26): error TS2307: Cannot find external module './baz'. +decl.ts(1,26): error TS2307: Cannot find module './foo/bar.js'. +decl.ts(2,26): error TS2307: Cannot find module 'baz'. +decl.ts(3,26): error TS2307: Cannot find module './baz'. ==== decl.ts (3 errors) ==== import modErr = require("./foo/bar.js"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './foo/bar.js'. +!!! error TS2307: Cannot find module './foo/bar.js'. import modErr1 = require("baz"); ~~~~~ -!!! error TS2307: Cannot find external module 'baz'. +!!! error TS2307: Cannot find module 'baz'. import modErr2 = require("./baz"); ~~~~~~~ -!!! error TS2307: Cannot find external module './baz'. +!!! error TS2307: Cannot find module './baz'. //import modErr1 = require("\bar"); diff --git a/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt b/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt index cd1e6ff521c..7c071fdc208 100644 --- a/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt +++ b/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt @@ -1,18 +1,18 @@ -decl.ts(1,26): error TS2307: Cannot find external module './foo/bar.js'. -decl.ts(2,26): error TS2307: Cannot find external module 'baz'. -decl.ts(3,26): error TS2307: Cannot find external module './baz'. +decl.ts(1,26): error TS2307: Cannot find module './foo/bar.js'. +decl.ts(2,26): error TS2307: Cannot find module 'baz'. +decl.ts(3,26): error TS2307: Cannot find module './baz'. ==== decl.ts (3 errors) ==== import modErr = require("./foo/bar.js"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './foo/bar.js'. +!!! error TS2307: Cannot find module './foo/bar.js'. import modErr1 = require("baz"); ~~~~~ -!!! error TS2307: Cannot find external module 'baz'. +!!! error TS2307: Cannot find module 'baz'. import modErr2 = require("./baz"); ~~~~~~~ -!!! error TS2307: Cannot find external module './baz'. +!!! error TS2307: Cannot find module './baz'. //import modErr1 = require("\bar"); diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt index bfc09e40188..c4ad5e69c83 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt @@ -1,14 +1,14 @@ -internal2.ts(2,21): error TS1147: Import declarations in an internal module cannot reference an external module. -internal2.ts(2,21): error TS2307: Cannot find external module 'external2'. +internal2.ts(2,21): error TS1147: Import declarations in a namespace cannot reference a module. +internal2.ts(2,21): error TS2307: Cannot find module 'external2'. ==== internal2.ts (2 errors) ==== module outer { import g = require("external2") ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'external2'. +!!! error TS2307: Cannot find module 'external2'. export var a = g.square(5); export var b = "foo"; } \ No newline at end of file diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt index bfc09e40188..c4ad5e69c83 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt @@ -1,14 +1,14 @@ -internal2.ts(2,21): error TS1147: Import declarations in an internal module cannot reference an external module. -internal2.ts(2,21): error TS2307: Cannot find external module 'external2'. +internal2.ts(2,21): error TS1147: Import declarations in a namespace cannot reference a module. +internal2.ts(2,21): error TS2307: Cannot find module 'external2'. ==== internal2.ts (2 errors) ==== module outer { import g = require("external2") ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'external2'. +!!! error TS2307: Cannot find module 'external2'. export var a = g.square(5); export var b = "foo"; } \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt index 8e555fb23f2..401347e92f1 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:../test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map index 1602fe4d4e0..af309c1684b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt index 240277bfc70..8d9c30d6288 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:../test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map index 1602fe4d4e0..af309c1684b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 1a530c850e2..44306f12661 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:../test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 1602fe4d4e0..af309c1684b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 511832f1de0..55483177e5b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:../test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 1602fe4d4e0..af309c1684b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index a1d591a0497..d1972c6fac7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 133c266cc9e..8a778d7b74b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index a1d591a0497..d1972c6fac7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 0b573b627cf..dfc6d1e756f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 4f87045fd25..eb72bfc3c02 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index a9e2e3f0e3c..534b9497bda 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 4f87045fd25..eb72bfc3c02 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index c4c267ec395..71ac2234142 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt index f630a92b4a9..9d64326a562 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map index 05ee1332d71..b6fc8f25627 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt index f630a92b4a9..9d64326a562 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map index 05ee1332d71..b6fc8f25627 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt index 74b8b777ec3..d83cb1fe788 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 05ee1332d71..b6fc8f25627 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt index 74b8b777ec3..d83cb1fe788 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 05ee1332d71..b6fc8f25627 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 37b77beb154..8df103744b5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt index 69830c04b56..66573712ce7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:../test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 37b77beb154..8df103744b5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt index 69830c04b56..66573712ce7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:../test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt index 86dae9982ec..ad89f7cfe86 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map index 230b0e33817..08a7411226a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt index 86dae9982ec..ad89f7cfe86 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map index 230b0e33817..08a7411226a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt index 84f8b2e886a..fbca4c774c7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 230b0e33817..08a7411226a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt index 84f8b2e886a..fbca4c774c7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 230b0e33817..08a7411226a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map index b7b29ed1cf8..f358b98d465 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt index e020abba5a5..ca11421c733 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map index b7b29ed1cf8..f358b98d465 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt index e020abba5a5..ca11421c733 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt index 702f520b4a6..2c8142a51ef 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map index cba32efbabe..1d5372ad9c9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt index 702f520b4a6..2c8142a51ef 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map index cba32efbabe..1d5372ad9c9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt index 68ca3d32ac9..b87a91089b3 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index cba32efbabe..1d5372ad9c9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt index 68ca3d32ac9..b87a91089b3 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index cba32efbabe..1d5372ad9c9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index 91ea14b3da4..6882b70c389 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt index a82ab38507b..cfa708b107d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map index 91ea14b3da4..6882b70c389 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt index a82ab38507b..cfa708b107d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt index e6c67f2d66a..c4ea7bd2123 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map index 3fcfc31e4d1..515473b17f7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt index ad208f9375c..0eed3e7d5ba 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map index 3fcfc31e4d1..515473b17f7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 181b1b84b5f..1fdab4bbb56 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 3fcfc31e4d1..515473b17f7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 4230c8e6366..129d326ecac 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 3fcfc31e4d1..515473b17f7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index b63911a2bc8..9d7accaa452 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index f1cc6df9de8..e5fd70c6434 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index b63911a2bc8..9d7accaa452 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 0a373a20359..2fc592160a1 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 630508cb9f8..1b716998db3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index fd08e128cfe..78467c99ecc 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 630508cb9f8..1b716998db3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index eb9ad2993b2..7603a4ca2b0 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:../outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:../outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt index f820fb19c65..a0f444928ea 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map index ee5a589cb62..b6c5ca84681 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt index f820fb19c65..a0f444928ea 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map index ee5a589cb62..b6c5ca84681 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt index f9b0d9fd57e..ff91d92f2c9 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index ee5a589cb62..b6c5ca84681 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt index f9b0d9fd57e..ff91d92f2c9 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index ee5a589cb62..b6c5ca84681 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 03cefb2f8d3..fdcfeeef82a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_multifolder/ref/m1.ts","../outputdir_multifolder_ref/m2.ts","../outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_multifolder/ref/m1.ts","../outputdir_multifolder_ref/m2.ts","../outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt index d173bd36fb2..ebe3cd999ae 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:../outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:../outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 03cefb2f8d3..fdcfeeef82a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_multifolder/ref/m1.ts","../outputdir_multifolder_ref/m2.ts","../outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_multifolder/ref/m1.ts","../outputdir_multifolder_ref/m2.ts","../outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt index d173bd36fb2..ebe3cd999ae 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:../outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:../outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt index 880f12ff461..1af999bf589 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map index bb435749048..ee9a236558d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt index 880f12ff461..1af999bf589 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map index bb435749048..ee9a236558d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt index 3ac5b590640..f62798ba3fe 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index bb435749048..ee9a236558d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt index 3ac5b590640..f62798ba3fe 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index bb435749048..ee9a236558d 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map index 11bf13c6ac8..e2b612e5851 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt index 452ad2eb841..0c75ab9d5e1 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map index 11bf13c6ac8..e2b612e5851 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt index 452ad2eb841..0c75ab9d5e1 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt index 87f1e589a12..3ec9d9c435c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map index fe7aaf2252b..f1475afcba7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt index 87f1e589a12..3ec9d9c435c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map index fe7aaf2252b..f1475afcba7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt index f68430b295d..0ff54843266 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index fe7aaf2252b..f1475afcba7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt index f68430b295d..0ff54843266 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index fe7aaf2252b..f1475afcba7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index 9e7077cbe25..1760e9f4124 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt index 8c4bedb4b30..3bad00b19d7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map index 9e7077cbe25..1760e9f4124 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt index 8c4bedb4b30..3bad00b19d7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt index 7c797a023a2..c13865cf8f3 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map index 767d260e0b8..5b6ec16659f 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt index 6aecdcd084a..0b663f820bb 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map index 767d260e0b8..5b6ec16659f 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 06b8e768334..e0f4f03c27a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 767d260e0b8..5b6ec16659f 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 468e5d2338b..96f7d6f45aa 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 767d260e0b8..5b6ec16659f 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index df57785d945..420891e5019 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index 0c806666ef0..26d86253ec1 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index df57785d945..420891e5019 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index aede30c6f73..0510b7e7e33 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index e7042dca90a..e0b70849bc1 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 5637274312d..00fddd7206e 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index e7042dca90a..e0b70849bc1 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index fa3d5513061..9d9bdbe17a2 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt index ceda6b4c058..a2fc3dfe05e 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map index 04ab805bfcb..06903d6fc51 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt index ceda6b4c058..a2fc3dfe05e 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map index 04ab805bfcb..06903d6fc51 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt index 2bf3e659118..3bbfa8afdfa 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 04ab805bfcb..06903d6fc51 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt index 2bf3e659118..3bbfa8afdfa 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 04ab805bfcb..06903d6fc51 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map index aecd97d5136..06f3e72443d 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt index 344b620620d..f889da36fe6 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map index aecd97d5136..06f3e72443d 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt index 344b620620d..f889da36fe6 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt index f13225988bd..173dec77069 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map index ede8f059f00..5b13c1897d9 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt index f13225988bd..173dec77069 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map index ede8f059f00..5b13c1897d9 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt index c5c7205d894..e1589c0feff 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ede8f059f00..5b13c1897d9 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt index c5c7205d894..e1589c0feff 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index ede8f059f00..5b13c1897d9 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map index 29ba590802a..b1aa6b79fb6 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt index 27d691b2b10..fb91eae1254 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map index 29ba590802a..b1aa6b79fb6 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt index 27d691b2b10..fb91eae1254 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt index 7f311cb64ee..1d778de19b1 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map index 5883b6aac3f..ec6296f1323 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt index 7f311cb64ee..1d778de19b1 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map index 5883b6aac3f..ec6296f1323 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt index 5f992db6323..003ceee4d93 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 5883b6aac3f..ec6296f1323 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt index 5f992db6323..003ceee4d93 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 5883b6aac3f..ec6296f1323 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map index 25ed0e8fc92..e56b1937c6d 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt index b8a52baa41e..5f63c0e5142 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map index 25ed0e8fc92..e56b1937c6d 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt index b8a52baa41e..5f63c0e5142 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt index d7a3195e995..679505e8648 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt index fe1ebdb1cc9..341a676141d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 6f2bf783957..39fe2de604c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index eff1de8b039..4483b21610f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 7a70d18105c..156e391d669 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index 49c44cde80e..877c5b5035c 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 7a70d18105c..156e391d669 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index d54d4d6245e..a15e54dd069 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 53e31e30260..c5ec380afae 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 7793026dd6e..b75fe639eb9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 53e31e30260..c5ec380afae 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index a6deca12207..7a54e211028 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt index 8bcabc44e3a..96940f59a3f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt index 8bcabc44e3a..96940f59a3f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt index e2d9eaa8dda..5a945f4c71d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt index e2d9eaa8dda..5a945f4c71d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map index 2e0ee57fe05..df7254bd000 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt index f64fa277957..4e24018adaf 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map index 2e0ee57fe05..df7254bd000 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt index f64fa277957..4e24018adaf 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt index a3179d120d8..6be1df8d85d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt index a3179d120d8..6be1df8d85d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt index 232cdca7916..90059c54016 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt index 232cdca7916..90059c54016 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map index f1c6e3bd1b7..a107f15c1bf 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt index 8d22ea01f16..6ce817a2afc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map index f1c6e3bd1b7..a107f15c1bf 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt index 8d22ea01f16..6ce817a2afc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt index e697e24c64d..e6031c87b2b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt index e697e24c64d..e6031c87b2b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt index 50bebc38cbe..aff09cc2ec5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt index 50bebc38cbe..aff09cc2ec5 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map index e80a550275c..6e45ee8da7d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt index b885327d186..8a2e3c01e10 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map index e80a550275c..6e45ee8da7d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt index b885327d186..8a2e3c01e10 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt index d8a57865c22..2b17a05139a 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt @@ -1,11 +1,11 @@ -test1.ts(2,23): error TS1147: Import declarations in an internal module cannot reference an external module. +test1.ts(2,23): error TS1147: Import declarations in a namespace cannot reference a module. ==== test1.ts (1 errors) ==== export module myModule { import foo = require("test2"); ~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. //console.log(foo.$); } diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt index d8a57865c22..2b17a05139a 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt @@ -1,11 +1,11 @@ -test1.ts(2,23): error TS1147: Import declarations in an internal module cannot reference an external module. +test1.ts(2,23): error TS1147: Import declarations in a namespace cannot reference a module. ==== test1.ts (1 errors) ==== export module myModule { import foo = require("test2"); ~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. //console.log(foo.$); } diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt index e205f308c0a..a8fb4fc1b23 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -1,5 +1,5 @@ -test1.ts(3,23): error TS1147: Import declarations in an internal module cannot reference an external module. -test1.ts(3,23): error TS2307: Cannot find external module 'test2'. +test1.ts(3,23): error TS1147: Import declarations in a namespace cannot reference a module. +test1.ts(3,23): error TS2307: Cannot find module 'test2'. ==== test1.ts (2 errors) ==== @@ -7,9 +7,9 @@ test1.ts(3,23): error TS2307: Cannot find external module 'test2'. import foo = require("test2"); ~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~ -!!! error TS2307: Cannot find external module 'test2'. +!!! error TS2307: Cannot find module 'test2'. //console.log(foo.$); diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt index e205f308c0a..a8fb4fc1b23 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -1,5 +1,5 @@ -test1.ts(3,23): error TS1147: Import declarations in an internal module cannot reference an external module. -test1.ts(3,23): error TS2307: Cannot find external module 'test2'. +test1.ts(3,23): error TS1147: Import declarations in a namespace cannot reference a module. +test1.ts(3,23): error TS2307: Cannot find module 'test2'. ==== test1.ts (2 errors) ==== @@ -7,9 +7,9 @@ test1.ts(3,23): error TS2307: Cannot find external module 'test2'. import foo = require("test2"); ~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~ -!!! error TS2307: Cannot find external module 'test2'. +!!! error TS2307: Cannot find module 'test2'. //console.log(foo.$); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index eabc4e5656a..0ed31c4ea38 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -1,16 +1,16 @@ -testGlo.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -testGlo.ts(2,39): error TS2307: Cannot find external module 'mExported'. -testGlo.ts(21,35): error TS1147: Import declarations in an internal module cannot reference an external module. -testGlo.ts(21,35): error TS2307: Cannot find external module 'mNonExported'. +testGlo.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. +testGlo.ts(2,39): error TS2307: Cannot find module 'mExported'. +testGlo.ts(21,35): error TS1147: Import declarations in a namespace cannot reference a module. +testGlo.ts(21,35): error TS2307: Cannot find module 'mNonExported'. ==== testGlo.ts (4 errors) ==== module m2 { export import mExported = require("mExported"); ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mExported'. +!!! error TS2307: Cannot find module 'mExported'. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -31,9 +31,9 @@ testGlo.ts(21,35): error TS2307: Cannot find external module 'mNonExported'. import mNonExported = require("mNonExported"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mNonExported'. +!!! error TS2307: Cannot find module 'mNonExported'. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js index 7af6249615c..5bdce5cf48a 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -1,4 +1,4 @@ -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index eabc4e5656a..0ed31c4ea38 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -1,16 +1,16 @@ -testGlo.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -testGlo.ts(2,39): error TS2307: Cannot find external module 'mExported'. -testGlo.ts(21,35): error TS1147: Import declarations in an internal module cannot reference an external module. -testGlo.ts(21,35): error TS2307: Cannot find external module 'mNonExported'. +testGlo.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. +testGlo.ts(2,39): error TS2307: Cannot find module 'mExported'. +testGlo.ts(21,35): error TS1147: Import declarations in a namespace cannot reference a module. +testGlo.ts(21,35): error TS2307: Cannot find module 'mNonExported'. ==== testGlo.ts (4 errors) ==== module m2 { export import mExported = require("mExported"); ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mExported'. +!!! error TS2307: Cannot find module 'mExported'. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -31,9 +31,9 @@ testGlo.ts(21,35): error TS2307: Cannot find external module 'mNonExported'. import mNonExported = require("mNonExported"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mNonExported'. +!!! error TS2307: Cannot find module 'mNonExported'. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js index 7af6249615c..5bdce5cf48a 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -1,4 +1,4 @@ -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index 820d18ffb98..126d5b696c1 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -1,7 +1,7 @@ -test.ts(5,39): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(5,39): error TS2307: Cannot find external module 'mExported'. -test.ts(24,35): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(24,35): error TS2307: Cannot find external module 'mNonExported'. +test.ts(5,39): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(5,39): error TS2307: Cannot find module 'mExported'. +test.ts(24,35): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(24,35): error TS2307: Cannot find module 'mNonExported'. ==== test.ts (4 errors) ==== @@ -11,9 +11,9 @@ test.ts(24,35): error TS2307: Cannot find external module 'mNonExported'. module m2 { export import mExported = require("mExported"); ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mExported'. +!!! error TS2307: Cannot find module 'mExported'. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -34,9 +34,9 @@ test.ts(24,35): error TS2307: Cannot find external module 'mNonExported'. import mNonExported = require("mNonExported"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mNonExported'. +!!! error TS2307: Cannot find module 'mNonExported'. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index 820d18ffb98..126d5b696c1 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -1,7 +1,7 @@ -test.ts(5,39): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(5,39): error TS2307: Cannot find external module 'mExported'. -test.ts(24,35): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(24,35): error TS2307: Cannot find external module 'mNonExported'. +test.ts(5,39): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(5,39): error TS2307: Cannot find module 'mExported'. +test.ts(24,35): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(24,35): error TS2307: Cannot find module 'mNonExported'. ==== test.ts (4 errors) ==== @@ -11,9 +11,9 @@ test.ts(24,35): error TS2307: Cannot find external module 'mNonExported'. module m2 { export import mExported = require("mExported"); ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mExported'. +!!! error TS2307: Cannot find module 'mExported'. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -34,9 +34,9 @@ test.ts(24,35): error TS2307: Cannot find external module 'mNonExported'. import mNonExported = require("mNonExported"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mNonExported'. +!!! error TS2307: Cannot find module 'mNonExported'. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index ed865949b87..872e43a9b4f 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -1,16 +1,16 @@ -test.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(2,39): error TS2307: Cannot find external module 'mExported'. -test.ts(42,35): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(42,35): error TS2307: Cannot find external module 'mNonExported'. +test.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(2,39): error TS2307: Cannot find module 'mExported'. +test.ts(42,35): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(42,35): error TS2307: Cannot find module 'mNonExported'. ==== test.ts (4 errors) ==== export module m2 { export import mExported = require("mExported"); ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mExported'. +!!! error TS2307: Cannot find module 'mExported'. module Internal_M1 { export var c1 = new mExported.me.class1; @@ -52,9 +52,9 @@ test.ts(42,35): error TS2307: Cannot find external module 'mNonExported'. import mNonExported = require("mNonExported"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mNonExported'. +!!! error TS2307: Cannot find module 'mNonExported'. module Internal_M3 { export var c3 = new mNonExported.mne.class1; export function f3() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index ed865949b87..872e43a9b4f 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -1,16 +1,16 @@ -test.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(2,39): error TS2307: Cannot find external module 'mExported'. -test.ts(42,35): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(42,35): error TS2307: Cannot find external module 'mNonExported'. +test.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(2,39): error TS2307: Cannot find module 'mExported'. +test.ts(42,35): error TS1147: Import declarations in a namespace cannot reference a module. +test.ts(42,35): error TS2307: Cannot find module 'mNonExported'. ==== test.ts (4 errors) ==== export module m2 { export import mExported = require("mExported"); ~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mExported'. +!!! error TS2307: Cannot find module 'mExported'. module Internal_M1 { export var c1 = new mExported.me.class1; @@ -52,9 +52,9 @@ test.ts(42,35): error TS2307: Cannot find external module 'mNonExported'. import mNonExported = require("mNonExported"); ~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. +!!! error TS1147: Import declarations in a namespace cannot reference a module. ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'mNonExported'. +!!! error TS2307: Cannot find module 'mNonExported'. module Internal_M3 { export var c3 = new mNonExported.mne.class1; export function f3() { diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index b19a07f6490..e621c38f984 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -1,7 +1,7 @@ var _this = this; // Add a lambda to ensure global 'this' capture is triggered (function () { return _this.window; }); -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index b19a07f6490..e621c38f984 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -1,7 +1,7 @@ var _this = this; // Add a lambda to ensure global 'this' capture is triggered (function () { return _this.window; }); -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js index 3818742d7a4..b1f4dd64ef2 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -1,5 +1,5 @@ /// -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js index 3818742d7a4..b1f4dd64ef2 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -1,5 +1,5 @@ /// -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map index 79496de73d9..d1c844d3247 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map @@ -1 +1 @@ -{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AAAA,wCAAwC;AACxC;IAAAA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file +{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt index 0833854ab17..83ee3b40181 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt @@ -66,24 +66,23 @@ sourceFile:../../../FolderA/FolderB/fileB.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) --- >>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function B() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map index 79496de73d9..d1c844d3247 100644 --- a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map @@ -1 +1 @@ -{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AAAA,wCAAwC;AACxC;IAAAA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file +{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt index 0833854ab17..83ee3b40181 100644 --- a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt @@ -66,24 +66,23 @@ sourceFile:../../../FolderA/FolderB/fileB.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) --- >>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function B() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map index 41ef9567648..16a45385420 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map @@ -1 +1 @@ -{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AAAA,wCAAwC;AACxC;IAAAA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file +{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt index c0f24c52650..7c5843bdd34 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt @@ -66,24 +66,23 @@ sourceFile:FolderB/fileB.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) --- >>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function B() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map index 41ef9567648..16a45385420 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map @@ -1 +1 @@ -{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AAAA,wCAAwC;AACxC;IAAAA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file +{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt index c0f24c52650..7c5843bdd34 100644 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt @@ -66,24 +66,23 @@ sourceFile:FolderB/fileB.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) --- >>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function B() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt index 7e234d178b8..154daaa4a70 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map index b5e6eec3623..9bf8cc49759 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt index f0b41e615ae..95d78aa3a6f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map index b5e6eec3623..9bf8cc49759 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index b5e6eec3623..9bf8cc49759 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 999019984d6..7197c780765 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index b5e6eec3623..9bf8cc49759 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 9ed3d1262fa..68ab2e1cb0e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 65bbb0e67c2..63116c3c3ec 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index bbad2c102f9..7579aa9cc1c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 65bbb0e67c2..63116c3c3ec 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index c409dc99f14..8fe4fb35089 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 820efe6d9d1..81d49818901 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 8536097d111..1a094439574 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 820efe6d9d1..81d49818901 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 47e9f1da73a..1b485f8a450 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt index b7293d81f54..06c05bb438b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map index da7206b4e32..54f77cba804 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt index b7293d81f54..06c05bb438b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map index da7206b4e32..54f77cba804 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index da7206b4e32..54f77cba804 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt index a76377a99e4..0cd80fd563d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index da7206b4e32..54f77cba804 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt index a76377a99e4..0cd80fd563d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 9ce443017eb..6baf87e6a0a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt index 23f41f64947..c686916fecf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 9ce443017eb..6baf87e6a0a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt index 23f41f64947..c686916fecf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt index 0087d5d6716..937975a41dc 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map index 68302f9245b..2c82359c39e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt index 0087d5d6716..937975a41dc 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map index 68302f9245b..2c82359c39e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 68302f9245b..2c82359c39e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt index a0c7d8cd976..b94aa72552f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 68302f9245b..2c82359c39e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt index a0c7d8cd976..b94aa72552f 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map index 28168d6c0ce..725dab29806 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt index f4897f2cd52..1091dae5c06 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map index 28168d6c0ce..725dab29806 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt index f4897f2cd52..1091dae5c06 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt index 9d5c143cfd4..e76f86d4edf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map index 9979f6eb7d5..7aecf7bb797 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt index 9d5c143cfd4..e76f86d4edf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map index 9979f6eb7d5..7aecf7bb797 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 9979f6eb7d5..7aecf7bb797 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt index 63af6359f7e..e8ad9ce990c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9979f6eb7d5..7aecf7bb797 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt index 63af6359f7e..e8ad9ce990c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index d11b23b98c4..9d1c6c21871 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt index 6a0176bdacd..d51d030afc4 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map index d11b23b98c4..9d1c6c21871 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt index 6a0176bdacd..d51d030afc4 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt index a144760b69f..4492ea156cd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map index 6014ca91598..7b83f21b715 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt index 64ebd330860..18997be9365 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map index 6014ca91598..7b83f21b715 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 6014ca91598..7b83f21b715 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index a8377701181..4af0f38468e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 6014ca91598..7b83f21b715 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index d8857daae5c..bdfda8e946b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 86afcf32e25..f3b07b196ea 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 94b86ffdde1..9bf843435cb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 86afcf32e25..f3b07b196ea 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt index 12a6fdbc6dd..59f5f96fc76 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 13b958b1025..bae3da16f51 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 11e34ee5a2e..d4f1ba4f5aa 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 13b958b1025..bae3da16f51 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 5b9ec51c270..47a5afc6d80 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt index 20c4a628b79..88e6b10a246 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map index 1c3b0105b5f..3f2781e7135 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt index 20c4a628b79..88e6b10a246 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map index 1c3b0105b5f..3f2781e7135 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 1c3b0105b5f..3f2781e7135 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt index 325718e37e1..939e34eb98b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 1c3b0105b5f..3f2781e7135 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt index 325718e37e1..939e34eb98b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index d7eeef9ca49..2e84a488006 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt index 46af9b6678b..1d422734a9f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map index d7eeef9ca49..2e84a488006 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt index 46af9b6678b..1d422734a9f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt index 181dcd2d8c6..bf10b5ed9fc 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map index eb9e3b663f1..1934eb39c28 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt index 181dcd2d8c6..bf10b5ed9fc 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map index eb9e3b663f1..1934eb39c28 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index eb9e3b663f1..1934eb39c28 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt index 3a97d4540e2..cd059036df7 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index eb9e3b663f1..1934eb39c28 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt index 3a97d4540e2..cd059036df7 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map index cc3b3971208..fb5adc76d59 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt index c85101c0026..7e219ee4efd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map index cc3b3971208..fb5adc76d59 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt index c85101c0026..7e219ee4efd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt index e3643a7e1e4..75655274f8a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map index 7792f8a3df6..a68bad790ab 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt index e3643a7e1e4..75655274f8a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map index 7792f8a3df6..a68bad790ab 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 7792f8a3df6..a68bad790ab 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt index c76e3a2c05c..91537c88524 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 7792f8a3df6..a68bad790ab 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt index c76e3a2c05c..91537c88524 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index ef39d6c5cdb..47e290804f2 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt index c0ad748bf2b..32bf6d56977 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map index ef39d6c5cdb..47e290804f2 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt index c0ad748bf2b..32bf6d56977 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt index 40be0ca660c..a5aeda6cdd8 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map index c9a79b35d3c..9bac80ea492 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt index d3eeabc27b5..5355f2e907e 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map index c9a79b35d3c..9bac80ea492 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index bad31ecf8d2..46ba86b781c 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 4557384d5b8..045f82046ce 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:../../test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index bad31ecf8d2..46ba86b781c 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 7a377d04299..4424c9c0872 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:../../test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index a1d591a0497..d1972c6fac7 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt index b1d3f293b7e..f7faa24855f 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index a1d591a0497..d1972c6fac7 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt index 676e8f264ec..9931e5b4418 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 4f87045fd25..eb72bfc3c02 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index a73c3b0852a..b75480da1e7 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 4f87045fd25..eb72bfc3c02 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 77ff10492be..165ca8ce022 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:../test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt index 9f8f5856ae8..3a0747b7391 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map index 38fe91174ea..c44bc996538 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt index 9f8f5856ae8..3a0747b7391 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map index 38fe91174ea..c44bc996538 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 4c7bad4f920..39003b7de59 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt index cb0659450da..f46ef4b5d46 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../../test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 4c7bad4f920..39003b7de59 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt index cb0659450da..f46ef4b5d46 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:../../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:../../../test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map index 37b77beb154..8df103744b5 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt index fa9ebc580e6..e5f624e893b 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:../test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map index 37b77beb154..8df103744b5 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt index fa9ebc580e6..e5f624e893b 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:../test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt index 17bbd902b96..37f3a793697 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map index 69f4d8bbfc1..35110f566c5 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt index 17bbd902b96..37f3a793697 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map index 69f4d8bbfc1..35110f566c5 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 5ec3a45d1bd..dcdfb881785 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt index 0a6c6e15aa1..1d4ac548211 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 5ec3a45d1bd..dcdfb881785 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt index 0a6c6e15aa1..1d4ac548211 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map index b7b29ed1cf8..f358b98d465 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt index 6343dcc34c6..bd56afebe59 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map index b7b29ed1cf8..f358b98d465 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt index 6343dcc34c6..bd56afebe59 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt index 6bdf8e8ef31..d35b75a2de1 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map index ef084bb2128..a91cc4d9881 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt index 6bdf8e8ef31..d35b75a2de1 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map index ef084bb2128..a91cc4d9881 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 22a81dc63bc..0024c7c2747 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt index 2de709b09ab..079673b4779 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 22a81dc63bc..0024c7c2747 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt index 2de709b09ab..079673b4779 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:../../test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map index 91ea14b3da4..6882b70c389 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt index 9ca0493ff41..9f06bde3b12 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map index 91ea14b3da4..6882b70c389 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt index 9ca0493ff41..9f06bde3b12 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:../test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt index 6abc36a0832..ecf6b4f4fb4 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt index 49e704a99e1..65a337f5eab 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 7e0989aabb0..0f0eb1aa02a 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -325,12 +325,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -342,26 +347,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index e425f41290b..2a21f422960 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt index 3d19accc614..30caf09e890 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -324,12 +324,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -341,26 +346,23 @@ sourceFile:test.ts 2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 7a70d18105c..156e391d669 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index d4cac643490..c2331c962e7 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 7a70d18105c..156e391d669 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt index cb96dcbf7d7..96a83ac34b2 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 53e31e30260..c5ec380afae 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index d54fa316273..d21b9752018 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -319,12 +319,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -336,26 +341,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 53e31e30260..c5ec380afae 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt index 8bd8c2ac035..a4436e03b4d 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -318,12 +318,17 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>/// 1-> @@ -335,26 +340,23 @@ sourceFile:test.ts 2 >Emitted(12, 34) Source(2, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(1) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(13, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(13, 7) Source(3, 7) + SourceIndex(1) +3 >Emitted(13, 10) Source(3, 10) + SourceIndex(1) +4 >Emitted(13, 12) Source(3, 12) + SourceIndex(1) +5 >Emitted(13, 13) Source(3, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt index a70e80c9c1a..f5758392a22 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt index a70e80c9c1a..f5758392a22 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt index 4f4f068056f..309061b94ed 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 859053b5510..63113a47468 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt index 4f4f068056f..309061b94ed 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -296,12 +296,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >/// + >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>/// 1-> @@ -313,26 +318,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +4 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map index 2e0ee57fe05..df7254bd000 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt index 823af8d1bc3..2903da82815 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map index 2e0ee57fe05..df7254bd000 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAC;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,AAFA,iCAAiC;AACjC,0DAA0D;IACtD,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt index 823af8d1bc3..2903da82815 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -284,12 +284,17 @@ sourceFile:outputdir_multifolder/test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->/// + >/// + > +2 > +3 >/// +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 1) Source(1, 1) + SourceIndex(2) +3 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) --- >>>/// 1-> @@ -301,26 +306,23 @@ sourceFile:outputdir_multifolder/test.ts 2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) +2 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) +3 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) +4 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) +5 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt index e9ff85f6fe6..6784e74b54c 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt index e9ff85f6fe6..6784e74b54c 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt index 411004d82a3..b6a9d4f8786 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index ad9ad3d5ce0..ec67c8da25b 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt index 411004d82a3..b6a9d4f8786 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map index f1c6e3bd1b7..a107f15c1bf 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt index 10e2e3700c1..a4f350382a6 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map index f1c6e3bd1b7..a107f15c1bf 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,6BAA6B;IACzB,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt index 10e2e3700c1..a4f350382a6 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt index c8b19a1227f..333f432766e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt index c8b19a1227f..333f432766e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt index 31798101a57..68dc81acc3e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 014979baf03..7a5bbb049d9 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAA;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt index 31798101a57..68dc81acc3e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -153,33 +153,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +5 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map index e80a550275c..6e45ee8da7d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt index 791b3dbcecb..3ca3d1774f8 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map index e80a550275c..6e45ee8da7d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAAA;IAEAC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACIE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,AADA,iCAAiC;IAC7B,EAAE,GAAG,EAAE,CAAC;AACZ;IAAAC;IAEAC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACIE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt index 791b3dbcecb..3ca3d1774f8 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -147,33 +147,34 @@ sourceFile:test.ts ------------------------------------------------------------------- >>>/// 1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1->/// + > +2 > +3 >/// +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(1, 1) + SourceIndex(1) +3 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) --- >>>var a1 = 10; +1 >^^^^ +2 > ^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> 1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) + >var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) +4 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) +5 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) --- >>>var c1 = (function () { 1-> diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js index 23673dbcfad..f67a9d89249 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -52,7 +52,7 @@ var c: { }; //// [propertiesAndIndexers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 9295ce43b26..1e6ef5c1d6d 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -151,7 +151,7 @@ var x3: A; //// [propertyAccess.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index 88baee7752e..dc4c30d9165 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -83,7 +83,7 @@ var r4 = b.foo(aB, aB); // no inferences for T so constraint isn't satisfied, er //// [propertyAccessOnTypeParameterWithConstraints2.js] // generic types should behave as if they have properties of their constraint type -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index 941adc7ab43..7e935609e36 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -58,7 +58,7 @@ var r4 = b.foo(new B()); // valid call to an invalid function //// [propertyAccessOnTypeParameterWithConstraints3.js] // generic types should behave as if they have properties of their constraint type -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index fe3c9433796..f871ce553b7 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -45,7 +45,7 @@ var b = { var r4 = b.foo(new B()); // error after constraints above made illegal, doesn't matter //// [propertyAccessOnTypeParameterWithConstraints5.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index 28a1da5ffec..45f001c65fb 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -21,7 +21,7 @@ class C extends B { //// [protectedClassPropertyAccessibleWithinSubclass.js] // no errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js index 73abc96cc43..10276f8ac85 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -95,7 +95,7 @@ d3.x; // Error, neither within their declaring class nor class d4.x; // Error, neither within their declaring class nor classes derived from their declaring class //// [protectedClassPropertyAccessibleWithinSubclass2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js index 8085112d994..1a5b7489910 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -14,7 +14,7 @@ class Derived extends Base { } //// [protectedClassPropertyAccessibleWithinSubclass3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedInstanceMemberAccessibility.js b/tests/baselines/reference/protectedInstanceMemberAccessibility.js index de7a6e0d00e..7560c5c89ca 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -45,7 +45,7 @@ class C extends A { //// [protectedInstanceMemberAccessibility.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index dd2e113d665..33b6e2ebde2 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -117,7 +117,7 @@ class B3 extends A3 { //// [protectedMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index 81c11369ee8..1bd102694d4 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -44,7 +44,7 @@ Derived2.x; // Error, neither within their declaring class nor classes deriv Derived3.x; // Error, neither within their declaring class nor classes derived from their declaring class //// [protectedStaticClassPropertyAccessibleWithinSubclass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js index 520851f5e95..c82c67b7003 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -22,7 +22,7 @@ class Derived2 extends Derived1 { } //// [protectedStaticClassPropertyAccessibleWithinSubclass2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js index a8dc4ebba21..8b071cb6b52 100644 --- a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js @@ -7,7 +7,7 @@ class Beta extends Alpha.x { } //// [qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index d79aaa30d9a..6c1cd918779 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -5,7 +5,7 @@ class C extends A { } (new C).blah; //// [recursiveBaseCheck3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index e6779fc74e9..1abb6731263 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -3,7 +3,7 @@ class M extends M { } (new M).blah; //// [recursiveBaseCheck4.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index ee97b3ec436..7fb9b444650 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -3,7 +3,7 @@ class S18 extends S18<{ S19: A; }>{ } (new S18()).blah; //// [recursiveBaseCheck6.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index c475f604b14..d0fc83b30f2 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -7,7 +7,7 @@ var x = new C2(); // Valid //// [recursiveBaseConstructorCreation1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index 403eb330cd7..214c543b836 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -10,7 +10,7 @@ export class MemberNameArray extends MemberName { //// [recursiveClassInstantiationsWithDefaultConstructors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index d47d9340a8c..e9339fec4df 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -105,7 +105,7 @@ module Sample.Thing.Languages.PlainText { //// [recursiveClassReferenceTest.js] // Scenario 1: Test reqursive function call with "this" parameter // Scenario 2: Test recursive function call with cast and "this" parameter -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 5513966c894..5573bdd8de8 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js.map +++ b/tests/baselines/reference/recursiveClassReferenceTest.js.map @@ -1,2 +1,2 @@ //// [recursiveClassReferenceTest.js.map] -{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,OAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC;oBAAAC;oBAQAC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,kBAQ3BA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,YAAIA,KAAJA,YAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC;gBAKCC,oBAAoBA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAEvBA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,aAkBtBA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAAe;IAAuFC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC;oBACOC,eAAoBA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,QAWjBA,CAAAA;gBAEDA;oBAA0BM,wBAAYA;oBAAtCA;wBAA0BC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,OAQhBA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file +{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,OAAOA,CAUpBA;IAVaA,WAAAA,OAAOA;QAACC,IAAAA,KAAKA,CAU1BA;QAVqBA,WAAAA,OAAKA;YAACC,IAAAA,IAAIA,CAU/BA;YAV2BA,WAAAA,IAAIA,EAACA,CAACA;gBACjCC;oBAAAC;oBAQAC,CAACA;oBANOD,+BAAKA,GAAZA,cAAiBE,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,kBAQ3BA,CAAAA;YACFA,CAACA,EAV2BD,IAAIA,GAAJA,YAAIA,KAAJA,YAAIA,QAU/BA;QAADA,CAACA,EAVqBD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAU1BA;IAADA,CAACA,EAVaD,OAAOA,GAAPA,cAAOA,KAAPA,cAAOA,QAUpBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAoBlBA;IApBaA,WAAAA,KAAKA;QAACQ,IAAAA,OAAOA,CAoB1BA;QApBmBA,WAAAA,OAAOA,EAACA,CAACA;YAC5BC;gBAKCC,oBAAoBA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,AADAA,aAAaA;oBACbA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA,IAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;gBAAAA,CAACA,CAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,aAkBtBA,CAAAA;QACFA,CAACA,EApBmBD,OAAOA,GAAPA,aAAOA,KAAPA,aAAOA,QAoB1BA;IAADA,CAACA,EApBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAoBlBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAAe;IAAuFC,CAACA;IAA3CD,sCAAeA,GAAtBA,cAAmCE,MAAMA,CAACA,IAAIA,CAACA,CAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,IAAAA,KAAKA,CAwBlBA;IAxBaA,WAAAA,KAAKA;QAACQ,IAAAA,SAASA,CAwB5BA;QAxBmBA,WAAAA,SAASA;YAACU,IAAAA,SAASA,CAwBtCA;YAxB6BA,WAAAA,SAASA,EAACA,CAACA;gBAExCC;oBACOC,eAAoBA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA,cAA0BI,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,QAWjBA,CAAAA;gBAEDA;oBAA0BM,wBAAYA;oBAAtCA;wBAA0BC,8BAAYA;oBAQtCA,CAACA;oBANAD,aAAaA;oBACNA,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,OAQhBA,CAAAA;YACFA,CAACA,EAxB6BD,SAASA,GAATA,mBAASA,KAATA,mBAASA,QAwBtCA;QAADA,CAACA,EAxBmBV,SAASA,GAATA,eAASA,KAATA,eAASA,QAwB5BA;IAADA,CAACA,EAxBaR,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAwBlBA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 342ca402893..67031d420ea 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -26,7 +26,7 @@ sourceFile:recursiveClassReferenceTest.ts 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 75) Source(2, 75) + SourceIndex(0) --- ->>>var __extends = this.__extends || function (d, b) { +>>>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; } >>> __.prototype = b.prototype; @@ -738,14 +738,18 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> // scenario 1 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > +3 > ^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 > -2 > // scenario 1 -1 >Emitted(41, 21) Source(51, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) -2 >Emitted(41, 34) Source(51, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 > +3 > // scenario 1 +1 >Emitted(41, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(41, 21) Source(51, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(41, 34) Source(51, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) --- >>> codeThing.addWidget("addWidget", this); 1->^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index 25f20f57d23..6e88dd8dc22 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -25,7 +25,7 @@ class TypeSymbol extends InferenceSymbol { } //// [recursiveComplicatedClasses.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt b/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt new file mode 100644 index 00000000000..0604e38bd94 --- /dev/null +++ b/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt @@ -0,0 +1,76 @@ +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(2,5): error TS2502: 'c' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(4,5): error TS2502: 'd' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(6,5): error TS2502: 'e' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(10,5): error TS2502: 'f' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(12,5): error TS2502: 'f2' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(14,5): error TS2502: 'f3' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(51,5): error TS2502: 'hy3' is referenced directly or indirectly in its own type annotation. + + +==== tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts (7 errors) ==== + // The following are errors because of circular references + var c: typeof c; + ~ +!!! error TS2502: 'c' is referenced directly or indirectly in its own type annotation. + var c: any; + var d: typeof e; + ~ +!!! error TS2502: 'd' is referenced directly or indirectly in its own type annotation. + var d: any; + var e: typeof d; + ~ +!!! error TS2502: 'e' is referenced directly or indirectly in its own type annotation. + var e: any; + + interface Foo { } + var f: Array; + ~ +!!! error TS2502: 'f' is referenced directly or indirectly in its own type annotation. + var f: any; + var f2: Foo; + ~~ +!!! error TS2502: 'f2' is referenced directly or indirectly in its own type annotation. + var f2: any; + var f3: Foo[]; + ~~ +!!! error TS2502: 'f3' is referenced directly or indirectly in its own type annotation. + var f3: any; + + // None of these declarations should have any errors! + // Truly recursive types + var g: { x: typeof g; }; + var g: typeof g.x; + var h: () => typeof h; + var h = h(); + var i: (x: typeof i) => typeof x; + var i = i(i); + var j: (x: T) => T; + var j = j(j); + + // Same as h, i, j with construct signatures + var h2: new () => typeof h2; + var h2 = new h2(); + var i2: new (x: typeof i2) => typeof x; + var i2 = new i2(i2); + var j2: new (x: T) => T; + var j2 = new j2(j2); + + // Indexers + var k: { [n: number]: typeof k;[s: string]: typeof k }; + var k = k[0]; + var k = k['']; + + // Hybrid - contains type literals as well as type arguments + // These two are recursive + var hy1: { x: typeof hy1 }[]; + var hy1 = hy1[0].x; + var hy2: { x: Array }; + var hy2 = hy2.x[0]; + + interface Foo2 { } + + // This one should be an error because the first type argument is not contained inside a type literal + var hy3: Foo2; + ~~~ +!!! error TS2502: 'hy3' is referenced directly or indirectly in its own type annotation. + var hy3: any; \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypesWithTypeof.js b/tests/baselines/reference/recursiveTypesWithTypeof.js index 36c13405b0b..9fffd5b2604 100644 --- a/tests/baselines/reference/recursiveTypesWithTypeof.js +++ b/tests/baselines/reference/recursiveTypesWithTypeof.js @@ -1,6 +1,5 @@ //// [recursiveTypesWithTypeof.ts] -// None of these declarations should have any errors! -// Using typeof directly, these should be any +// The following are errors because of circular references var c: typeof c; var c: any; var d: typeof e; @@ -8,7 +7,6 @@ var d: any; var e: typeof d; var e: any; -// In type arguments, these should be any interface Foo { } var f: Array; var f: any; @@ -17,6 +15,7 @@ var f2: any; var f3: Foo[]; var f3: any; +// None of these declarations should have any errors! // Truly recursive types var g: { x: typeof g; }; var g: typeof g.x; @@ -49,25 +48,25 @@ var hy2 = hy2.x[0]; interface Foo2 { } -// This one should be any because the first type argument is not contained inside a type literal +// This one should be an error because the first type argument is not contained inside a type literal var hy3: Foo2; var hy3: any; //// [recursiveTypesWithTypeof.js] +// The following are errors because of circular references +var c; +var c; +var d; +var d; +var e; +var e; +var f; +var f; +var f2; +var f2; +var f3; +var f3; // None of these declarations should have any errors! -// Using typeof directly, these should be any -var c; -var c; -var d; -var d; -var e; -var e; -var f; -var f; -var f2; -var f2; -var f3; -var f3; // Truly recursive types var g; var g; @@ -94,6 +93,6 @@ var hy1; var hy1 = hy1[0].x; var hy2; var hy2 = hy2.x[0]; -// This one should be any because the first type argument is not contained inside a type literal +// This one should be an error because the first type argument is not contained inside a type literal var hy3; var hy3; diff --git a/tests/baselines/reference/recursiveTypesWithTypeof.symbols b/tests/baselines/reference/recursiveTypesWithTypeof.symbols deleted file mode 100644 index ae1a311bdf6..00000000000 --- a/tests/baselines/reference/recursiveTypesWithTypeof.symbols +++ /dev/null @@ -1,187 +0,0 @@ -=== tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts === -// None of these declarations should have any errors! -// Using typeof directly, these should be any -var c: typeof c; ->c : Symbol(c, Decl(recursiveTypesWithTypeof.ts, 2, 3), Decl(recursiveTypesWithTypeof.ts, 3, 3)) ->c : Symbol(c, Decl(recursiveTypesWithTypeof.ts, 2, 3), Decl(recursiveTypesWithTypeof.ts, 3, 3)) - -var c: any; ->c : Symbol(c, Decl(recursiveTypesWithTypeof.ts, 2, 3), Decl(recursiveTypesWithTypeof.ts, 3, 3)) - -var d: typeof e; ->d : Symbol(d, Decl(recursiveTypesWithTypeof.ts, 4, 3), Decl(recursiveTypesWithTypeof.ts, 5, 3)) ->e : Symbol(e, Decl(recursiveTypesWithTypeof.ts, 6, 3), Decl(recursiveTypesWithTypeof.ts, 7, 3)) - -var d: any; ->d : Symbol(d, Decl(recursiveTypesWithTypeof.ts, 4, 3), Decl(recursiveTypesWithTypeof.ts, 5, 3)) - -var e: typeof d; ->e : Symbol(e, Decl(recursiveTypesWithTypeof.ts, 6, 3), Decl(recursiveTypesWithTypeof.ts, 7, 3)) ->d : Symbol(d, Decl(recursiveTypesWithTypeof.ts, 4, 3), Decl(recursiveTypesWithTypeof.ts, 5, 3)) - -var e: any; ->e : Symbol(e, Decl(recursiveTypesWithTypeof.ts, 6, 3), Decl(recursiveTypesWithTypeof.ts, 7, 3)) - -// In type arguments, these should be any -interface Foo { } ->Foo : Symbol(Foo, Decl(recursiveTypesWithTypeof.ts, 7, 11)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 10, 14)) - -var f: Array; ->f : Symbol(f, Decl(recursiveTypesWithTypeof.ts, 11, 3), Decl(recursiveTypesWithTypeof.ts, 12, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->f : Symbol(f, Decl(recursiveTypesWithTypeof.ts, 11, 3), Decl(recursiveTypesWithTypeof.ts, 12, 3)) - -var f: any; ->f : Symbol(f, Decl(recursiveTypesWithTypeof.ts, 11, 3), Decl(recursiveTypesWithTypeof.ts, 12, 3)) - -var f2: Foo; ->f2 : Symbol(f2, Decl(recursiveTypesWithTypeof.ts, 13, 3), Decl(recursiveTypesWithTypeof.ts, 14, 3)) ->Foo : Symbol(Foo, Decl(recursiveTypesWithTypeof.ts, 7, 11)) ->f2 : Symbol(f2, Decl(recursiveTypesWithTypeof.ts, 13, 3), Decl(recursiveTypesWithTypeof.ts, 14, 3)) - -var f2: any; ->f2 : Symbol(f2, Decl(recursiveTypesWithTypeof.ts, 13, 3), Decl(recursiveTypesWithTypeof.ts, 14, 3)) - -var f3: Foo[]; ->f3 : Symbol(f3, Decl(recursiveTypesWithTypeof.ts, 15, 3), Decl(recursiveTypesWithTypeof.ts, 16, 3)) ->Foo : Symbol(Foo, Decl(recursiveTypesWithTypeof.ts, 7, 11)) ->f3 : Symbol(f3, Decl(recursiveTypesWithTypeof.ts, 15, 3), Decl(recursiveTypesWithTypeof.ts, 16, 3)) - -var f3: any; ->f3 : Symbol(f3, Decl(recursiveTypesWithTypeof.ts, 15, 3), Decl(recursiveTypesWithTypeof.ts, 16, 3)) - -// Truly recursive types -var g: { x: typeof g; }; ->g : Symbol(g, Decl(recursiveTypesWithTypeof.ts, 19, 3), Decl(recursiveTypesWithTypeof.ts, 20, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 19, 8)) ->g : Symbol(g, Decl(recursiveTypesWithTypeof.ts, 19, 3), Decl(recursiveTypesWithTypeof.ts, 20, 3)) - -var g: typeof g.x; ->g : Symbol(g, Decl(recursiveTypesWithTypeof.ts, 19, 3), Decl(recursiveTypesWithTypeof.ts, 20, 3)) ->g.x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 19, 8)) ->g : Symbol(g, Decl(recursiveTypesWithTypeof.ts, 19, 3), Decl(recursiveTypesWithTypeof.ts, 20, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 19, 8)) - -var h: () => typeof h; ->h : Symbol(h, Decl(recursiveTypesWithTypeof.ts, 21, 3), Decl(recursiveTypesWithTypeof.ts, 22, 3)) ->h : Symbol(h, Decl(recursiveTypesWithTypeof.ts, 21, 3), Decl(recursiveTypesWithTypeof.ts, 22, 3)) - -var h = h(); ->h : Symbol(h, Decl(recursiveTypesWithTypeof.ts, 21, 3), Decl(recursiveTypesWithTypeof.ts, 22, 3)) ->h : Symbol(h, Decl(recursiveTypesWithTypeof.ts, 21, 3), Decl(recursiveTypesWithTypeof.ts, 22, 3)) - -var i: (x: typeof i) => typeof x; ->i : Symbol(i, Decl(recursiveTypesWithTypeof.ts, 23, 3), Decl(recursiveTypesWithTypeof.ts, 24, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 23, 8)) ->i : Symbol(i, Decl(recursiveTypesWithTypeof.ts, 23, 3), Decl(recursiveTypesWithTypeof.ts, 24, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 23, 8)) - -var i = i(i); ->i : Symbol(i, Decl(recursiveTypesWithTypeof.ts, 23, 3), Decl(recursiveTypesWithTypeof.ts, 24, 3)) ->i : Symbol(i, Decl(recursiveTypesWithTypeof.ts, 23, 3), Decl(recursiveTypesWithTypeof.ts, 24, 3)) ->i : Symbol(i, Decl(recursiveTypesWithTypeof.ts, 23, 3), Decl(recursiveTypesWithTypeof.ts, 24, 3)) - -var j: (x: T) => T; ->j : Symbol(j, Decl(recursiveTypesWithTypeof.ts, 25, 3), Decl(recursiveTypesWithTypeof.ts, 26, 3)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 25, 8)) ->j : Symbol(j, Decl(recursiveTypesWithTypeof.ts, 25, 3), Decl(recursiveTypesWithTypeof.ts, 26, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 25, 28)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 25, 8)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 25, 8)) - -var j = j(j); ->j : Symbol(j, Decl(recursiveTypesWithTypeof.ts, 25, 3), Decl(recursiveTypesWithTypeof.ts, 26, 3)) ->j : Symbol(j, Decl(recursiveTypesWithTypeof.ts, 25, 3), Decl(recursiveTypesWithTypeof.ts, 26, 3)) ->j : Symbol(j, Decl(recursiveTypesWithTypeof.ts, 25, 3), Decl(recursiveTypesWithTypeof.ts, 26, 3)) - -// Same as h, i, j with construct signatures -var h2: new () => typeof h2; ->h2 : Symbol(h2, Decl(recursiveTypesWithTypeof.ts, 29, 3), Decl(recursiveTypesWithTypeof.ts, 30, 3)) ->h2 : Symbol(h2, Decl(recursiveTypesWithTypeof.ts, 29, 3), Decl(recursiveTypesWithTypeof.ts, 30, 3)) - -var h2 = new h2(); ->h2 : Symbol(h2, Decl(recursiveTypesWithTypeof.ts, 29, 3), Decl(recursiveTypesWithTypeof.ts, 30, 3)) ->h2 : Symbol(h2, Decl(recursiveTypesWithTypeof.ts, 29, 3), Decl(recursiveTypesWithTypeof.ts, 30, 3)) - -var i2: new (x: typeof i2) => typeof x; ->i2 : Symbol(i2, Decl(recursiveTypesWithTypeof.ts, 31, 3), Decl(recursiveTypesWithTypeof.ts, 32, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 31, 13)) ->i2 : Symbol(i2, Decl(recursiveTypesWithTypeof.ts, 31, 3), Decl(recursiveTypesWithTypeof.ts, 32, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 31, 13)) - -var i2 = new i2(i2); ->i2 : Symbol(i2, Decl(recursiveTypesWithTypeof.ts, 31, 3), Decl(recursiveTypesWithTypeof.ts, 32, 3)) ->i2 : Symbol(i2, Decl(recursiveTypesWithTypeof.ts, 31, 3), Decl(recursiveTypesWithTypeof.ts, 32, 3)) ->i2 : Symbol(i2, Decl(recursiveTypesWithTypeof.ts, 31, 3), Decl(recursiveTypesWithTypeof.ts, 32, 3)) - -var j2: new (x: T) => T; ->j2 : Symbol(j2, Decl(recursiveTypesWithTypeof.ts, 33, 3), Decl(recursiveTypesWithTypeof.ts, 34, 3)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 33, 13)) ->j2 : Symbol(j2, Decl(recursiveTypesWithTypeof.ts, 33, 3), Decl(recursiveTypesWithTypeof.ts, 34, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 33, 34)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 33, 13)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 33, 13)) - -var j2 = new j2(j2); ->j2 : Symbol(j2, Decl(recursiveTypesWithTypeof.ts, 33, 3), Decl(recursiveTypesWithTypeof.ts, 34, 3)) ->j2 : Symbol(j2, Decl(recursiveTypesWithTypeof.ts, 33, 3), Decl(recursiveTypesWithTypeof.ts, 34, 3)) ->j2 : Symbol(j2, Decl(recursiveTypesWithTypeof.ts, 33, 3), Decl(recursiveTypesWithTypeof.ts, 34, 3)) - -// Indexers -var k: { [n: number]: typeof k;[s: string]: typeof k }; ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) ->n : Symbol(n, Decl(recursiveTypesWithTypeof.ts, 37, 10)) ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) ->s : Symbol(s, Decl(recursiveTypesWithTypeof.ts, 37, 32)) ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) - -var k = k[0]; ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) - -var k = k['']; ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) ->k : Symbol(k, Decl(recursiveTypesWithTypeof.ts, 37, 3), Decl(recursiveTypesWithTypeof.ts, 38, 3), Decl(recursiveTypesWithTypeof.ts, 39, 3)) - -// Hybrid - contains type literals as well as type arguments -// These two are recursive -var hy1: { x: typeof hy1 }[]; ->hy1 : Symbol(hy1, Decl(recursiveTypesWithTypeof.ts, 43, 3), Decl(recursiveTypesWithTypeof.ts, 44, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 43, 10)) ->hy1 : Symbol(hy1, Decl(recursiveTypesWithTypeof.ts, 43, 3), Decl(recursiveTypesWithTypeof.ts, 44, 3)) - -var hy1 = hy1[0].x; ->hy1 : Symbol(hy1, Decl(recursiveTypesWithTypeof.ts, 43, 3), Decl(recursiveTypesWithTypeof.ts, 44, 3)) ->hy1[0].x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 43, 10)) ->hy1 : Symbol(hy1, Decl(recursiveTypesWithTypeof.ts, 43, 3), Decl(recursiveTypesWithTypeof.ts, 44, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 43, 10)) - -var hy2: { x: Array }; ->hy2 : Symbol(hy2, Decl(recursiveTypesWithTypeof.ts, 45, 3), Decl(recursiveTypesWithTypeof.ts, 46, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 45, 10)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->hy2 : Symbol(hy2, Decl(recursiveTypesWithTypeof.ts, 45, 3), Decl(recursiveTypesWithTypeof.ts, 46, 3)) - -var hy2 = hy2.x[0]; ->hy2 : Symbol(hy2, Decl(recursiveTypesWithTypeof.ts, 45, 3), Decl(recursiveTypesWithTypeof.ts, 46, 3)) ->hy2.x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 45, 10)) ->hy2 : Symbol(hy2, Decl(recursiveTypesWithTypeof.ts, 45, 3), Decl(recursiveTypesWithTypeof.ts, 46, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 45, 10)) - -interface Foo2 { } ->Foo2 : Symbol(Foo2, Decl(recursiveTypesWithTypeof.ts, 46, 19)) ->T : Symbol(T, Decl(recursiveTypesWithTypeof.ts, 48, 15)) ->U : Symbol(U, Decl(recursiveTypesWithTypeof.ts, 48, 17)) - -// This one should be any because the first type argument is not contained inside a type literal -var hy3: Foo2; ->hy3 : Symbol(hy3, Decl(recursiveTypesWithTypeof.ts, 51, 3), Decl(recursiveTypesWithTypeof.ts, 52, 3)) ->Foo2 : Symbol(Foo2, Decl(recursiveTypesWithTypeof.ts, 46, 19)) ->hy3 : Symbol(hy3, Decl(recursiveTypesWithTypeof.ts, 51, 3), Decl(recursiveTypesWithTypeof.ts, 52, 3)) ->x : Symbol(x, Decl(recursiveTypesWithTypeof.ts, 51, 27)) ->hy3 : Symbol(hy3, Decl(recursiveTypesWithTypeof.ts, 51, 3), Decl(recursiveTypesWithTypeof.ts, 52, 3)) - -var hy3: any; ->hy3 : Symbol(hy3, Decl(recursiveTypesWithTypeof.ts, 51, 3), Decl(recursiveTypesWithTypeof.ts, 52, 3)) - diff --git a/tests/baselines/reference/recursiveTypesWithTypeof.types b/tests/baselines/reference/recursiveTypesWithTypeof.types deleted file mode 100644 index 864c136743d..00000000000 --- a/tests/baselines/reference/recursiveTypesWithTypeof.types +++ /dev/null @@ -1,201 +0,0 @@ -=== tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts === -// None of these declarations should have any errors! -// Using typeof directly, these should be any -var c: typeof c; ->c : any ->c : any - -var c: any; ->c : any - -var d: typeof e; ->d : any ->e : any - -var d: any; ->d : any - -var e: typeof d; ->e : any ->d : any - -var e: any; ->e : any - -// In type arguments, these should be any -interface Foo { } ->Foo : Foo ->T : T - -var f: Array; ->f : any ->Array : T[] ->f : any - -var f: any; ->f : any - -var f2: Foo; ->f2 : any ->Foo : Foo ->f2 : any - -var f2: any; ->f2 : any - -var f3: Foo[]; ->f3 : any ->Foo : Foo ->f3 : any - -var f3: any; ->f3 : any - -// Truly recursive types -var g: { x: typeof g; }; ->g : { x: any; } ->x : { x: any; } ->g : { x: any; } - -var g: typeof g.x; ->g : { x: any; } ->g.x : { x: any; } ->g : { x: any; } ->x : { x: any; } - -var h: () => typeof h; ->h : () => any ->h : () => any - -var h = h(); ->h : () => any ->h() : () => any ->h : () => any - -var i: (x: typeof i) => typeof x; ->i : (x: any) => any ->x : (x: any) => any ->i : (x: any) => any ->x : (x: any) => any - -var i = i(i); ->i : (x: any) => any ->i(i) : (x: any) => any ->i : (x: any) => any ->i : (x: any) => any - -var j: (x: T) => T; ->j : (x: T) => T ->T : T ->j : (x: T) => T ->x : T ->T : T ->T : T - -var j = j(j); ->j : (x: T) => T ->j(j) : (x: T) => T ->j : (x: T) => T ->j : (x: T) => T - -// Same as h, i, j with construct signatures -var h2: new () => typeof h2; ->h2 : new () => any ->h2 : new () => any - -var h2 = new h2(); ->h2 : new () => any ->new h2() : new () => any ->h2 : new () => any - -var i2: new (x: typeof i2) => typeof x; ->i2 : new (x: any) => any ->x : new (x: any) => any ->i2 : new (x: any) => any ->x : new (x: any) => any - -var i2 = new i2(i2); ->i2 : new (x: any) => any ->new i2(i2) : new (x: any) => any ->i2 : new (x: any) => any ->i2 : new (x: any) => any - -var j2: new (x: T) => T; ->j2 : new (x: T) => T ->T : T ->j2 : new (x: T) => T ->x : T ->T : T ->T : T - -var j2 = new j2(j2); ->j2 : new (x: T) => T ->new j2(j2) : new (x: T) => T ->j2 : new (x: T) => T ->j2 : new (x: T) => T - -// Indexers -var k: { [n: number]: typeof k;[s: string]: typeof k }; ->k : { [s: string]: any; [n: number]: any; } ->n : number ->k : { [s: string]: any; [n: number]: any; } ->s : string ->k : { [s: string]: any; [n: number]: any; } - -var k = k[0]; ->k : { [s: string]: any; [n: number]: any; } ->k[0] : { [s: string]: any; [n: number]: any; } ->k : { [s: string]: any; [n: number]: any; } ->0 : number - -var k = k['']; ->k : { [s: string]: any; [n: number]: any; } ->k[''] : { [s: string]: any; [n: number]: any; } ->k : { [s: string]: any; [n: number]: any; } ->'' : string - -// Hybrid - contains type literals as well as type arguments -// These two are recursive -var hy1: { x: typeof hy1 }[]; ->hy1 : { x: any[]; }[] ->x : { x: any[]; }[] ->hy1 : { x: any[]; }[] - -var hy1 = hy1[0].x; ->hy1 : { x: any[]; }[] ->hy1[0].x : { x: any[]; }[] ->hy1[0] : { x: any[]; } ->hy1 : { x: any[]; }[] ->0 : number ->x : { x: any[]; }[] - -var hy2: { x: Array }; ->hy2 : { x: any[]; } ->x : { x: any[]; }[] ->Array : T[] ->hy2 : { x: any[]; } - -var hy2 = hy2.x[0]; ->hy2 : { x: any[]; } ->hy2.x[0] : { x: any[]; } ->hy2.x : { x: any[]; }[] ->hy2 : { x: any[]; } ->x : { x: any[]; }[] ->0 : number - -interface Foo2 { } ->Foo2 : Foo2 ->T : T ->U : U - -// This one should be any because the first type argument is not contained inside a type literal -var hy3: Foo2; ->hy3 : any ->Foo2 : Foo2 ->hy3 : any ->x : any ->hy3 : any - -var hy3: any; ->hy3 : any - diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index c0abe985dbc..60022dc245a 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -30,7 +30,7 @@ declare module MsPortal.Controls.Base.ItemList { */ //// [recursivelySpecializedConstructorDeclaration.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/relativePathMustResolve.errors.txt b/tests/baselines/reference/relativePathMustResolve.errors.txt index 700913f65d7..1ff89a74623 100644 --- a/tests/baselines/reference/relativePathMustResolve.errors.txt +++ b/tests/baselines/reference/relativePathMustResolve.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find external module './test/foo'. +tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find module './test/foo'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require('./test/foo'); ~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module './test/foo'. +!!! error TS2307: Cannot find module './test/foo'. var z = foo.x + 10; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/relativePathToDeclarationFile.errors.txt b/tests/baselines/reference/relativePathToDeclarationFile.errors.txt index 51ea1f54c4c..041dd5c3a8f 100644 --- a/tests/baselines/reference/relativePathToDeclarationFile.errors.txt +++ b/tests/baselines/reference/relativePathToDeclarationFile.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/test/foo.d.ts(1,23): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/test/foo.d.ts(1,23): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/test/file1.ts (0 errors) ==== @@ -13,7 +13,7 @@ tests/cases/conformance/externalModules/test/foo.d.ts(1,23): error TS1148: Canno ==== tests/cases/conformance/externalModules/test/foo.d.ts (1 errors) ==== export declare module M2 { ~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export var x: boolean; } diff --git a/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt b/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt index ca5f178193b..7094bc6699f 100644 --- a/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt +++ b/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/requireOfAnEmptyFile1_a.ts(3,21): error TS2306: File 'tests/cases/compiler/requireOfAnEmptyFile1_b.ts' is not an external module. +tests/cases/compiler/requireOfAnEmptyFile1_a.ts(3,21): error TS2306: File 'tests/cases/compiler/requireOfAnEmptyFile1_b.ts' is not a module. ==== tests/cases/compiler/requireOfAnEmptyFile1_a.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/compiler/requireOfAnEmptyFile1_a.ts(3,21): error TS2306: File 'tests import fs = require('requireOfAnEmptyFile1_b'); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2306: File 'requireOfAnEmptyFile1_b.ts' is not an external module. +!!! error TS2306: File 'requireOfAnEmptyFile1_b.ts' is not a module. ==== tests/cases/compiler/requireOfAnEmptyFile1_b.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/reservedWords2.errors.txt b/tests/baselines/reference/reservedWords2.errors.txt index 3b3fe2c502c..471eef4710a 100644 --- a/tests/baselines/reference/reservedWords2.errors.txt +++ b/tests/baselines/reference/reservedWords2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/reservedWords2.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/reservedWords2.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/reservedWords2.ts(1,8): error TS1109: Expression expected. tests/cases/compiler/reservedWords2.ts(1,14): error TS1005: '(' expected. tests/cases/compiler/reservedWords2.ts(1,16): error TS2304: Cannot find name 'require'. @@ -34,7 +34,7 @@ tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. ==== tests/cases/compiler/reservedWords2.ts (31 errors) ==== import while = require("dfdf"); ~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~ !!! error TS1109: Expression expected. ~ diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 24f0e7f1bcb..72cc702309c 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1020,7 +1020,7 @@ module caurinus { //// [resolvingClassDeclarationWhenInBaseTypeResolution.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index 0096c4d65b6..87b1b6d672a 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -67,7 +67,7 @@ class I extends G { //// [returnInConstructor1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index 77b6ae1f774..35c208b19ee 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -25,7 +25,7 @@ function fn13(): C { return null; } //// [returnStatements.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/scannerClass2.errors.txt b/tests/baselines/reference/scannerClass2.errors.txt index 7a59478ade2..74b62602dad 100644 --- a/tests/baselines/reference/scannerClass2.errors.txt +++ b/tests/baselines/reference/scannerClass2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts(3,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts(3,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts(3,43): error TS2304: Cannot find name 'ILogger'. tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts(4,37): error TS2304: Cannot find name 'ILogger'. tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts(5,18): error TS2339: Property '_information' does not exist on type 'LoggerAdapter'. @@ -9,7 +9,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts(5,18): error TS2339 export class LoggerAdapter implements ILogger { ~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ~~~~~~~ !!! error TS2304: Cannot find name 'ILogger'. constructor (public logger: ILogger) { diff --git a/tests/baselines/reference/scannerEnum1.errors.txt b/tests/baselines/reference/scannerEnum1.errors.txt index b55fa92503c..64d7508980f 100644 --- a/tests/baselines/reference/scannerEnum1.errors.txt +++ b/tests/baselines/reference/scannerEnum1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/scanner/ecmascript5/scannerEnum1.ts(1,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/scanner/ecmascript5/scannerEnum1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/scanner/ecmascript5/scannerEnum1.ts (1 errors) ==== export enum CodeGenTarget { ~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. ES3 = 0, ES5 = 1, } \ No newline at end of file diff --git a/tests/baselines/reference/scannerImportDeclaration1.errors.txt b/tests/baselines/reference/scannerImportDeclaration1.errors.txt index 243670c6854..d8378248d51 100644 --- a/tests/baselines/reference/scannerImportDeclaration1.errors.txt +++ b/tests/baselines/reference/scannerImportDeclaration1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerImportDeclaration1.ts(1,21): error TS2304: Cannot find name 'TypeScriptServices'. +tests/cases/conformance/scanner/ecmascript5/scannerImportDeclaration1.ts(1,21): error TS2503: Cannot find namespace 'TypeScriptServices'. ==== tests/cases/conformance/scanner/ecmascript5/scannerImportDeclaration1.ts (1 errors) ==== import TypeScript = TypeScriptServices.TypeScript; ~~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'TypeScriptServices'. \ No newline at end of file +!!! error TS2503: Cannot find namespace 'TypeScriptServices'. \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index 23b6f2f7e50..f971f089741 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -9,7 +9,7 @@ class D extends C { } //// [scopeCheckExtendedClassInsidePublicMethod2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js index 7e604118f52..a7f7f4fde99 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -9,7 +9,7 @@ class D extends C { } //// [scopeCheckExtendedClassInsideStaticMethod1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index c21a821100e..99a933cf157 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -12,7 +12,7 @@ class D extends C { } //// [scopeTests.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/separateCompilationImportExportElision.errors.txt b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt index db418681e83..0bac01d8134 100644 --- a/tests/baselines/reference/separateCompilationImportExportElision.errors.txt +++ b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/separateCompilationImportExportElision.ts(2,17): error TS2307: Cannot find external module 'module'. -tests/cases/compiler/separateCompilationImportExportElision.ts(3,18): error TS2307: Cannot find external module 'module'. -tests/cases/compiler/separateCompilationImportExportElision.ts(4,21): error TS2307: Cannot find external module 'module'. -tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2307: Cannot find external module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(2,17): error TS2307: Cannot find module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(3,18): error TS2307: Cannot find module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(4,21): error TS2307: Cannot find module 'module'. +tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2307: Cannot find module 'module'. ==== tests/cases/compiler/separateCompilationImportExportElision.ts (4 errors) ==== import {c} from "module" ~~~~~~~~ -!!! error TS2307: Cannot find external module 'module'. +!!! error TS2307: Cannot find module 'module'. import {c2} from "module" ~~~~~~~~ -!!! error TS2307: Cannot find external module 'module'. +!!! error TS2307: Cannot find module 'module'. import * as ns from "module" ~~~~~~~~ -!!! error TS2307: Cannot find external module 'module'. +!!! error TS2307: Cannot find module 'module'. class C extends c2.C { } @@ -24,5 +24,5 @@ tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2 export {c1} from "module"; ~~~~~~~~ -!!! error TS2307: Cannot find external module 'module'. +!!! error TS2307: Cannot find module 'module'. export var z = x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationImportExportElision.js b/tests/baselines/reference/separateCompilationImportExportElision.js index 2d255798c3f..cfa57980249 100644 --- a/tests/baselines/reference/separateCompilationImportExportElision.js +++ b/tests/baselines/reference/separateCompilationImportExportElision.js @@ -14,7 +14,7 @@ export {c1} from "module"; export var z = x; //// [separateCompilationImportExportElision.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt index 269727584d4..71d7da73a80 100644 --- a/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt +++ b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/separateCompilationNoExternalModule.ts(2,1): error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. +tests/cases/compiler/separateCompilationNoExternalModule.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. ==== tests/cases/compiler/separateCompilationNoExternalModule.ts (1 errors) ==== var x; ~~~ -!!! error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. \ No newline at end of file +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationOut.errors.txt b/tests/baselines/reference/separateCompilationOut.errors.txt index 7c2631a7182..9017809901f 100644 --- a/tests/baselines/reference/separateCompilationOut.errors.txt +++ b/tests/baselines/reference/separateCompilationOut.errors.txt @@ -1,5 +1,5 @@ error TS5046: Option 'out' cannot be specified with option 'separateCompilation'. -tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. +tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. !!! error TS5046: Option 'out' cannot be specified with option 'separateCompilation'. @@ -9,4 +9,4 @@ tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile non-external mo ==== tests/cases/compiler/file2.ts (1 errors) ==== var y; ~~~ -!!! error TS1208: Cannot compile non-external modules when the '--separateCompilation' flag is provided. \ No newline at end of file +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-AMD.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-AMD.errors.txt new file mode 100644 index 00000000000..6b80da30d33 --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-AMD.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationPlainFile-AMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationPlainFile-AMD.ts (1 errors) ==== + + declare function run(a: number): void; + ~~~~~~~ +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + run(1); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-AMD.js b/tests/baselines/reference/separateCompilationPlainFile-AMD.js new file mode 100644 index 00000000000..e3e9fc1eaeb --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-AMD.js @@ -0,0 +1,10 @@ +//// [separateCompilationPlainFile-AMD.ts] + +declare function run(a: number): void; +run(1); + + +//// [separateCompilationPlainFile-AMD.js] +define(["require", "exports"], function (require, exports) { + run(1); +}); diff --git a/tests/baselines/reference/separateCompilationPlainFile-CommonJS.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-CommonJS.errors.txt new file mode 100644 index 00000000000..48a23a39653 --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-CommonJS.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts (1 errors) ==== + + declare function run(a: number): void; + ~~~~~~~ +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + run(1); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-CommonJS.js b/tests/baselines/reference/separateCompilationPlainFile-CommonJS.js new file mode 100644 index 00000000000..cd82cdf20a6 --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-CommonJS.js @@ -0,0 +1,8 @@ +//// [separateCompilationPlainFile-CommonJS.ts] + +declare function run(a: number): void; +run(1); + + +//// [separateCompilationPlainFile-CommonJS.js] +run(1); diff --git a/tests/baselines/reference/separateCompilationPlainFile-ES6.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-ES6.errors.txt new file mode 100644 index 00000000000..b0b059c73bd --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-ES6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationPlainFile-ES6.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationPlainFile-ES6.ts (1 errors) ==== + + declare function run(a: number): void; + ~~~~~~~ +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + run(1); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-ES6.js b/tests/baselines/reference/separateCompilationPlainFile-ES6.js new file mode 100644 index 00000000000..1cb6082f134 --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-ES6.js @@ -0,0 +1,8 @@ +//// [separateCompilationPlainFile-ES6.ts] + +declare function run(a: number): void; +run(1); + + +//// [separateCompilationPlainFile-ES6.js] +run(1); diff --git a/tests/baselines/reference/separateCompilationPlainFile-System.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-System.errors.txt new file mode 100644 index 00000000000..c3161c57275 --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-System.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationPlainFile-System.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationPlainFile-System.ts (1 errors) ==== + + declare function run(a: number): void; + ~~~~~~~ +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + run(1); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-System.js b/tests/baselines/reference/separateCompilationPlainFile-System.js new file mode 100644 index 00000000000..c256ed7862a --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-System.js @@ -0,0 +1,15 @@ +//// [separateCompilationPlainFile-System.ts] + +declare function run(a: number): void; +run(1); + + +//// [separateCompilationPlainFile-System.js] +System.register([], function(exports_1) { + return { + setters:[], + execute: function() { + run(1); + } + } +}); diff --git a/tests/baselines/reference/separateCompilationPlainFile-UMD.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-UMD.errors.txt new file mode 100644 index 00000000000..6a0fb1ac8df --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-UMD.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/separateCompilationPlainFile-UMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + + +==== tests/cases/compiler/separateCompilationPlainFile-UMD.ts (1 errors) ==== + + declare function run(a: number): void; + ~~~~~~~ +!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. + run(1); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-UMD.js b/tests/baselines/reference/separateCompilationPlainFile-UMD.js new file mode 100644 index 00000000000..6a145e7d239 --- /dev/null +++ b/tests/baselines/reference/separateCompilationPlainFile-UMD.js @@ -0,0 +1,17 @@ +//// [separateCompilationPlainFile-UMD.ts] + +declare function run(a: number): void; +run(1); + + +//// [separateCompilationPlainFile-UMD.js] +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports"], function (require, exports) { + run(1); +}); diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index 098a7914a71..4100dba13e3 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -4,7 +4,7 @@ class derived extends base { private n() {} } //// [shadowPrivateMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js.map b/tests/baselines/reference/sourceMap-FileWithComments.js.map index 7e38a53a902..fc27b8542d0 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.js.map +++ b/tests/baselines/reference/sourceMap-FileWithComments.js.map @@ -1,2 +1,2 @@ //// [sourceMap-FileWithComments.js.map] -{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":["Shapes","Shapes.Point","Shapes.Point.constructor","Shapes.Point.getDist","Shapes.foo"],"mappings":"AAMA,SAAS;AACT,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM,EAAC,CAAC;IAEXA,QAAQA;IACRA;QACIC,cAAcA;QACdA,eAAmBA,CAASA,EAASA,CAASA;YAA3BC,MAACA,GAADA,CAACA,CAAQA;YAASA,MAACA,GAADA,CAACA,CAAQA;QAAIA,CAACA;QAEnDD,kBAAkBA;QAClBA,uBAAOA,GAAPA,cAAYE,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;QAElEF,gBAAgBA;QACTA,YAAMA,GAAGA,IAAIA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;QACpCA,YAACA;IAADA,CAACA,AATDD,IASCA;IATYA,YAAKA,QASjBA,CAAAA;IAEDA,+BAA+BA;IAC/BA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IAEXA;IACAI,CAACA;IADeJ,UAAGA,MAClBA,CAAAA;IAEDA;;MAEEA;IACFA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;AACfA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAED,qBAAqB;AACrB,IAAI,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":["Shapes","Shapes.Point","Shapes.Point.constructor","Shapes.Point.getDist","Shapes.foo"],"mappings":"AAOA,AADA,SAAS;AACT,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM,EAAC,CAAC;IAGXA,AADAA,QAAQA;;QAEJC,cAAcA;QACdA,eAAmBA,CAASA,EAASA,CAASA;YAA3BC,MAACA,GAADA,CAACA,CAAQA;YAASA,MAACA,GAADA,CAACA,CAAQA;QAAIA,CAACA;QAEnDD,kBAAkBA;QAClBA,uBAAOA,GAAPA,cAAYE,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;QAElEF,gBAAgBA;QACTA,YAAMA,GAAGA,IAAIA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;QACpCA,YAACA;IAADA,CAACA,AATDD,IASCA;IATYA,YAAKA,QASjBA,CAAAA;IAGDA,AADAA,+BAA+BA;QAC3BA,CAACA,GAAGA,EAAEA,CAACA;IAEXA;IACAI,CAACA;IADeJ,UAAGA,MAClBA,CAAAA;IAKDA,AAHAA;;MAEEA;QACEA,CAACA,GAAGA,EAAEA,CAACA;AACfA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAGD,AADA,qBAAqB;IACjB,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt index 8f8fd8e84b3..8283006042a 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt @@ -10,18 +10,22 @@ sourceFile:sourceMap-FileWithComments.ts ------------------------------------------------------------------- >>>// Module 1 > -2 >^^^^^^^^^ -3 > ^^^-> +2 > +3 >^^^^^^^^^ +4 > ^^^-> 1 > >// Interface >interface IPoint { > getDist(): number; >} > + >// Module > -2 >// Module -1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(1, 10) Source(7, 10) + SourceIndex(0) +2 > +3 >// Module +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +3 >Emitted(1, 10) Source(7, 10) + SourceIndex(0) --- >>>var Shapes; 1-> @@ -82,27 +86,26 @@ sourceFile:sourceMap-FileWithComments.ts --- >>> // Class 1 >^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^-> +2 > +3 > ^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> 1 > > + > // Class > -2 > // Class -1 >Emitted(4, 5) Source(10, 5) + SourceIndex(0) name (Shapes) -2 >Emitted(4, 13) Source(10, 13) + SourceIndex(0) name (Shapes) +2 > +3 > // Class +1 >Emitted(4, 5) Source(11, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(4, 5) Source(10, 5) + SourceIndex(0) name (Shapes) +3 >Emitted(4, 13) Source(10, 13) + SourceIndex(0) name (Shapes) --- >>> var Point = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) name (Shapes) ---- >>> // Constructor 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^ 3 > ^^^^^^^^^-> -1->export class Point implements IPoint { +1-> + > export class Point implements IPoint { > 2 > // Constructor 1->Emitted(6, 9) Source(12, 9) + SourceIndex(0) name (Shapes.Point) @@ -377,35 +380,36 @@ sourceFile:sourceMap-FileWithComments.ts --- >>> // Variable comment after class 1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Variable comment after class > -2 > // Variable comment after class -1->Emitted(18, 5) Source(22, 5) + SourceIndex(0) name (Shapes) -2 >Emitted(18, 36) Source(22, 36) + SourceIndex(0) name (Shapes) +2 > +3 > // Variable comment after class +1->Emitted(18, 5) Source(23, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(18, 5) Source(22, 5) + SourceIndex(0) name (Shapes) +3 >Emitted(18, 36) Source(22, 36) + SourceIndex(0) name (Shapes) --- >>> var a = 10; -1 >^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^-> +1 >^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^-> 1 > - > -2 > var -3 > a -4 > = -5 > 10 -6 > ; -1 >Emitted(19, 5) Source(23, 5) + SourceIndex(0) name (Shapes) -2 >Emitted(19, 9) Source(23, 9) + SourceIndex(0) name (Shapes) -3 >Emitted(19, 10) Source(23, 10) + SourceIndex(0) name (Shapes) -4 >Emitted(19, 13) Source(23, 13) + SourceIndex(0) name (Shapes) -5 >Emitted(19, 15) Source(23, 15) + SourceIndex(0) name (Shapes) -6 >Emitted(19, 16) Source(23, 16) + SourceIndex(0) name (Shapes) + > var +2 > a +3 > = +4 > 10 +5 > ; +1 >Emitted(19, 9) Source(23, 9) + SourceIndex(0) name (Shapes) +2 >Emitted(19, 10) Source(23, 10) + SourceIndex(0) name (Shapes) +3 >Emitted(19, 13) Source(23, 13) + SourceIndex(0) name (Shapes) +4 >Emitted(19, 15) Source(23, 15) + SourceIndex(0) name (Shapes) +5 >Emitted(19, 16) Source(23, 16) + SourceIndex(0) name (Shapes) --- >>> function foo() { 1->^^^^ @@ -443,11 +447,17 @@ sourceFile:sourceMap-FileWithComments.ts --- >>> /** comment after function 1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > + > /** comment after function + > * this is another comment + > */ > -1->Emitted(23, 5) Source(28, 5) + SourceIndex(0) name (Shapes) +2 > +1->Emitted(23, 5) Source(31, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(23, 5) Source(28, 5) + SourceIndex(0) name (Shapes) --- >>> * this is another comment >>> */ @@ -459,26 +469,23 @@ sourceFile:sourceMap-FileWithComments.ts 1->Emitted(25, 7) Source(30, 7) + SourceIndex(0) name (Shapes) --- >>> var b = 10; -1->^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^^^-> +1->^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> 1-> - > -2 > var -3 > b -4 > = -5 > 10 -6 > ; -1->Emitted(26, 5) Source(31, 5) + SourceIndex(0) name (Shapes) -2 >Emitted(26, 9) Source(31, 9) + SourceIndex(0) name (Shapes) -3 >Emitted(26, 10) Source(31, 10) + SourceIndex(0) name (Shapes) -4 >Emitted(26, 13) Source(31, 13) + SourceIndex(0) name (Shapes) -5 >Emitted(26, 15) Source(31, 15) + SourceIndex(0) name (Shapes) -6 >Emitted(26, 16) Source(31, 16) + SourceIndex(0) name (Shapes) + > var +2 > b +3 > = +4 > 10 +5 > ; +1->Emitted(26, 9) Source(31, 9) + SourceIndex(0) name (Shapes) +2 >Emitted(26, 10) Source(31, 10) + SourceIndex(0) name (Shapes) +3 >Emitted(26, 13) Source(31, 13) + SourceIndex(0) name (Shapes) +4 >Emitted(26, 15) Source(31, 15) + SourceIndex(0) name (Shapes) +5 >Emitted(26, 16) Source(31, 16) + SourceIndex(0) name (Shapes) --- >>>})(Shapes || (Shapes = {})); 1-> @@ -530,59 +537,60 @@ sourceFile:sourceMap-FileWithComments.ts --- >>>/** Local Variable */ 1 > -2 >^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^-> +2 > +3 >^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^-> 1 > > + >/** Local Variable */ > -2 >/** Local Variable */ -1 >Emitted(28, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(28, 22) Source(34, 22) + SourceIndex(0) +2 > +3 >/** Local Variable */ +1 >Emitted(28, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(28, 1) Source(34, 1) + SourceIndex(0) +3 >Emitted(28, 22) Source(34, 22) + SourceIndex(0) --- >>>var p = new Shapes.Point(3, 4); -1-> -2 >^^^^ -3 > ^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^^ -7 > ^ -8 > ^^^^^ -9 > ^ -10> ^ -11> ^^ -12> ^ -13> ^ -14> ^ +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^^ +11> ^ +12> ^ +13> ^ 1-> - > -2 >var -3 > p -4 > : IPoint = -5 > new -6 > Shapes -7 > . -8 > Point -9 > ( -10> 3 -11> , -12> 4 -13> ) -14> ; -1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) -3 >Emitted(29, 6) Source(35, 6) + SourceIndex(0) -4 >Emitted(29, 9) Source(35, 17) + SourceIndex(0) -5 >Emitted(29, 13) Source(35, 21) + SourceIndex(0) -6 >Emitted(29, 19) Source(35, 27) + SourceIndex(0) -7 >Emitted(29, 20) Source(35, 28) + SourceIndex(0) -8 >Emitted(29, 25) Source(35, 33) + SourceIndex(0) -9 >Emitted(29, 26) Source(35, 34) + SourceIndex(0) -10>Emitted(29, 27) Source(35, 35) + SourceIndex(0) -11>Emitted(29, 29) Source(35, 37) + SourceIndex(0) -12>Emitted(29, 30) Source(35, 38) + SourceIndex(0) -13>Emitted(29, 31) Source(35, 39) + SourceIndex(0) -14>Emitted(29, 32) Source(35, 40) + SourceIndex(0) + >var +2 > p +3 > : IPoint = +4 > new +5 > Shapes +6 > . +7 > Point +8 > ( +9 > 3 +10> , +11> 4 +12> ) +13> ; +1->Emitted(29, 5) Source(35, 5) + SourceIndex(0) +2 >Emitted(29, 6) Source(35, 6) + SourceIndex(0) +3 >Emitted(29, 9) Source(35, 17) + SourceIndex(0) +4 >Emitted(29, 13) Source(35, 21) + SourceIndex(0) +5 >Emitted(29, 19) Source(35, 27) + SourceIndex(0) +6 >Emitted(29, 20) Source(35, 28) + SourceIndex(0) +7 >Emitted(29, 25) Source(35, 33) + SourceIndex(0) +8 >Emitted(29, 26) Source(35, 34) + SourceIndex(0) +9 >Emitted(29, 27) Source(35, 35) + SourceIndex(0) +10>Emitted(29, 29) Source(35, 37) + SourceIndex(0) +11>Emitted(29, 30) Source(35, 38) + SourceIndex(0) +12>Emitted(29, 31) Source(35, 39) + SourceIndex(0) +13>Emitted(29, 32) Source(35, 40) + SourceIndex(0) --- >>>var dist = p.getDist(); 1 > diff --git a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js.map b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js.map index 7f660400470..217105d88d2 100644 --- a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js.map +++ b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js.map @@ -1,2 +1,2 @@ //// [sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js.map] -{"version":3,"file":"sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js","sourceRoot":"","sources":["sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.ts"],"names":["Q","Q.P"],"mappings":"AAAA,IAAO,CAAC,CAKP;AALD,WAAO,CAAC,EAAC,CAAC;IACNA;QACIC,YAAYA;QACZA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACdA,CAACA;AACLD,CAACA,EALM,CAAC,KAAD,CAAC,QAKP"} \ No newline at end of file +{"version":3,"file":"sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.js","sourceRoot":"","sources":["sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.ts"],"names":["Q","Q.P"],"mappings":"AAAA,IAAO,CAAC,CAKP;AALD,WAAO,CAAC,EAAC,CAAC;IACNA;QAEIC,AADAA,YAAYA;YACRA,CAACA,GAAGA,CAACA,CAACA;IACdA,CAACA;AACLD,CAACA,EALM,CAAC,KAAD,CAAC,QAKP"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.sourcemap.txt b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.sourcemap.txt index 5413f4bbc23..669481b46a2 100644 --- a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.sourcemap.txt +++ b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.sourcemap.txt @@ -55,33 +55,34 @@ sourceFile:sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.t --- >>> // Test this 1->^^^^^^^^ -2 > ^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^ 1->function P() { + > // Test this > -2 > // Test this -1->Emitted(4, 9) Source(3, 9) + SourceIndex(0) name (Q.P) -2 >Emitted(4, 21) Source(3, 21) + SourceIndex(0) name (Q.P) +2 > +3 > // Test this +1->Emitted(4, 9) Source(4, 9) + SourceIndex(0) name (Q.P) +2 >Emitted(4, 9) Source(3, 9) + SourceIndex(0) name (Q.P) +3 >Emitted(4, 21) Source(3, 21) + SourceIndex(0) name (Q.P) --- >>> var a = 1; -1 >^^^^^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^ 1 > - > -2 > var -3 > a -4 > = -5 > 1 -6 > ; -1 >Emitted(5, 9) Source(4, 9) + SourceIndex(0) name (Q.P) -2 >Emitted(5, 13) Source(4, 13) + SourceIndex(0) name (Q.P) -3 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (Q.P) -4 >Emitted(5, 17) Source(4, 17) + SourceIndex(0) name (Q.P) -5 >Emitted(5, 18) Source(4, 18) + SourceIndex(0) name (Q.P) -6 >Emitted(5, 19) Source(4, 19) + SourceIndex(0) name (Q.P) + > var +2 > a +3 > = +4 > 1 +5 > ; +1 >Emitted(5, 13) Source(4, 13) + SourceIndex(0) name (Q.P) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (Q.P) +3 >Emitted(5, 17) Source(4, 17) + SourceIndex(0) name (Q.P) +4 >Emitted(5, 18) Source(4, 18) + SourceIndex(0) name (Q.P) +5 >Emitted(5, 19) Source(4, 19) + SourceIndex(0) name (Q.P) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.js.map b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.js.map index bdfba243ab6..7a84caf3879 100644 --- a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.js.map +++ b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.js.map @@ -1,2 +1,2 @@ //// [sourceMapForFunctionWithCommentPrecedingStatement01.js.map] -{"version":3,"file":"sourceMapForFunctionWithCommentPrecedingStatement01.js","sourceRoot":"","sources":["sourceMapForFunctionWithCommentPrecedingStatement01.ts"],"names":["P"],"mappings":"AAAA;IACIA,YAAYA;IACZA,IAAIA,CAACA,GAAGA,CAACA,CAACA;AACdA,CAACA"} \ No newline at end of file +{"version":3,"file":"sourceMapForFunctionWithCommentPrecedingStatement01.js","sourceRoot":"","sources":["sourceMapForFunctionWithCommentPrecedingStatement01.ts"],"names":["P"],"mappings":"AAAA;IAEIA,AADAA,YAAYA;QACRA,CAACA,GAAGA,CAACA,CAACA;AACdA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.sourcemap.txt b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.sourcemap.txt index 65037c69437..cbeed192d31 100644 --- a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.sourcemap.txt +++ b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.sourcemap.txt @@ -16,33 +16,34 @@ sourceFile:sourceMapForFunctionWithCommentPrecedingStatement01.ts --- >>> // Test this 1->^^^^ -2 > ^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^ 1->function P() { + > // Test this > -2 > // Test this -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (P) -2 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) name (P) +2 > +3 > // Test this +1->Emitted(2, 5) Source(3, 5) + SourceIndex(0) name (P) +2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (P) +3 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) name (P) --- >>> var a = 1; -1 >^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ +1 >^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^ 1 > - > -2 > var -3 > a -4 > = -5 > 1 -6 > ; -1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) name (P) -2 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (P) -3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) name (P) -4 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) name (P) -5 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) name (P) -6 >Emitted(3, 15) Source(3, 15) + SourceIndex(0) name (P) + > var +2 > a +3 > = +4 > 1 +5 > ; +1 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (P) +2 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) name (P) +3 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) name (P) +4 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) name (P) +5 >Emitted(3, 15) Source(3, 15) + SourceIndex(0) name (P) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 94d91cc03cb..cae6e991e24 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -8,7 +8,7 @@ class Greeter extends AbstractGreeter { } //// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt index 96b52724320..d0934f3c9ed 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -8,7 +8,7 @@ sources: sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts ------------------------------------------------------------------- ->>>var __extends = this.__extends || function (d, b) { +>>>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; } >>> __.prototype = b.prototype; diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map index fcba248ef1a..e3ffe2de454 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":["Foo","Foo.Bar","Foo.Bar.Greeter","Foo.Bar.Greeter.constructor","Foo.Bar.Greeter.greet","Foo.Bar.foo","Foo.Bar.foo2"],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAACA,IAAAA,GAAGA,CAmCbA;IAnCUA,WAAAA,GAAGA,EAACA,CAACA;QACZC,YAAYA,CAACA;QAEbA;YACIC,iBAAmBA,QAAgBA;gBAAhBC,aAAQA,GAARA,QAAQA,CAAQA;YACnCA,CAACA;YAEDD,uBAAKA,GAALA;gBACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;YAC5CA,CAACA;YACLF,cAACA;QAADA,CAACA,AAPDD,IAOCA;QAGDA,aAAaA,QAAgBA;YACzBI,MAAMA,CAACA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QACjCA,CAACA;QAEDJ,IAAIA,OAAOA,GAAGA,IAAIA,OAAOA,CAACA,eAAeA,CAACA,CAACA;QAC3CA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,KAAKA,EAAEA,CAACA;QAE1BA,cAAcA,QAAgBA;YAAEK,kBAAiBA,mBAAmBA,MAAUA;iBAA9CA,WAA8CA,CAA9CA,sBAA8CA,CAA9CA,IAA8CA;gBAA9CA,cAAiBA,mBAAmBA,yBAAUA;;YAC1EA,IAAIA,QAAQA,GAAcA,EAAEA,CAACA,CAACA,0BAA0BA;YACxDA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;YACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC5CA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,OAAOA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACjDA,CAACA;YAEDA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA;QAEDL,IAAIA,CAACA,GAAGA,IAAIA,CAACA,OAAOA,EAAEA,OAAOA,EAAEA,GAAGA,CAACA,CAACA;QACpCA,qCAAqCA;QACrCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChCA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACjBA,CAACA;IACLA,CAACA,EAnCUD,GAAGA,GAAHA,OAAGA,KAAHA,OAAGA,QAmCbA;AAADA,CAACA,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":["Foo","Foo.Bar","Foo.Bar.Greeter","Foo.Bar.Greeter.constructor","Foo.Bar.Greeter.greet","Foo.Bar.foo","Foo.Bar.foo2"],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAACA,IAAAA,GAAGA,CAmCbA;IAnCUA,WAAAA,GAAGA,EAACA,CAACA;QACZC,YAAYA,CAACA;QAEbA;YACIC,iBAAmBA,QAAgBA;gBAAhBC,aAAQA,GAARA,QAAQA,CAAQA;YACnCA,CAACA;YAEDD,uBAAKA,GAALA;gBACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;YAC5CA,CAACA;YACLF,cAACA;QAADA,CAACA,AAPDD,IAOCA;QAGDA,aAAaA,QAAgBA;YACzBI,MAAMA,CAACA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QACjCA,CAACA;QAEDJ,IAAIA,OAAOA,GAAGA,IAAIA,OAAOA,CAACA,eAAeA,CAACA,CAACA;QAC3CA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,KAAKA,EAAEA,CAACA;QAE1BA,cAAcA,QAAgBA;YAAEK,kBAAiBA,mBAAmBA,MAAUA;iBAA9CA,WAA8CA,CAA9CA,sBAA8CA,CAA9CA,IAA8CA;gBAA9CA,cAAiBA,mBAAmBA,yBAAUA;;YAC1EA,IAAIA,QAAQA,GAAcA,EAAEA,EAAEA,0BAA0BA,AAA3BA;YAC7BA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;YACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC5CA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,OAAOA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACjDA,CAACA;YAEDA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA;QAEDL,IAAIA,CAACA,GAAGA,IAAIA,CAACA,OAAOA,EAAEA,OAAOA,EAAEA,GAAGA,CAACA,CAACA;QAEpCA,AADAA,qCAAqCA;QACrCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChCA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACjBA,CAACA;IACLA,CAACA,EAnCUD,GAAGA,GAAHA,OAAGA,KAAHA,OAAGA,QAmCbA;AAADA,CAACA,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 4eb5e300422..6d937785cc8 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -479,26 +479,26 @@ sourceFile:sourceMapValidationClasses.ts 3 > ^^^^^^^^ 4 > ^^^ 5 > ^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > 1 >) { > 2 > var 3 > greeters 4 > : Greeter[] = 5 > [] -6 > ; -7 > -8 > /* inline block comment */ +6 > ; +7 > /* inline block comment */ +8 > 1 >Emitted(25, 13) Source(22, 9) + SourceIndex(0) name (Foo.Bar.foo2) 2 >Emitted(25, 17) Source(22, 13) + SourceIndex(0) name (Foo.Bar.foo2) 3 >Emitted(25, 25) Source(22, 21) + SourceIndex(0) name (Foo.Bar.foo2) 4 >Emitted(25, 28) Source(22, 35) + SourceIndex(0) name (Foo.Bar.foo2) 5 >Emitted(25, 30) Source(22, 37) + SourceIndex(0) name (Foo.Bar.foo2) -6 >Emitted(25, 31) Source(22, 38) + SourceIndex(0) name (Foo.Bar.foo2) -7 >Emitted(25, 32) Source(22, 39) + SourceIndex(0) name (Foo.Bar.foo2) -8 >Emitted(25, 58) Source(22, 65) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(25, 32) Source(22, 39) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(25, 58) Source(22, 65) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(25, 58) Source(22, 38) + SourceIndex(0) name (Foo.Bar.foo2) --- >>> greeters[0] = new Greeter(greeting); 1 >^^^^^^^^^^^^ @@ -514,7 +514,7 @@ sourceFile:sourceMapValidationClasses.ts 11> ^ 12> ^ 13> ^^^^^^^^^^^^^-> -1 > +1 > /* inline block comment */ > 2 > greeters 3 > [ @@ -737,12 +737,16 @@ sourceFile:sourceMapValidationClasses.ts --- >>> // This is simple signle line comment 1->^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> + > // This is simple signle line comment > -2 > // This is simple signle line comment -1->Emitted(33, 9) Source(32, 5) + SourceIndex(0) name (Foo.Bar) -2 >Emitted(33, 46) Source(32, 42) + SourceIndex(0) name (Foo.Bar) +2 > +3 > // This is simple signle line comment +1->Emitted(33, 9) Source(33, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(33, 9) Source(32, 5) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(33, 46) Source(32, 42) + SourceIndex(0) name (Foo.Bar) --- >>> for (var j = 0; j < b.length; j++) { 1 >^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js b/tests/baselines/reference/sourceMapValidationDecorators.js index fc4417c2f45..f858aeff586 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js +++ b/tests/baselines/reference/sourceMapValidationDecorators.js @@ -55,7 +55,7 @@ class Greeter { } //// [sourceMapValidationDecorators.js] -if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -63,7 +63,7 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target, case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; -if (typeof __param !== "function") __param = function (paramIndex, decorator) { +var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var Greeter = (function () { diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt index b5749e50fa1..68ad353db9f 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt @@ -8,7 +8,7 @@ sources: sourceMapValidationDecorators.ts emittedFile:tests/cases/compiler/sourceMapValidationDecorators.js sourceFile:sourceMapValidationDecorators.ts ------------------------------------------------------------------- ->>>if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) { +>>>var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { >>> if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); >>> switch (arguments.length) { >>> case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); @@ -16,7 +16,7 @@ sourceFile:sourceMapValidationDecorators.ts >>> case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); >>> } >>>}; ->>>if (typeof __param !== "function") __param = function (paramIndex, decorator) { +>>>var __param = (this && this.__param) || function (paramIndex, decorator) { >>> return function (target, key) { decorator(target, key, paramIndex); } >>>}; >>>var Greeter = (function () { diff --git a/tests/baselines/reference/sourceMapValidationWithComments.js.map b/tests/baselines/reference/sourceMapValidationWithComments.js.map index 59c8ee5748e..fe250495802 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.js.map +++ b/tests/baselines/reference/sourceMapValidationWithComments.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationWithComments.js.map] -{"version":3,"file":"sourceMapValidationWithComments.js","sourceRoot":"","sources":["sourceMapValidationWithComments.ts"],"names":["DebugClass","DebugClass.constructor","DebugClass.debugFunc"],"mappings":"AAAA;IAAAA;IAoBAC,CAACA;IAlBiBD,oBAASA,GAAvBA;QAEIE,2BAA2BA;QAC3BA,IAAIA,CAACA,GAAGA,CAACA,CAACA;QACVA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,yBAAyBA;QAGzBA,MAAMA,CAACA,IAAIA,CAACA;IAChBA,CAACA;IACLF,iBAACA;AAADA,CAACA,AApBD,IAoBC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationWithComments.js","sourceRoot":"","sources":["sourceMapValidationWithComments.ts"],"names":["DebugClass","DebugClass.constructor","DebugClass.debugFunc"],"mappings":"AAAA;IAAAA;IAoBAC,CAACA;IAlBiBD,oBAASA,GAAvBA;QAGIE,AADAA,2BAA2BA;YACvBA,CAACA,GAAGA,CAACA,CAACA;QACVA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QAIJA,AAHAA,yBAAyBA;QAGzBA,MAAMA,CAACA,IAAIA,CAACA;IAChBA,CAACA;IACLF,iBAACA;AAADA,CAACA,AApBD,IAoBC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt index 239a418183f..5d2716cd127 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt @@ -63,34 +63,35 @@ sourceFile:sourceMapValidationWithComments.ts --- >>> // Start Debugger Test Code 1->^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->public static debugFunc() { > + > // Start Debugger Test Code > -2 > // Start Debugger Test Code -1->Emitted(5, 9) Source(5, 9) + SourceIndex(0) name (DebugClass.debugFunc) -2 >Emitted(5, 36) Source(5, 36) + SourceIndex(0) name (DebugClass.debugFunc) +2 > +3 > // Start Debugger Test Code +1->Emitted(5, 9) Source(6, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(5, 36) Source(5, 36) + SourceIndex(0) name (DebugClass.debugFunc) --- >>> var i = 0; -1 >^^^^^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^ 1 > - > -2 > var -3 > i -4 > = -5 > 0 -6 > ; -1 >Emitted(6, 9) Source(6, 9) + SourceIndex(0) name (DebugClass.debugFunc) -2 >Emitted(6, 13) Source(6, 13) + SourceIndex(0) name (DebugClass.debugFunc) -3 >Emitted(6, 14) Source(6, 14) + SourceIndex(0) name (DebugClass.debugFunc) -4 >Emitted(6, 17) Source(6, 17) + SourceIndex(0) name (DebugClass.debugFunc) -5 >Emitted(6, 18) Source(6, 18) + SourceIndex(0) name (DebugClass.debugFunc) -6 >Emitted(6, 19) Source(6, 19) + SourceIndex(0) name (DebugClass.debugFunc) + > var +2 > i +3 > = +4 > 0 +5 > ; +1 >Emitted(6, 13) Source(6, 13) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(6, 14) Source(6, 14) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(6, 17) Source(6, 17) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(6, 18) Source(6, 18) + SourceIndex(0) name (DebugClass.debugFunc) +5 >Emitted(6, 19) Source(6, 19) + SourceIndex(0) name (DebugClass.debugFunc) --- >>> i++; 1 >^^^^^^^^ @@ -238,12 +239,18 @@ sourceFile:sourceMapValidationWithComments.ts --- >>> // End Debugger Test Code 1->^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> + > // End Debugger Test Code + > + > > -2 > // End Debugger Test Code -1->Emitted(16, 9) Source(16, 9) + SourceIndex(0) name (DebugClass.debugFunc) -2 >Emitted(16, 34) Source(16, 34) + SourceIndex(0) name (DebugClass.debugFunc) +2 > +3 > // End Debugger Test Code +1->Emitted(16, 9) Source(19, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(16, 9) Source(16, 9) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(16, 34) Source(16, 34) + SourceIndex(0) name (DebugClass.debugFunc) --- >>> return true; 1 >^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js.map b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js.map index d10b3f8f281..cc528f82334 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js.map +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.js.map @@ -1,2 +1,2 @@ //// [fooResult.js.map] -{"version":3,"file":"fooResult.js","sourceRoot":"","sources":["../testFiles/app.ts","../testFiles/app2.ts"],"names":["c","c.constructor","d","d.constructor"],"mappings":"AAAA,gFAAgF;AAChF,wIAAwI;AACxI;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC;ACHD;IAAAE;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file +{"version":3,"file":"fooResult.js","sourceRoot":"","sources":["../testFiles/app.ts","../testFiles/app2.ts"],"names":["c","c.constructor","d","d.constructor"],"mappings":"AAEA,AAFA,gFAAgF;AAChF,wIAAwI;;IACxIA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC;ACHD;IAAAE;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt index fdc67bf563d..b26b7c71db6 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNames.sourcemap.txt @@ -10,12 +10,17 @@ sourceFile:../testFiles/app.ts ------------------------------------------------------------------- >>>// Note in the out result we are using same folder name only different in casing 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >// Note in the out result we are using same folder name only different in casing -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >// Note in the out result we are using same folder name only different in casing + >// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts + > +2 > +3 >// Note in the out result we are using same folder name only different in casing +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) --- >>>// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts 1-> @@ -27,17 +32,12 @@ sourceFile:../testFiles/app.ts 2 >Emitted(2, 137) Source(2, 137) + SourceIndex(0) --- >>>var c = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function c() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +1 >Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js.map b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js.map index 5317cf7c306..b27ad076cc8 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js.map +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js.map @@ -1,3 +1,3 @@ //// [app.js.map] -{"version":3,"file":"app.js","sourceRoot":"","sources":["../testFiles/app.ts"],"names":["c","c.constructor"],"mappings":"AAAA,gFAAgF;AAChF,wIAAwI;AACxI;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}//// [app2.js.map] +{"version":3,"file":"app.js","sourceRoot":"","sources":["../testFiles/app.ts"],"names":["c","c.constructor"],"mappings":"AAEA,AAFA,gFAAgF;AAChF,wIAAwI;;IACxIA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}//// [app2.js.map] {"version":3,"file":"app2.js","sourceRoot":"","sources":["../testFiles/app2.ts"],"names":["d","d.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt index 44dd1b41048..6064ee003df 100644 --- a/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.sourcemap.txt @@ -10,12 +10,17 @@ sourceFile:../testFiles/app.ts ------------------------------------------------------------------- >>>// Note in the out result we are using same folder name only different in casing 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >// Note in the out result we are using same folder name only different in casing -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >// Note in the out result we are using same folder name only different in casing + >// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts + > +2 > +3 >// Note in the out result we are using same folder name only different in casing +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) --- >>>// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts 1-> @@ -27,17 +32,12 @@ sourceFile:../testFiles/app.ts 2 >Emitted(2, 137) Source(2, 137) + SourceIndex(0) --- >>>var c = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function c() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +1 >Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map index 5d866e941db..59e28d92f90 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.js.map @@ -1,2 +1,2 @@ //// [a.js.map] -{"version":3,"file":"a.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AAAA;;6EAE6E;AAE7E,IAAI,CAAC,GAAG;IACJ,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;CACR,CAAC;ACPF;;6EAE6E;AAE7E,2BAA2B;AAC3B,IAAI,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"a.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":"AAAA;;6EAE6E;AAE7E,IAAI,CAAC,GAAG;IACJ,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;CACR,CAAC;ACPF;;6EAE6E;AAG7E,AADA,2BAA2B;IACvB,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.sourcemap.txt b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.sourcemap.txt index f3f3dffd9dc..5a87f6c04e8 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.sourcemap.txt @@ -100,34 +100,35 @@ sourceFile:tests/cases/compiler/b.ts --- >>>/// 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 > > + >/// > -2 >/// -1 >Emitted(11, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(11, 28) Source(5, 28) + SourceIndex(1) +2 > +3 >/// +1 >Emitted(11, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(11, 1) Source(5, 1) + SourceIndex(1) +3 >Emitted(11, 28) Source(5, 28) + SourceIndex(1) --- >>>var y = x; -1 > -2 >^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ -7 > ^^^^^^^^^^^^^^^^^^-> +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >var -3 > y -4 > = -5 > x -6 > ; -1 >Emitted(12, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(12, 6) Source(6, 6) + SourceIndex(1) -4 >Emitted(12, 9) Source(6, 9) + SourceIndex(1) -5 >Emitted(12, 10) Source(6, 10) + SourceIndex(1) -6 >Emitted(12, 11) Source(6, 11) + SourceIndex(1) + >var +2 > y +3 > = +4 > x +5 > ; +1 >Emitted(12, 5) Source(6, 5) + SourceIndex(1) +2 >Emitted(12, 6) Source(6, 6) + SourceIndex(1) +3 >Emitted(12, 9) Source(6, 9) + SourceIndex(1) +4 >Emitted(12, 10) Source(6, 10) + SourceIndex(1) +5 >Emitted(12, 11) Source(6, 11) + SourceIndex(1) --- >>>//# sourceMappingURL=a.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js.map b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js.map index 200edeccc5b..e3262d8c686 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js.map +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.js.map @@ -1,2 +1,2 @@ //// [fooResult.js.map] -{"version":3,"file":"fooResult.js","sourceRoot":"","sources":["app.ts","app2.ts"],"names":["c","c.constructor","d","d.constructor"],"mappings":"AAAA,gFAAgF;AAChF,0GAA0G;AAC1G;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC;ACHD;IAAAE;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file +{"version":3,"file":"fooResult.js","sourceRoot":"","sources":["app.ts","app2.ts"],"names":["c","c.constructor","d","d.constructor"],"mappings":"AAEA,AAFA,gFAAgF;AAChF,0GAA0G;;IAC1GA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC;ACHD;IAAAE;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt index 790d64c7963..560fd29616d 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNames.sourcemap.txt @@ -10,12 +10,17 @@ sourceFile:app.ts ------------------------------------------------------------------- >>>// Note in the out result we are using same folder name only different in casing 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >// Note in the out result we are using same folder name only different in casing -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >// Note in the out result we are using same folder name only different in casing + >// Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap + > +2 > +3 >// Note in the out result we are using same folder name only different in casing +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) --- >>>// Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap 1-> @@ -27,17 +32,12 @@ sourceFile:app.ts 2 >Emitted(2, 107) Source(2, 107) + SourceIndex(0) --- >>>var c = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function c() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +1 >Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js.map b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js.map index 97826d80eb8..9fff2ee3f66 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js.map +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js.map @@ -1,3 +1,3 @@ //// [app.js.map] -{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":["c","c.constructor"],"mappings":"AAAA,gFAAgF;AAChF,0GAA0G;AAC1G;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}//// [app2.js.map] +{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":["c","c.constructor"],"mappings":"AAEA,AAFA,gFAAgF;AAChF,0GAA0G;;IAC1GA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}//// [app2.js.map] {"version":3,"file":"app2.js","sourceRoot":"","sources":["app2.ts"],"names":["d","d.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt index 6987b7bbd21..f91aaea6ab9 100644 --- a/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt +++ b/tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.sourcemap.txt @@ -10,12 +10,17 @@ sourceFile:app.ts ------------------------------------------------------------------- >>>// Note in the out result we are using same folder name only different in casing 1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >// Note in the out result we are using same folder name only different in casing -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) +2 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >// Note in the out result we are using same folder name only different in casing + >// Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap + > +2 > +3 >// Note in the out result we are using same folder name only different in casing +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 81) Source(1, 81) + SourceIndex(0) --- >>>// Since this is non case sensitive, the relative paths should be just app.ts and app2.ts in the sourcemap 1-> @@ -27,17 +32,12 @@ sourceFile:app.ts 2 >Emitted(2, 107) Source(2, 107) + SourceIndex(0) --- >>>var c = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> +>>> function c() { +1 >^^^^ +2 > ^^-> 1 > > -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) +1 >Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c) --- >>> } 1->^^^^ diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index 36280f9a44e..ec467ad9877 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -18,7 +18,7 @@ var myView = new MyView(m); // was error //// [specializedInheritedConstructors1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index f091a39677c..2a022cdf7da 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -13,7 +13,7 @@ function g(tagName: any): Base { } //// [specializedOverloadWithRestParameters.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index 529cc230d73..96303af586f 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -14,7 +14,7 @@ var d = Derived.create(); d.foo(); //// [staticFactory1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index a577bad3a86..0aba29b3560 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -12,7 +12,7 @@ doThing(B); //OK //// [staticInheritance.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/staticInstanceResolution5.errors.txt b/tests/baselines/reference/staticInstanceResolution5.errors.txt index 3dea3485af9..3c1cee93fd5 100644 --- a/tests/baselines/reference/staticInstanceResolution5.errors.txt +++ b/tests/baselines/reference/staticInstanceResolution5.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/staticInstanceResolution5_1.ts(1,24): error TS2307: Cannot find external module 'staticInstanceResolution5_0.ts'. +tests/cases/compiler/staticInstanceResolution5_1.ts(1,24): error TS2307: Cannot find module 'staticInstanceResolution5_0.ts'. ==== tests/cases/compiler/staticInstanceResolution5_1.ts (1 errors) ==== import WinJS = require('staticInstanceResolution5_0.ts'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find external module 'staticInstanceResolution5_0.ts'. +!!! error TS2307: Cannot find module 'staticInstanceResolution5_0.ts'. // these 3 should be errors var x = (w1: WinJS) => { }; diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index a4bbc3947cd..ab3c010d571 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -10,7 +10,7 @@ class P extends SomeBase { //// [staticMemberAccessOffDerivedType1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index f77098b56e4..f0d50b3ecb6 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -36,7 +36,7 @@ class E extends A { } //// [staticPropSuper.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index f7c5c3ecc5c..fef1ef46b1a 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -61,7 +61,7 @@ class Ds extends A { } //// [strictModeInConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/strictModeReservedWord.errors.txt b/tests/baselines/reference/strictModeReservedWord.errors.txt index 9e76e36551d..9b7c0e03d0c 100644 --- a/tests/baselines/reference/strictModeReservedWord.errors.txt +++ b/tests/baselines/reference/strictModeReservedWord.errors.txt @@ -19,19 +19,19 @@ tests/cases/compiler/strictModeReservedWord.ts(13,28): error TS1212: Identifier tests/cases/compiler/strictModeReservedWord.ts(15,25): error TS9003: 'class' expressions are not currently supported. tests/cases/compiler/strictModeReservedWord.ts(17,9): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/strictModeReservedWord.ts(17,12): error TS1215: Type expected. 'public' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWord.ts(17,12): error TS2304: Cannot find name 'public'. +tests/cases/compiler/strictModeReservedWord.ts(17,12): error TS2503: Cannot find namespace 'public'. tests/cases/compiler/strictModeReservedWord.ts(19,21): error TS1215: Type expected. 'private' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWord.ts(19,21): error TS2304: Cannot find name 'private'. +tests/cases/compiler/strictModeReservedWord.ts(19,21): error TS2503: Cannot find namespace 'private'. tests/cases/compiler/strictModeReservedWord.ts(20,22): error TS1215: Type expected. 'private' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWord.ts(20,22): error TS2304: Cannot find name 'private'. +tests/cases/compiler/strictModeReservedWord.ts(20,22): error TS2503: Cannot find namespace 'private'. tests/cases/compiler/strictModeReservedWord.ts(20,30): error TS1215: Type expected. 'package' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(21,22): error TS1215: Type expected. 'private' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWord.ts(21,22): error TS2304: Cannot find name 'private'. +tests/cases/compiler/strictModeReservedWord.ts(21,22): error TS2503: Cannot find namespace 'private'. tests/cases/compiler/strictModeReservedWord.ts(21,30): error TS1215: Type expected. 'package' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(21,38): error TS1215: Type expected. 'protected' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(22,9): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/strictModeReservedWord.ts(22,12): error TS1215: Type expected. 'interface' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWord.ts(22,12): error TS2304: Cannot find name 'interface'. +tests/cases/compiler/strictModeReservedWord.ts(22,12): error TS2503: Cannot find namespace 'interface'. tests/cases/compiler/strictModeReservedWord.ts(22,22): error TS1215: Type expected. 'package' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(22,30): error TS1215: Type expected. 'implements' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(23,5): error TS2304: Cannot find name 'ublic'. @@ -100,25 +100,25 @@ tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invok ~~~~~~ !!! error TS1215: Type expected. 'public' is a reserved word in strict mode ~~~~~~ -!!! error TS2304: Cannot find name 'public'. +!!! error TS2503: Cannot find namespace 'public'. function foo(x: private.x) { } ~~~~~~~ !!! error TS1215: Type expected. 'private' is a reserved word in strict mode ~~~~~~~ -!!! error TS2304: Cannot find name 'private'. +!!! error TS2503: Cannot find namespace 'private'. function foo1(x: private.package.x) { } ~~~~~~~ !!! error TS1215: Type expected. 'private' is a reserved word in strict mode ~~~~~~~ -!!! error TS2304: Cannot find name 'private'. +!!! error TS2503: Cannot find namespace 'private'. ~~~~~~~ !!! error TS1215: Type expected. 'package' is a reserved word in strict mode function foo2(x: private.package.protected) { } ~~~~~~~ !!! error TS1215: Type expected. 'private' is a reserved word in strict mode ~~~~~~~ -!!! error TS2304: Cannot find name 'private'. +!!! error TS2503: Cannot find namespace 'private'. ~~~~~~~ !!! error TS1215: Type expected. 'package' is a reserved word in strict mode ~~~~~~~~~ @@ -129,7 +129,7 @@ tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invok ~~~~~~~~~ !!! error TS1215: Type expected. 'interface' is a reserved word in strict mode ~~~~~~~~~ -!!! error TS2304: Cannot find name 'interface'. +!!! error TS2503: Cannot find namespace 'interface'. ~~~~~~~ !!! error TS1215: Type expected. 'package' is a reserved word in strict mode ~~~~~~~~~~ diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt index b7876b1b849..43222495b9f 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt @@ -15,13 +15,13 @@ tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(21,9): error TS tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(21,17): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(23,20): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(25,20): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. -tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(25,20): error TS2304: Cannot find name 'public'. +tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(25,20): error TS2503: Cannot find namespace 'public'. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(26,21): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. -tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(26,21): error TS2304: Cannot find name 'public'. +tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(26,21): error TS2503: Cannot find namespace 'public'. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(27,17): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(27,17): error TS2304: Cannot find name 'package'. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. -tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error TS2304: Cannot find name 'package'. +tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error TS2503: Cannot find namespace 'package'. ==== tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts (24 errors) ==== @@ -85,12 +85,12 @@ tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error T ~~~~~~ !!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. ~~~~~~ -!!! error TS2304: Cannot find name 'public'. +!!! error TS2503: Cannot find namespace 'public'. class F1 implements public.private.implements { } ~~~~~~ !!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. ~~~~~~ -!!! error TS2304: Cannot find name 'public'. +!!! error TS2503: Cannot find namespace 'public'. class G extends package { } ~~~~~~~ !!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. @@ -100,4 +100,4 @@ tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error T ~~~~~~~ !!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. ~~~~~~~ -!!! error TS2304: Cannot find name 'package'. \ No newline at end of file +!!! error TS2503: Cannot find namespace 'package'. \ No newline at end of file diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 98b38532aa6..9ee817182c2 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -29,7 +29,7 @@ class G extends package { } class H extends package.A { } //// [strictModeReservedWordInClassDeclaration.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/strictModeReservedWordInImportEqualDeclaration.errors.txt b/tests/baselines/reference/strictModeReservedWordInImportEqualDeclaration.errors.txt index 408cf161f3c..7511e88f53a 100644 --- a/tests/baselines/reference/strictModeReservedWordInImportEqualDeclaration.errors.txt +++ b/tests/baselines/reference/strictModeReservedWordInImportEqualDeclaration.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/strictModeReservedWordInImportEqualDeclaration.ts(3,8): error TS1212: Identifier expected. 'public' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWordInImportEqualDeclaration.ts(3,25): error TS2307: Cannot find external module '1'. +tests/cases/compiler/strictModeReservedWordInImportEqualDeclaration.ts(3,25): error TS2307: Cannot find module '1'. ==== tests/cases/compiler/strictModeReservedWordInImportEqualDeclaration.ts (2 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/strictModeReservedWordInImportEqualDeclaration.ts(3,25): er ~~~~~~ !!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode ~~~ -!!! error TS2307: Cannot find external module '1'. \ No newline at end of file +!!! error TS2307: Cannot find module '1'. \ No newline at end of file diff --git a/tests/baselines/reference/strictModeWordInImportDeclaration.errors.txt b/tests/baselines/reference/strictModeWordInImportDeclaration.errors.txt index 83e44ab50b9..b5da09b4240 100644 --- a/tests/baselines/reference/strictModeWordInImportDeclaration.errors.txt +++ b/tests/baselines/reference/strictModeWordInImportDeclaration.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/strictModeWordInImportDeclaration.ts(2,13): error TS1212: Identifier expected. 'package' is a reserved word in strict mode -tests/cases/compiler/strictModeWordInImportDeclaration.ts(2,26): error TS2307: Cannot find external module './1'. +tests/cases/compiler/strictModeWordInImportDeclaration.ts(2,26): error TS2307: Cannot find module './1'. tests/cases/compiler/strictModeWordInImportDeclaration.ts(3,16): error TS1212: Identifier expected. 'private' is a reserved word in strict mode -tests/cases/compiler/strictModeWordInImportDeclaration.ts(3,30): error TS2307: Cannot find external module './1'. -tests/cases/compiler/strictModeWordInImportDeclaration.ts(4,20): error TS2307: Cannot find external module './1'. +tests/cases/compiler/strictModeWordInImportDeclaration.ts(3,30): error TS2307: Cannot find module './1'. +tests/cases/compiler/strictModeWordInImportDeclaration.ts(4,20): error TS2307: Cannot find module './1'. ==== tests/cases/compiler/strictModeWordInImportDeclaration.ts (5 errors) ==== @@ -11,12 +11,12 @@ tests/cases/compiler/strictModeWordInImportDeclaration.ts(4,20): error TS2307: C ~~~~~~~ !!! error TS1212: Identifier expected. 'package' is a reserved word in strict mode ~~~~~ -!!! error TS2307: Cannot find external module './1'. +!!! error TS2307: Cannot find module './1'. import {foo as private} from "./1" ~~~~~~~ !!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode ~~~~~ -!!! error TS2307: Cannot find external module './1'. +!!! error TS2307: Cannot find module './1'. import public from "./1" ~~~~~ -!!! error TS2307: Cannot find external module './1'. \ No newline at end of file +!!! error TS2307: Cannot find module './1'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index c9278c40446..b6bd2dbd437 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -41,7 +41,7 @@ var b: { [x: string]: A } = { //// [stringIndexerConstrainsPropertyDeclarations2.js] // String indexer providing a constraint of a user defined type -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 7fe3d28278b..5abdd633424 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -107,7 +107,7 @@ function f2(x: T, y: U) { //// [subtypesOfTypeParameter.js] // checking whether other types are subtypes of type parameters -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index 2adc3712c26..afe9b998bd4 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -169,7 +169,7 @@ class D29 extends C3 { //// [subtypesOfTypeParameterWithConstraints.js] // checking whether other types are subtypes of type parameters with constraints -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index f1cf61d484f..6f1756912a6 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -80,7 +80,7 @@ class D9 extends B1 { //// [subtypesOfTypeParameterWithConstraints4.js] // checking whether other types are subtypes of type parameters with constraints -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index 1caa7d99087..3d2b6372302 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -159,7 +159,7 @@ module M2 { //// [subtypesOfTypeParameterWithRecursiveConstraints.js] // checking whether other types are subtypes of type parameters with constraints -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index 828831c19bf..9dcb4095aa2 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -20,7 +20,7 @@ b.x = 1; // assigned number to string //// [subtypingTransitivity.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index e1341914739..db6f1d85954 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -174,7 +174,7 @@ var r18 = foo18(r18arg1); //// [subtypingWithCallSignatures2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index fb7b0fef551..d7ff8a79b6c 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -121,7 +121,7 @@ module WithGenericSignaturesInBaseType { //// [subtypingWithCallSignatures3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases, so function calls will all result in 'any' -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index cbdf92e2e60..739e3cacd86 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -113,7 +113,7 @@ var r18 = foo18(r18arg); //// [subtypingWithCallSignatures4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index 9a7ecd791c3..4e93ddbbe55 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -174,7 +174,7 @@ var r18 = foo18(r18arg1); //// [subtypingWithConstructSignatures2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index a74c14e8d4b..7022b4b395c 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -123,7 +123,7 @@ module WithGenericSignaturesInBaseType { //// [subtypingWithConstructSignatures3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases, so function calls will all result in 'any' -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index b3d43b03087..a16ea8e2397 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -113,7 +113,7 @@ var r18 = foo18(r18arg); //// [subtypingWithConstructSignatures4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index 3e1a373d4ee..fe3b86d1775 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -51,7 +51,7 @@ interface I extends B { //// [subtypingWithConstructSignatures5.js] // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index 3d8f0cfee60..990b654bf45 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -54,7 +54,7 @@ interface I9 extends A { // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures // all are errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index 643d71e035f..a7790fba564 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -41,7 +41,7 @@ module Generics { //// [subtypingWithNumericIndexer.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index 44bd366d705..c3fff86274f 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -45,7 +45,7 @@ module Generics { //// [subtypingWithNumericIndexer3.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index 44c88e1c520..e7ec08436a7 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -29,7 +29,7 @@ module Generics { //// [subtypingWithNumericIndexer4.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index 06d8f4e0a78..28af7239222 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -68,7 +68,7 @@ module TwoLevels { } //// [subtypingWithObjectMembers.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index 31b0cb6e8f9..b04c3056a3e 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -35,7 +35,7 @@ class B3 extends A3 { //// [subtypingWithObjectMembers4.js] // subtyping when property names do not match -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index ef873bf81b2..d3b62890855 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -35,7 +35,7 @@ class B3 extends A3 { //// [subtypingWithObjectMembersAccessibility.js] // Derived member is private, base member is not causes errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 6981fbcfebe..4a0ff448b7b 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -63,7 +63,7 @@ module ImplicitPublic { //// [subtypingWithObjectMembersAccessibility2.js] // Derived member is private, base member is not causes errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 46f46a570cf..4b398451de8 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -42,7 +42,7 @@ module Generics { //// [subtypingWithStringIndexer.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index c5b9d96ce54..cf1ec80a8d2 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -45,7 +45,7 @@ module Generics { //// [subtypingWithStringIndexer3.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index 0dbe8912eba..e6aa298fed8 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -29,7 +29,7 @@ module Generics { //// [subtypingWithStringIndexer4.js] // Derived type indexer must be subtype of base type indexer -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index 453eb820ddb..ed220ae1f18 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -38,7 +38,7 @@ s.foo() + ss.foo(); //// [super.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/super1.js b/tests/baselines/reference/super1.js index ab982aa8fdf..1bf75783a60 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -67,7 +67,7 @@ module Base4 { //// [super1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/super2.js b/tests/baselines/reference/super2.js index 0b596b44d32..0f5531a8d57 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -51,7 +51,7 @@ results1.x() + results1.y() + results2.y(); //// [super2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index 3d9080b76e1..bf6a9ee3ad0 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -14,7 +14,7 @@ class MyDerived extends MyBase { } //// [superAccess.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index 8672b5b9935..afcba34aa5d 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -25,7 +25,7 @@ class Q extends P { } //// [superAccess2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index c7cc8308c5a..6222bf42fee 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -16,7 +16,7 @@ module test { } //// [superAccessInFatArrow1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index e38c519ead9..7c7948cc387 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -26,7 +26,7 @@ class T6 extends T5{ //// [superCallArgsMustMatch.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index 3a57a173a1c..a83e5b3de75 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -11,7 +11,7 @@ class H extends E { } //// [superCallAssignResult.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index 036c6de833e..15e26b5481f 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -12,7 +12,7 @@ class D extends B { //// [superCallFromClassThatDerivesFromGenericType1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index 193e3c1ed28..15d24015a04 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -11,7 +11,7 @@ class D extends B { //// [superCallFromClassThatDerivesFromGenericType2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index 92abed0d66d..114505b85a2 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -11,7 +11,7 @@ class B extends A { } //// [superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index 7e3c61e6690..226665e3e67 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -11,7 +11,7 @@ class B extends A { } //// [superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index b48d5bb7f58..7c07e78b0f9 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -11,7 +11,7 @@ class B extends A { } //// [superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index 7ef1ce1c62a..c3038e23c4c 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -51,7 +51,7 @@ class Other extends Doing { //// [superCallInNonStaticMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index 820551724ac..7e57cd2d2e8 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -47,7 +47,7 @@ class Other extends Doing { //// [superCallInStaticMethod.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index 94f41cccb57..0a1822bc549 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -23,7 +23,7 @@ var d = new D(); //// [superCallOutsideConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index b11d62d62c8..4888473319e 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -13,7 +13,7 @@ class B extends A { //// [superCallParameterContextualTyping1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index 61e8b94f00f..ab6093c42be 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -12,7 +12,7 @@ class C extends A { } //// [superCallParameterContextualTyping2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index e33bcb29bb8..574d281ed09 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -32,7 +32,7 @@ class C extends CBase { } //// [superCallParameterContextualTyping3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index 2928793feb6..d2e4f9ff7f1 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -31,7 +31,7 @@ class OtherDerived extends OtherBase { //// [superCalls.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index 0c19e365d92..6bd313898d4 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -21,7 +21,7 @@ class Derived extends Base { } //// [superCallsInConstructor.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index bb17019aa4e..2e1cd346cd4 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -52,7 +52,7 @@ class RegisteredUser extends User { } //// [superErrors.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index 1b9085ec266..38131f5f08e 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -14,7 +14,7 @@ class B extends A { //// [superInCatchBlock1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index e08dc9d73fd..aaf4162e992 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -11,7 +11,7 @@ class C extends B { } //// [superInConstructorParam1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index 10c489f1b40..5640425f6bc 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -68,7 +68,7 @@ class RegisteredUser4 extends User { } //// [superInLambdas.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index d9b74ac5080..1b11b61ce2f 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -13,7 +13,7 @@ class B extends A { } //// [superNewCall1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index a5419aaf36e..016fc09ff96 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -37,7 +37,7 @@ class MyDerived extends MyBase { } //// [superPropertyAccess.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index a0a52526f93..1ee834f3495 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -28,7 +28,7 @@ class D extends C { } //// [superPropertyAccess1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index b906f1b0a8b..0877cf23b9d 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -28,7 +28,7 @@ class D extends C { } //// [superPropertyAccess2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index e49a2c6b719..f8ee7f6d01b 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -67,7 +67,7 @@ class SomeDerivedClass extends SomeBaseClass { //super.publicInstanceMemberFunction in lambda in member function //super.publicStaticMemberFunction in static member function of derived class //super.publicStaticMemberFunction in static member accessor(get and set) of derived class -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index 92d7a8156aa..5cd85f90735 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -15,7 +15,7 @@ var r: string = d.x; var r2: number = d.y; //// [superWithGenericSpecialization.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index 1daef3e269f..8ba6f878dc2 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -12,7 +12,7 @@ class D extends B { //// [superWithGenerics.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index 96566a57490..2e5ea93a47a 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -10,7 +10,7 @@ class D extends C { } //// [superWithTypeArgument.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index a3dc7fbe58d..c33497d58fd 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -10,7 +10,7 @@ class D extends C { } //// [superWithTypeArgument2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index ef228a3ba20..1266d97f264 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -14,7 +14,7 @@ class D extends C { } //// [superWithTypeArgument3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js index 2a97b6d04d7..97fa57528cf 100644 --- a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js +++ b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js @@ -28,7 +28,7 @@ class SuperObjectTest extends F { //// [super_inside-object-literal-getters-and-setters.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index 6348ca62e78..debd9a4d531 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -56,7 +56,7 @@ switch (((x: T) => '')(1)) { } //// [switchStatements.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/symbolDeclarationEmit1.symbols b/tests/baselines/reference/symbolDeclarationEmit1.symbols index 9205c9561c1..f24cfe2b783 100644 --- a/tests/baselines/reference/symbolDeclarationEmit1.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit1.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit1.ts, 0, 0)) [Symbol.toPrimitive]: number; ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit10.symbols b/tests/baselines/reference/symbolDeclarationEmit10.symbols index 0f967048ef6..375bcf2174a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit10.symbols @@ -4,12 +4,12 @@ var obj = { get [Symbol.isConcatSpreadable]() { return '' }, >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) set [Symbol.isConcatSpreadable](x) { } >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) >x : Symbol(x, Decl(symbolDeclarationEmit10.ts, 2, 36)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit11.symbols b/tests/baselines/reference/symbolDeclarationEmit11.symbols index 1f9b2f021a0..90290569e07 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit11.symbols @@ -4,22 +4,22 @@ class C { static [Symbol.iterator] = 0; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) static [Symbol.isConcatSpreadable]() { } >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) static get [Symbol.toPrimitive]() { return ""; } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) static set [Symbol.toPrimitive](x) { } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) >x : Symbol(x, Decl(symbolDeclarationEmit11.ts, 4, 36)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit13.symbols b/tests/baselines/reference/symbolDeclarationEmit13.symbols index a4605173830..66f540a8cae 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit13.symbols @@ -3,13 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit13.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) set [Symbol.toStringTag](x) { } ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) >x : Symbol(x, Decl(symbolDeclarationEmit13.ts, 2, 29)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit14.symbols b/tests/baselines/reference/symbolDeclarationEmit14.symbols index dcd0f523d61..5927b8a6a29 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit14.symbols @@ -3,12 +3,12 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit14.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) get [Symbol.toStringTag]() { return ""; } ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit2.symbols b/tests/baselines/reference/symbolDeclarationEmit2.symbols index 66d5fccb56e..3c214bd9c25 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit2.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit2.ts, 0, 0)) [Symbol.toPrimitive] = ""; ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit3.symbols b/tests/baselines/reference/symbolDeclarationEmit3.symbols index 6fb95c4d2ac..d3a3a313223 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit3.symbols @@ -3,20 +3,20 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit3.ts, 0, 0)) [Symbol.toPrimitive](x: number); ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 1, 25)) [Symbol.toPrimitive](x: string); ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 2, 25)) [Symbol.toPrimitive](x: any) { } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 3, 25)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.symbols b/tests/baselines/reference/symbolDeclarationEmit4.symbols index feebcb95db5..d552300b70e 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit4.symbols @@ -3,13 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit4.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) set [Symbol.toPrimitive](x) { } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) >x : Symbol(x, Decl(symbolDeclarationEmit4.ts, 2, 29)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit5.symbols b/tests/baselines/reference/symbolDeclarationEmit5.symbols index c8db12c3e98..7f5fc3cf51b 100644 --- a/tests/baselines/reference/symbolDeclarationEmit5.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit5.symbols @@ -4,6 +4,6 @@ interface I { [Symbol.isConcatSpreadable](): string; >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit6.symbols b/tests/baselines/reference/symbolDeclarationEmit6.symbols index 999a852c5c7..fe60e2ecc31 100644 --- a/tests/baselines/reference/symbolDeclarationEmit6.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit6.symbols @@ -4,6 +4,6 @@ interface I { [Symbol.isConcatSpreadable]: string; >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit7.symbols b/tests/baselines/reference/symbolDeclarationEmit7.symbols index 75e92a85922..b044c5264d8 100644 --- a/tests/baselines/reference/symbolDeclarationEmit7.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit7.symbols @@ -4,6 +4,6 @@ var obj: { [Symbol.isConcatSpreadable]: string; >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit8.symbols b/tests/baselines/reference/symbolDeclarationEmit8.symbols index e57bb11047b..797b422c7fc 100644 --- a/tests/baselines/reference/symbolDeclarationEmit8.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit8.symbols @@ -4,6 +4,6 @@ var obj = { [Symbol.isConcatSpreadable]: 0 >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit9.symbols b/tests/baselines/reference/symbolDeclarationEmit9.symbols index fe80dae2816..deaf1c1bb62 100644 --- a/tests/baselines/reference/symbolDeclarationEmit9.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit9.symbols @@ -4,6 +4,6 @@ var obj = { [Symbol.isConcatSpreadable]() { } >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) } diff --git a/tests/baselines/reference/symbolProperty11.symbols b/tests/baselines/reference/symbolProperty11.symbols index f1988f05268..f8b758cbf68 100644 --- a/tests/baselines/reference/symbolProperty11.symbols +++ b/tests/baselines/reference/symbolProperty11.symbols @@ -7,7 +7,7 @@ interface I { [Symbol.iterator]?: { x }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty11.ts, 2, 25)) } diff --git a/tests/baselines/reference/symbolProperty13.symbols b/tests/baselines/reference/symbolProperty13.symbols index a2b66415992..246ca2f0851 100644 --- a/tests/baselines/reference/symbolProperty13.symbols +++ b/tests/baselines/reference/symbolProperty13.symbols @@ -4,7 +4,7 @@ class C { [Symbol.iterator]: { x; y }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty13.ts, 1, 24)) >y : Symbol(y, Decl(symbolProperty13.ts, 1, 27)) @@ -14,7 +14,7 @@ interface I { [Symbol.iterator]: { x }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty13.ts, 4, 24)) } diff --git a/tests/baselines/reference/symbolProperty14.symbols b/tests/baselines/reference/symbolProperty14.symbols index 27e8a5fd4c6..4531b13dca1 100644 --- a/tests/baselines/reference/symbolProperty14.symbols +++ b/tests/baselines/reference/symbolProperty14.symbols @@ -4,7 +4,7 @@ class C { [Symbol.iterator]: { x; y }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty14.ts, 1, 24)) >y : Symbol(y, Decl(symbolProperty14.ts, 1, 27)) @@ -14,7 +14,7 @@ interface I { [Symbol.iterator]?: { x }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty14.ts, 4, 25)) } diff --git a/tests/baselines/reference/symbolProperty15.symbols b/tests/baselines/reference/symbolProperty15.symbols index b18cc518ccb..6027f5e797e 100644 --- a/tests/baselines/reference/symbolProperty15.symbols +++ b/tests/baselines/reference/symbolProperty15.symbols @@ -7,7 +7,7 @@ interface I { [Symbol.iterator]?: { x }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty15.ts, 2, 25)) } diff --git a/tests/baselines/reference/symbolProperty16.symbols b/tests/baselines/reference/symbolProperty16.symbols index c23f6ecd892..f7700e3b777 100644 --- a/tests/baselines/reference/symbolProperty16.symbols +++ b/tests/baselines/reference/symbolProperty16.symbols @@ -4,7 +4,7 @@ class C { private [Symbol.iterator]: { x }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty16.ts, 1, 32)) } @@ -13,7 +13,7 @@ interface I { [Symbol.iterator]: { x }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty16.ts, 4, 24)) } diff --git a/tests/baselines/reference/symbolProperty18.symbols b/tests/baselines/reference/symbolProperty18.symbols index db5cfb0d3f0..bc23c468a22 100644 --- a/tests/baselines/reference/symbolProperty18.symbols +++ b/tests/baselines/reference/symbolProperty18.symbols @@ -4,18 +4,18 @@ var i = { [Symbol.iterator]: 0, >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) [Symbol.toStringTag]() { return "" }, ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) set [Symbol.toPrimitive](p: boolean) { } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) >p : Symbol(p, Decl(symbolProperty18.ts, 3, 29)) } @@ -23,19 +23,19 @@ var it = i[Symbol.iterator]; >it : Symbol(it, Decl(symbolProperty18.ts, 6, 3)) >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) var str = i[Symbol.toStringTag](); >str : Symbol(str, Decl(symbolProperty18.ts, 7, 3)) >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) i[Symbol.toPrimitive] = false; >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) diff --git a/tests/baselines/reference/symbolProperty19.symbols b/tests/baselines/reference/symbolProperty19.symbols index 5030f37d6bc..a0274f2c762 100644 --- a/tests/baselines/reference/symbolProperty19.symbols +++ b/tests/baselines/reference/symbolProperty19.symbols @@ -4,14 +4,14 @@ var i = { [Symbol.iterator]: { p: null }, >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >p : Symbol(p, Decl(symbolProperty19.ts, 1, 24)) [Symbol.toStringTag]() { return { p: undefined }; } ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) >p : Symbol(p, Decl(symbolProperty19.ts, 2, 37)) >undefined : Symbol(undefined) } @@ -20,13 +20,13 @@ var it = i[Symbol.iterator]; >it : Symbol(it, Decl(symbolProperty19.ts, 5, 3)) >i : Symbol(i, Decl(symbolProperty19.ts, 0, 3)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) var str = i[Symbol.toStringTag](); >str : Symbol(str, Decl(symbolProperty19.ts, 6, 3)) >i : Symbol(i, Decl(symbolProperty19.ts, 0, 3)) ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) diff --git a/tests/baselines/reference/symbolProperty2.symbols b/tests/baselines/reference/symbolProperty2.symbols index a2eea4344ab..c6bb74bef31 100644 --- a/tests/baselines/reference/symbolProperty2.symbols +++ b/tests/baselines/reference/symbolProperty2.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/Symbols/symbolProperty2.ts === var s = Symbol(); >s : Symbol(s, Decl(symbolProperty2.ts, 0, 3)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) var x = { >x : Symbol(x, Decl(symbolProperty2.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolProperty20.symbols b/tests/baselines/reference/symbolProperty20.symbols index d7281ee1aec..04c76275b55 100644 --- a/tests/baselines/reference/symbolProperty20.symbols +++ b/tests/baselines/reference/symbolProperty20.symbols @@ -4,14 +4,14 @@ interface I { [Symbol.iterator]: (s: string) => string; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >s : Symbol(s, Decl(symbolProperty20.ts, 1, 24)) [Symbol.toStringTag](s: number): number; ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) >s : Symbol(s, Decl(symbolProperty20.ts, 2, 25)) } @@ -21,15 +21,15 @@ var i: I = { [Symbol.iterator]: s => s, >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >s : Symbol(s, Decl(symbolProperty20.ts, 6, 22)) >s : Symbol(s, Decl(symbolProperty20.ts, 6, 22)) [Symbol.toStringTag](n) { return n; } ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) >n : Symbol(n, Decl(symbolProperty20.ts, 7, 25)) >n : Symbol(n, Decl(symbolProperty20.ts, 7, 25)) } diff --git a/tests/baselines/reference/symbolProperty21.symbols b/tests/baselines/reference/symbolProperty21.symbols index 5a62b46dd85..544813c3056 100644 --- a/tests/baselines/reference/symbolProperty21.symbols +++ b/tests/baselines/reference/symbolProperty21.symbols @@ -5,14 +5,14 @@ interface I { >U : Symbol(U, Decl(symbolProperty21.ts, 0, 14)) [Symbol.unscopables]: T; ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) >T : Symbol(T, Decl(symbolProperty21.ts, 0, 12)) [Symbol.isConcatSpreadable]: U; >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) >U : Symbol(U, Decl(symbolProperty21.ts, 0, 14)) } @@ -35,17 +35,17 @@ foo({ [Symbol.isConcatSpreadable]: "", >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.d.ts, 1230, 24)) [Symbol.toPrimitive]: 0, ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) [Symbol.unscopables]: true ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) }); diff --git a/tests/baselines/reference/symbolProperty22.symbols b/tests/baselines/reference/symbolProperty22.symbols index c346eb2df33..e9f6761e121 100644 --- a/tests/baselines/reference/symbolProperty22.symbols +++ b/tests/baselines/reference/symbolProperty22.symbols @@ -5,9 +5,9 @@ interface I { >U : Symbol(U, Decl(symbolProperty22.ts, 0, 14)) [Symbol.unscopables](x: T): U; ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) >x : Symbol(x, Decl(symbolProperty22.ts, 1, 25)) >T : Symbol(T, Decl(symbolProperty22.ts, 0, 12)) >U : Symbol(U, Decl(symbolProperty22.ts, 0, 14)) @@ -27,9 +27,9 @@ declare function foo(p1: T, p2: I): U; foo("", { [Symbol.unscopables]: s => s.length }); >foo : Symbol(foo, Decl(symbolProperty22.ts, 2, 1)) ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) >s : Symbol(s, Decl(symbolProperty22.ts, 6, 31)) >s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) >s : Symbol(s, Decl(symbolProperty22.ts, 6, 31)) diff --git a/tests/baselines/reference/symbolProperty23.symbols b/tests/baselines/reference/symbolProperty23.symbols index f6cb0feaa45..d220f80c0f7 100644 --- a/tests/baselines/reference/symbolProperty23.symbols +++ b/tests/baselines/reference/symbolProperty23.symbols @@ -3,9 +3,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty23.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } class C implements I { @@ -13,9 +13,9 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty23.ts, 0, 0)) [Symbol.toPrimitive]() { ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) return true; } diff --git a/tests/baselines/reference/symbolProperty26.symbols b/tests/baselines/reference/symbolProperty26.symbols index e64337f1cf2..819b93e6147 100644 --- a/tests/baselines/reference/symbolProperty26.symbols +++ b/tests/baselines/reference/symbolProperty26.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty26.ts, 0, 0)) [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return ""; } @@ -16,9 +16,9 @@ class C2 extends C1 { >C1 : Symbol(C1, Decl(symbolProperty26.ts, 0, 0)) [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return ""; } diff --git a/tests/baselines/reference/symbolProperty27.symbols b/tests/baselines/reference/symbolProperty27.symbols index f2d92b6e0c7..7ead7b14b34 100644 --- a/tests/baselines/reference/symbolProperty27.symbols +++ b/tests/baselines/reference/symbolProperty27.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty27.ts, 0, 0)) [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return {}; } @@ -16,9 +16,9 @@ class C2 extends C1 { >C1 : Symbol(C1, Decl(symbolProperty27.ts, 0, 0)) [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return ""; } diff --git a/tests/baselines/reference/symbolProperty28.symbols b/tests/baselines/reference/symbolProperty28.symbols index 045ed15a707..9f57cd1e2e3 100644 --- a/tests/baselines/reference/symbolProperty28.symbols +++ b/tests/baselines/reference/symbolProperty28.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty28.ts, 0, 0)) [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty28.ts, 2, 16)) @@ -24,8 +24,8 @@ var obj = c[Symbol.toStringTag]().x; >obj : Symbol(obj, Decl(symbolProperty28.ts, 9, 3)) >c[Symbol.toStringTag]().x : Symbol(x, Decl(symbolProperty28.ts, 2, 16)) >c : Symbol(c, Decl(symbolProperty28.ts, 8, 3)) ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) >x : Symbol(x, Decl(symbolProperty28.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty4.symbols b/tests/baselines/reference/symbolProperty4.symbols index 564597e236d..a6594f5146b 100644 --- a/tests/baselines/reference/symbolProperty4.symbols +++ b/tests/baselines/reference/symbolProperty4.symbols @@ -3,13 +3,13 @@ var x = { >x : Symbol(x, Decl(symbolProperty4.ts, 0, 3)) [Symbol()]: 0, ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) [Symbol()]() { }, ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) get [Symbol()]() { ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) return 0; } diff --git a/tests/baselines/reference/symbolProperty40.symbols b/tests/baselines/reference/symbolProperty40.symbols index a524bd2b809..1f0fdaf91a7 100644 --- a/tests/baselines/reference/symbolProperty40.symbols +++ b/tests/baselines/reference/symbolProperty40.symbols @@ -4,19 +4,19 @@ class C { [Symbol.iterator](x: string): string; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty40.ts, 1, 22)) [Symbol.iterator](x: number): number; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty40.ts, 2, 22)) [Symbol.iterator](x: any) { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty40.ts, 3, 22)) @@ -32,12 +32,12 @@ var c = new C; c[Symbol.iterator](""); >c : Symbol(c, Decl(symbolProperty40.ts, 8, 3)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) c[Symbol.iterator](0); >c : Symbol(c, Decl(symbolProperty40.ts, 8, 3)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) diff --git a/tests/baselines/reference/symbolProperty41.symbols b/tests/baselines/reference/symbolProperty41.symbols index 78eae3f7704..d50401a637a 100644 --- a/tests/baselines/reference/symbolProperty41.symbols +++ b/tests/baselines/reference/symbolProperty41.symbols @@ -4,14 +4,14 @@ class C { [Symbol.iterator](x: string): { x: string }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty41.ts, 1, 22)) >x : Symbol(x, Decl(symbolProperty41.ts, 1, 35)) [Symbol.iterator](x: "hello"): { x: string; hello: string }; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty41.ts, 2, 22)) >x : Symbol(x, Decl(symbolProperty41.ts, 2, 36)) @@ -19,7 +19,7 @@ class C { [Symbol.iterator](x: any) { >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) >x : Symbol(x, Decl(symbolProperty41.ts, 3, 22)) @@ -35,12 +35,12 @@ var c = new C; c[Symbol.iterator](""); >c : Symbol(c, Decl(symbolProperty41.ts, 8, 3)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) c[Symbol.iterator]("hello"); >c : Symbol(c, Decl(symbolProperty41.ts, 8, 3)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) diff --git a/tests/baselines/reference/symbolProperty45.symbols b/tests/baselines/reference/symbolProperty45.symbols index d086418b1f7..4c3d2595c13 100644 --- a/tests/baselines/reference/symbolProperty45.symbols +++ b/tests/baselines/reference/symbolProperty45.symbols @@ -4,15 +4,15 @@ class C { get [Symbol.hasInstance]() { >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.d.ts, 1222, 32)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.d.ts, 1222, 32)) return ""; } get [Symbol.toPrimitive]() { ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) return ""; } diff --git a/tests/baselines/reference/symbolProperty5.symbols b/tests/baselines/reference/symbolProperty5.symbols index 8bef856c527..a759e09588e 100644 --- a/tests/baselines/reference/symbolProperty5.symbols +++ b/tests/baselines/reference/symbolProperty5.symbols @@ -4,18 +4,18 @@ var x = { [Symbol.iterator]: 0, >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) [Symbol.toPrimitive]() { }, ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) get [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return 0; } diff --git a/tests/baselines/reference/symbolProperty50.symbols b/tests/baselines/reference/symbolProperty50.symbols index 7d2c00d0c1f..ee785ae606d 100644 --- a/tests/baselines/reference/symbolProperty50.symbols +++ b/tests/baselines/reference/symbolProperty50.symbols @@ -10,7 +10,7 @@ module M { [Symbol.iterator]() { } >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) } } diff --git a/tests/baselines/reference/symbolProperty51.symbols b/tests/baselines/reference/symbolProperty51.symbols index 1f66a4f6416..825f73ebcd1 100644 --- a/tests/baselines/reference/symbolProperty51.symbols +++ b/tests/baselines/reference/symbolProperty51.symbols @@ -10,7 +10,7 @@ module M { [Symbol.iterator]() { } >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) } } diff --git a/tests/baselines/reference/symbolProperty55.symbols b/tests/baselines/reference/symbolProperty55.symbols index fadedd9c9ac..e76ad43f43d 100644 --- a/tests/baselines/reference/symbolProperty55.symbols +++ b/tests/baselines/reference/symbolProperty55.symbols @@ -4,7 +4,7 @@ var obj = { [Symbol.iterator]: 0 >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) }; diff --git a/tests/baselines/reference/symbolProperty56.symbols b/tests/baselines/reference/symbolProperty56.symbols index 51540e8f743..caca4686bbf 100644 --- a/tests/baselines/reference/symbolProperty56.symbols +++ b/tests/baselines/reference/symbolProperty56.symbols @@ -4,7 +4,7 @@ var obj = { [Symbol.iterator]: 0 >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) }; diff --git a/tests/baselines/reference/symbolProperty57.symbols b/tests/baselines/reference/symbolProperty57.symbols index 01bedd59434..4e0ce420388 100644 --- a/tests/baselines/reference/symbolProperty57.symbols +++ b/tests/baselines/reference/symbolProperty57.symbols @@ -4,7 +4,7 @@ var obj = { [Symbol.iterator]: 0 >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) }; @@ -12,5 +12,5 @@ var obj = { // Should give type 'any'. obj[Symbol["nonsense"]]; >obj : Symbol(obj, Decl(symbolProperty57.ts, 0, 3)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) diff --git a/tests/baselines/reference/symbolProperty6.symbols b/tests/baselines/reference/symbolProperty6.symbols index 9accb8142b4..cedcfe69a9f 100644 --- a/tests/baselines/reference/symbolProperty6.symbols +++ b/tests/baselines/reference/symbolProperty6.symbols @@ -4,23 +4,23 @@ class C { [Symbol.iterator] = 0; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) [Symbol.unscopables]: number; ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) [Symbol.toPrimitive]() { } ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) get [Symbol.toStringTag]() { ->Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1278, 24)) return 0; } diff --git a/tests/baselines/reference/symbolProperty8.symbols b/tests/baselines/reference/symbolProperty8.symbols index 7c894d2b00d..269a8412d95 100644 --- a/tests/baselines/reference/symbolProperty8.symbols +++ b/tests/baselines/reference/symbolProperty8.symbols @@ -3,12 +3,12 @@ interface I { >I : Symbol(I, Decl(symbolProperty8.ts, 0, 0)) [Symbol.unscopables]: number; ->Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1284, 24)) [Symbol.toPrimitive](); ->Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) ->toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1272, 18)) } diff --git a/tests/baselines/reference/symbolType11.symbols b/tests/baselines/reference/symbolType11.symbols index 219e0b2f496..4bf91a6112e 100644 --- a/tests/baselines/reference/symbolType11.symbols +++ b/tests/baselines/reference/symbolType11.symbols @@ -2,7 +2,7 @@ var s = Symbol.for("logical"); >s : Symbol(s, Decl(symbolType11.ts, 0, 3)) >Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.d.ts, 1208, 42)) ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11)) >for : Symbol(SymbolConstructor.for, Decl(lib.d.ts, 1208, 42)) s && s; diff --git a/tests/baselines/reference/symbolType16.symbols b/tests/baselines/reference/symbolType16.symbols index ac0749f4ac5..1d87ae6a1a4 100644 --- a/tests/baselines/reference/symbolType16.symbols +++ b/tests/baselines/reference/symbolType16.symbols @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/Symbols/symbolType16.ts === interface Symbol { ->Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11), Decl(symbolType16.ts, 0, 0)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11), Decl(symbolType16.ts, 0, 0)) newSymbolProp: number; >newSymbolProp : Symbol(newSymbolProp, Decl(symbolType16.ts, 0, 18)) diff --git a/tests/baselines/reference/systemExportAssignment.js b/tests/baselines/reference/systemExportAssignment.js new file mode 100644 index 00000000000..bae5f6129ea --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/systemExportAssignment.ts] //// + +//// [a.d.ts] + +declare var a: number; +export = a; // OK, in ambient context + +//// [b.ts] +import * as a from "a"; + + +//// [b.js] +System.register([], function(exports_1) { + return { + setters:[], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemExportAssignment.symbols b/tests/baselines/reference/systemExportAssignment.symbols new file mode 100644 index 00000000000..73346cdc4b8 --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/a.d.ts === + +declare var a: number; +>a : Symbol(a, Decl(a.d.ts, 1, 11)) + +export = a; // OK, in ambient context +>a : Symbol(a, Decl(a.d.ts, 1, 11)) + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + diff --git a/tests/baselines/reference/systemExportAssignment.types b/tests/baselines/reference/systemExportAssignment.types new file mode 100644 index 00000000000..84f896c301d --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment.types @@ -0,0 +1,12 @@ +=== tests/cases/compiler/a.d.ts === + +declare var a: number; +>a : number + +export = a; // OK, in ambient context +>a : number + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : number + diff --git a/tests/baselines/reference/systemExportAssignment2.errors.txt b/tests/baselines/reference/systemExportAssignment2.errors.txt new file mode 100644 index 00000000000..5606f8dd631 --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment2.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/a.ts(3,1): error TS1218: Export assignment is not supported when '--module' flag is 'system'. + + +==== tests/cases/compiler/a.ts (1 errors) ==== + + var a = 10; + export = a; // Error: export = not allowed in ES6 + ~~~~~~~~~~~ +!!! error TS1218: Export assignment is not supported when '--module' flag is 'system'. + +==== tests/cases/compiler/b.ts (0 errors) ==== + import * as a from "a"; + \ No newline at end of file diff --git a/tests/baselines/reference/systemExportAssignment2.js b/tests/baselines/reference/systemExportAssignment2.js new file mode 100644 index 00000000000..1ee0f4ff9b8 --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment2.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/systemExportAssignment2.ts] //// + +//// [a.ts] + +var a = 10; +export = a; // Error: export = not allowed in ES6 + +//// [b.ts] +import * as a from "a"; + + +//// [a.js] +System.register([], function(exports_1) { + var a; + return { + setters:[], + execute: function() { + a = 10; + } + } +}); +//// [b.js] +System.register([], function(exports_1) { + return { + setters:[], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemExportAssignment3.js b/tests/baselines/reference/systemExportAssignment3.js new file mode 100644 index 00000000000..46fcfd1b0ee --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment3.js @@ -0,0 +1,21 @@ +//// [tests/cases/compiler/systemExportAssignment3.ts] //// + +//// [modules.d.ts] + +declare module "a" { + var a: number; + export = a; // OK, in ambient context +} + +//// [b.ts] +import * as a from "a"; + + +//// [b.js] +System.register([], function(exports_1) { + return { + setters:[], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemExportAssignment3.symbols b/tests/baselines/reference/systemExportAssignment3.symbols new file mode 100644 index 00000000000..42d4a9d009f --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment3.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/modules.d.ts === + +declare module "a" { + var a: number; +>a : Symbol(a, Decl(modules.d.ts, 2, 7)) + + export = a; // OK, in ambient context +>a : Symbol(a, Decl(modules.d.ts, 2, 7)) +} + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + diff --git a/tests/baselines/reference/systemExportAssignment3.types b/tests/baselines/reference/systemExportAssignment3.types new file mode 100644 index 00000000000..c32bc14ec90 --- /dev/null +++ b/tests/baselines/reference/systemExportAssignment3.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/modules.d.ts === + +declare module "a" { + var a: number; +>a : number + + export = a; // OK, in ambient context +>a : number +} + +=== tests/cases/compiler/b.ts === +import * as a from "a"; +>a : number + diff --git a/tests/baselines/reference/systemModule1.errors.txt b/tests/baselines/reference/systemModule1.errors.txt new file mode 100644 index 00000000000..18b64607455 --- /dev/null +++ b/tests/baselines/reference/systemModule1.errors.txt @@ -0,0 +1,7 @@ +error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. + + +!!! error TS1204: Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher. +==== tests/cases/compiler/systemModule1.ts (0 errors) ==== + + export var x = 1; \ No newline at end of file diff --git a/tests/baselines/reference/systemModule1.js b/tests/baselines/reference/systemModule1.js new file mode 100644 index 00000000000..9731106471c --- /dev/null +++ b/tests/baselines/reference/systemModule1.js @@ -0,0 +1,6 @@ +//// [systemModule1.ts] + +export var x = 1; + +//// [systemModule1.js] +export var x = 1; diff --git a/tests/baselines/reference/systemModule10.errors.txt b/tests/baselines/reference/systemModule10.errors.txt new file mode 100644 index 00000000000..524e9bbe85d --- /dev/null +++ b/tests/baselines/reference/systemModule10.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/systemModule10.ts(2,20): error TS2307: Cannot find module 'file1'. +tests/cases/compiler/systemModule10.ts(3,21): error TS2307: Cannot find module 'file2'. + + +==== tests/cases/compiler/systemModule10.ts (2 errors) ==== + + import n, {x} from 'file1' + ~~~~~~~ +!!! error TS2307: Cannot find module 'file1'. + import n2 = require('file2'); + ~~~~~~~ +!!! error TS2307: Cannot find module 'file2'. + export {x} + export {x as y} + export {n} + export {n as n1} + export {n2} + export {n2 as n3} \ No newline at end of file diff --git a/tests/baselines/reference/systemModule10.js b/tests/baselines/reference/systemModule10.js new file mode 100644 index 00000000000..c63b3589085 --- /dev/null +++ b/tests/baselines/reference/systemModule10.js @@ -0,0 +1,32 @@ +//// [systemModule10.ts] + +import n, {x} from 'file1' +import n2 = require('file2'); +export {x} +export {x as y} +export {n} +export {n as n1} +export {n2} +export {n2 as n3} + +//// [systemModule10.js] +System.register(['file1', 'file2'], function(exports_1) { + var file1_1, n2; + return { + setters:[ + function (_file1_1) { + file1_1 = _file1_1; + exports_1("n", file1_1["default"]); + exports_1("n1", file1_1["default"]); + exports_1("x", file1_1.x); + exports_1("y", file1_1.x); + }, + function (_n2) { + n2 = _n2; + exports_1("n2", n2); + exports_1("n3", n2); + }], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemModule10_ES5.errors.txt b/tests/baselines/reference/systemModule10_ES5.errors.txt new file mode 100644 index 00000000000..6f0e5305166 --- /dev/null +++ b/tests/baselines/reference/systemModule10_ES5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/systemModule10_ES5.ts(2,20): error TS2307: Cannot find module 'file1'. +tests/cases/compiler/systemModule10_ES5.ts(3,21): error TS2307: Cannot find module 'file2'. + + +==== tests/cases/compiler/systemModule10_ES5.ts (2 errors) ==== + + import n, {x} from 'file1' + ~~~~~~~ +!!! error TS2307: Cannot find module 'file1'. + import n2 = require('file2'); + ~~~~~~~ +!!! error TS2307: Cannot find module 'file2'. + export {x} + export {x as y} + export {n} + export {n as n1} + export {n2} + export {n2 as n3} \ No newline at end of file diff --git a/tests/baselines/reference/systemModule10_ES5.js b/tests/baselines/reference/systemModule10_ES5.js new file mode 100644 index 00000000000..bdb920414de --- /dev/null +++ b/tests/baselines/reference/systemModule10_ES5.js @@ -0,0 +1,32 @@ +//// [systemModule10_ES5.ts] + +import n, {x} from 'file1' +import n2 = require('file2'); +export {x} +export {x as y} +export {n} +export {n as n1} +export {n2} +export {n2 as n3} + +//// [systemModule10_ES5.js] +System.register(['file1', 'file2'], function(exports_1) { + var file1_1, n2; + return { + setters:[ + function (_file1_1) { + file1_1 = _file1_1; + exports_1("n", file1_1.default); + exports_1("n1", file1_1.default); + exports_1("x", file1_1.x); + exports_1("y", file1_1.x); + }, + function (_n2) { + n2 = _n2; + exports_1("n2", n2); + exports_1("n3", n2); + }], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemModule11.errors.txt b/tests/baselines/reference/systemModule11.errors.txt new file mode 100644 index 00000000000..ed8f036c14f --- /dev/null +++ b/tests/baselines/reference/systemModule11.errors.txt @@ -0,0 +1,59 @@ +tests/cases/compiler/file1.ts(7,15): error TS2307: Cannot find module 'bar'. +tests/cases/compiler/file2.ts(7,15): error TS2307: Cannot find module 'bar'. +tests/cases/compiler/file3.ts(2,25): error TS2307: Cannot find module 'a'. +tests/cases/compiler/file3.ts(4,15): error TS2307: Cannot find module 'bar'. +tests/cases/compiler/file4.ts(9,27): error TS2307: Cannot find module 'a'. +tests/cases/compiler/file5.ts(3,15): error TS2307: Cannot find module 'a'. + + +==== tests/cases/compiler/file1.ts (1 errors) ==== + + // set of tests cases that checks generation of local storage for exported names + + + export var x; + export function foo() {} + export * from 'bar'; + ~~~~~ +!!! error TS2307: Cannot find module 'bar'. + +==== tests/cases/compiler/file2.ts (1 errors) ==== + + var x; + var y; + export {x}; + export {y as y1} + + export * from 'bar'; + ~~~~~ +!!! error TS2307: Cannot find module 'bar'. + +==== tests/cases/compiler/file3.ts (2 errors) ==== + + export {x, y as z} from 'a'; + ~~~ +!!! error TS2307: Cannot find module 'a'. + export default function foo() {} + export * from 'bar'; + ~~~~~ +!!! error TS2307: Cannot find module 'bar'. + +==== tests/cases/compiler/file4.ts (1 errors) ==== + + export var x; + export function foo() {} + export default function (){} + + var z, z1; + export {z, z1 as z2}; + + export {s, s1 as s2} from 'a' + ~~~ +!!! error TS2307: Cannot find module 'a'. + +==== tests/cases/compiler/file5.ts (1 errors) ==== + + function foo() {} + export * from 'a'; + ~~~ +!!! error TS2307: Cannot find module 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/systemModule11.js b/tests/baselines/reference/systemModule11.js new file mode 100644 index 00000000000..91c05e8263a --- /dev/null +++ b/tests/baselines/reference/systemModule11.js @@ -0,0 +1,153 @@ +//// [tests/cases/compiler/systemModule11.ts] //// + +//// [file1.ts] + +// set of tests cases that checks generation of local storage for exported names + + +export var x; +export function foo() {} +export * from 'bar'; + +//// [file2.ts] + +var x; +var y; +export {x}; +export {y as y1} + +export * from 'bar'; + +//// [file3.ts] + +export {x, y as z} from 'a'; +export default function foo() {} +export * from 'bar'; + +//// [file4.ts] + +export var x; +export function foo() {} +export default function (){} + +var z, z1; +export {z, z1 as z2}; + +export {s, s1 as s2} from 'a' + +//// [file5.ts] + +function foo() {} +export * from 'a'; + +//// [file1.js] +// set of tests cases that checks generation of local storage for exported names +System.register(['bar'], function(exports_1) { + var x; + function foo() { } + exports_1("foo", foo); + var exportedNames_1 = { + 'x': true, + 'foo': true + }; + function exportStar_1(m) { + for(var n in m) { + if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports_1(n, m[n]); + } + } + return { + setters:[ + function (_bar_1) { + exportStar_1(_bar_1); + }], + execute: function() { + exports_1("x", x); + } + } +}); +//// [file2.js] +System.register(['bar'], function(exports_1) { + var x, y; + var exportedNames_1 = { + 'x': true, + 'y1': true + }; + function exportStar_1(m) { + for(var n in m) { + if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports_1(n, m[n]); + } + } + return { + setters:[ + function (_bar_1) { + exportStar_1(_bar_1); + }], + execute: function() { + exports_1("x", x); + exports_1("y1", y); + } + } +}); +//// [file3.js] +System.register(['a', 'bar'], function(exports_1) { + function foo() { } + exports_1("default", foo); + var exportedNames_1 = { + 'x': true, + 'z': true + }; + function exportStar_1(m) { + for(var n in m) { + if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports_1(n, m[n]); + } + } + return { + setters:[ + function (_a_1) { + exports_1("x", _a_1["x"]); + exports_1("z", _a_1["y"]); + }, + function (_bar_1) { + exportStar_1(_bar_1); + }], + execute: function() { + } + } +}); +//// [file4.js] +System.register(['a'], function(exports_1) { + var x, z, z1; + function foo() { } + exports_1("foo", foo); + function default_1() { } + exports_1("default", default_1); + return { + setters:[ + function (_a_1) { + exports_1("s", _a_1["s"]); + exports_1("s2", _a_1["s1"]); + }], + execute: function() { + exports_1("x", x); + exports_1("z", z); + exports_1("z2", z1); + } + } +}); +//// [file5.js] +System.register(['a'], function(exports_1) { + function foo() { } + function exportStar_1(m) { + for(var n in m) { + if (n !== "default") exports_1(n, m[n]); + } + } + return { + setters:[ + function (_a_1) { + exportStar_1(_a_1); + }], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemModule2.errors.txt b/tests/baselines/reference/systemModule2.errors.txt new file mode 100644 index 00000000000..e323e2cde2e --- /dev/null +++ b/tests/baselines/reference/systemModule2.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/systemModule2.ts(3,1): error TS1218: Export assignment is not supported when '--module' flag is 'system'. + + +==== tests/cases/compiler/systemModule2.ts (1 errors) ==== + + var x = 1; + export = x; + ~~~~~~~~~~~ +!!! error TS1218: Export assignment is not supported when '--module' flag is 'system'. \ No newline at end of file diff --git a/tests/baselines/reference/systemModule2.js b/tests/baselines/reference/systemModule2.js new file mode 100644 index 00000000000..cc0a3cc2916 --- /dev/null +++ b/tests/baselines/reference/systemModule2.js @@ -0,0 +1,15 @@ +//// [systemModule2.ts] + +var x = 1; +export = x; + +//// [systemModule2.js] +System.register([], function(exports_1) { + var x; + return { + setters:[], + execute: function() { + x = 1; + } + } +}); diff --git a/tests/baselines/reference/systemModule3.js b/tests/baselines/reference/systemModule3.js new file mode 100644 index 00000000000..885e86e442a --- /dev/null +++ b/tests/baselines/reference/systemModule3.js @@ -0,0 +1,69 @@ +//// [tests/cases/compiler/systemModule3.ts] //// + +//// [file1.ts] + + +export default function() {} + +//// [file2.ts] + +export default function f() {} + +//// [file3.ts] + +export default class C {} + +//// [file4.ts] + +export default class {} + +//// [file1.js] +System.register([], function(exports_1) { + function default_1() { } + exports_1("default", default_1); + return { + setters:[], + execute: function() { + } + } +}); +//// [file2.js] +System.register([], function(exports_1) { + function f() { } + exports_1("default", f); + return { + setters:[], + execute: function() { + } + } +}); +//// [file3.js] +System.register([], function(exports_1) { + var C; + return { + setters:[], + execute: function() { + C = (function () { + function C() { + } + return C; + })(); + exports_1("default", C); + } + } +}); +//// [file4.js] +System.register([], function(exports_1) { + var default_1; + return { + setters:[], + execute: function() { + default_1 = (function () { + function default_1() { + } + return default_1; + })(); + exports_1("default", default_1); + } + } +}); diff --git a/tests/baselines/reference/systemModule3.symbols b/tests/baselines/reference/systemModule3.symbols new file mode 100644 index 00000000000..a8f8ab46915 --- /dev/null +++ b/tests/baselines/reference/systemModule3.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/file1.ts === + +No type information for this code. +No type information for this code.export default function() {} +No type information for this code. +No type information for this code.=== tests/cases/compiler/file2.ts === + +export default function f() {} +>f : Symbol(f, Decl(file2.ts, 0, 0)) + +=== tests/cases/compiler/file3.ts === + +export default class C {} +>C : Symbol(C, Decl(file3.ts, 0, 0)) + +=== tests/cases/compiler/file4.ts === + +No type information for this code.export default class {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/systemModule3.types b/tests/baselines/reference/systemModule3.types new file mode 100644 index 00000000000..4448588b74c --- /dev/null +++ b/tests/baselines/reference/systemModule3.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/file1.ts === + +No type information for this code. +No type information for this code.export default function() {} +No type information for this code. +No type information for this code.=== tests/cases/compiler/file2.ts === + +export default function f() {} +>f : () => void + +=== tests/cases/compiler/file3.ts === + +export default class C {} +>C : C + +=== tests/cases/compiler/file4.ts === + +No type information for this code.export default class {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/systemModule4.js b/tests/baselines/reference/systemModule4.js new file mode 100644 index 00000000000..0b045b620ff --- /dev/null +++ b/tests/baselines/reference/systemModule4.js @@ -0,0 +1,16 @@ +//// [systemModule4.ts] + +export var x = 1; +export var y; + +//// [systemModule4.js] +System.register([], function(exports_1) { + var x, y; + return { + setters:[], + execute: function() { + exports_1("x", x = 1); + exports_1("y", y); + } + } +}); diff --git a/tests/baselines/reference/systemModule4.symbols b/tests/baselines/reference/systemModule4.symbols new file mode 100644 index 00000000000..b0bc1a1cfc1 --- /dev/null +++ b/tests/baselines/reference/systemModule4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/systemModule4.ts === + +export var x = 1; +>x : Symbol(x, Decl(systemModule4.ts, 1, 10)) + +export var y; +>y : Symbol(y, Decl(systemModule4.ts, 2, 10)) + diff --git a/tests/baselines/reference/systemModule4.types b/tests/baselines/reference/systemModule4.types new file mode 100644 index 00000000000..2029cdb88d7 --- /dev/null +++ b/tests/baselines/reference/systemModule4.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/systemModule4.ts === + +export var x = 1; +>x : number +>1 : number + +export var y; +>y : any + diff --git a/tests/baselines/reference/systemModule5.js b/tests/baselines/reference/systemModule5.js new file mode 100644 index 00000000000..4d9aadb3566 --- /dev/null +++ b/tests/baselines/reference/systemModule5.js @@ -0,0 +1,15 @@ +//// [systemModule5.ts] + +export function foo() {} + + +//// [systemModule5.js] +System.register([], function(exports_1) { + function foo() { } + exports_1("foo", foo); + return { + setters:[], + execute: function() { + } + } +}); diff --git a/tests/baselines/reference/systemModule5.symbols b/tests/baselines/reference/systemModule5.symbols new file mode 100644 index 00000000000..b2f896dd183 --- /dev/null +++ b/tests/baselines/reference/systemModule5.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/systemModule5.ts === + +export function foo() {} +>foo : Symbol(foo, Decl(systemModule5.ts, 0, 0)) + diff --git a/tests/baselines/reference/systemModule5.types b/tests/baselines/reference/systemModule5.types new file mode 100644 index 00000000000..0061f002801 --- /dev/null +++ b/tests/baselines/reference/systemModule5.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/systemModule5.ts === + +export function foo() {} +>foo : () => void + diff --git a/tests/baselines/reference/systemModule6.js b/tests/baselines/reference/systemModule6.js new file mode 100644 index 00000000000..d36535f6761 --- /dev/null +++ b/tests/baselines/reference/systemModule6.js @@ -0,0 +1,26 @@ +//// [systemModule6.ts] + +export class C {} +function foo() { + new C(); +} + + +//// [systemModule6.js] +System.register([], function(exports_1) { + var C; + function foo() { + new C(); + } + return { + setters:[], + execute: function() { + C = (function () { + function C() { + } + return C; + })(); + exports_1("C", C); + } + } +}); diff --git a/tests/baselines/reference/systemModule6.symbols b/tests/baselines/reference/systemModule6.symbols new file mode 100644 index 00000000000..e01d276559a --- /dev/null +++ b/tests/baselines/reference/systemModule6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/systemModule6.ts === + +export class C {} +>C : Symbol(C, Decl(systemModule6.ts, 0, 0)) + +function foo() { +>foo : Symbol(foo, Decl(systemModule6.ts, 1, 17)) + + new C(); +>C : Symbol(C, Decl(systemModule6.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/systemModule6.types b/tests/baselines/reference/systemModule6.types new file mode 100644 index 00000000000..cc8a97c066e --- /dev/null +++ b/tests/baselines/reference/systemModule6.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/systemModule6.ts === + +export class C {} +>C : C + +function foo() { +>foo : () => void + + new C(); +>new C() : C +>C : typeof C +} + diff --git a/tests/baselines/reference/systemModule7.js b/tests/baselines/reference/systemModule7.js new file mode 100644 index 00000000000..85dd42da87d --- /dev/null +++ b/tests/baselines/reference/systemModule7.js @@ -0,0 +1,26 @@ +//// [systemModule7.ts] + +// filename: instantiatedModule.ts +export module M { + var x = 1; +} + +// filename: nonInstantiatedModule.ts +export module M { + interface I {} +} + +//// [systemModule7.js] +System.register([], function(exports_1) { + var M; + return { + setters:[], + execute: function() { + // filename: instantiatedModule.ts + (function (M) { + var x = 1; + })(M = M || (M = {})); + exports_1("M", M) + } + } +}); diff --git a/tests/baselines/reference/systemModule7.symbols b/tests/baselines/reference/systemModule7.symbols new file mode 100644 index 00000000000..e47ab5510b5 --- /dev/null +++ b/tests/baselines/reference/systemModule7.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/systemModule7.ts === + +// filename: instantiatedModule.ts +export module M { +>M : Symbol(M, Decl(systemModule7.ts, 0, 0), Decl(systemModule7.ts, 4, 1)) + + var x = 1; +>x : Symbol(x, Decl(systemModule7.ts, 3, 7)) +} + +// filename: nonInstantiatedModule.ts +export module M { +>M : Symbol(M, Decl(systemModule7.ts, 0, 0), Decl(systemModule7.ts, 4, 1)) + + interface I {} +>I : Symbol(I, Decl(systemModule7.ts, 7, 17)) +} diff --git a/tests/baselines/reference/systemModule7.types b/tests/baselines/reference/systemModule7.types new file mode 100644 index 00000000000..650e2d6cdb1 --- /dev/null +++ b/tests/baselines/reference/systemModule7.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/systemModule7.ts === + +// filename: instantiatedModule.ts +export module M { +>M : typeof M + + var x = 1; +>x : number +>1 : number +} + +// filename: nonInstantiatedModule.ts +export module M { +>M : typeof M + + interface I {} +>I : I +} diff --git a/tests/baselines/reference/systemModule8.js b/tests/baselines/reference/systemModule8.js new file mode 100644 index 00000000000..578814d0ab2 --- /dev/null +++ b/tests/baselines/reference/systemModule8.js @@ -0,0 +1,71 @@ +//// [systemModule8.ts] + +export var x; +x = 1; +x++; +x--; +++x; +--x; +x += 1; +x -= 1; +x *= 1; +x /= 1; +x |= 1; +x &= 1; +x + 1; +x - 1; +x & 1; +x | 1; +for (x = 5;;x++) {} +for (x = 8;;x--) {} +for (x = 15;;++x) {} +for (x = 18;;--x) {} + +for (let x = 50;;) {} +function foo() { + x = 100; +} + +export let [y] = [1]; +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +for ([x] of [[1]]) {} + +//// [systemModule8.js] +System.register([], function(exports_1) { + var x, y, z0, z1; + function foo() { + exports_1("x", x = 100); + } + return { + setters:[], + execute: function() { + exports_1("x", x); + exports_1("x", x = 1); + (exports_1("x", ++x) - 1); + (exports_1("x", --x) + 1); + exports_1("x", ++x); + exports_1("x", --x); + exports_1("x", x += 1); + exports_1("x", x -= 1); + exports_1("x", x *= 1); + exports_1("x", x /= 1); + exports_1("x", x |= 1); + exports_1("x", x &= 1); + x + 1; + x - 1; + x & 1; + x | 1; + for (exports_1("x", x = 5);; (exports_1("x", ++x) - 1)) { } + for (exports_1("x", x = 8);; (exports_1("x", --x) + 1)) { } + for (exports_1("x", x = 15);; exports_1("x", ++x)) { } + for (exports_1("x", x = 18);; exports_1("x", --x)) { } + for (var x_1 = 50;;) { } + exports_1("y", y = [1][0]); + _a = { a: true, b: { c: "123" } }, exports_1("z0", z0 = _a.a), exports_1("z1", z1 = _a.b.c); + for (var _i = 0, _b = [[1]]; _i < _b.length; _i++) { + exports_1("x", x = _b[_i][0]); + } + } + var _a; + } +}); diff --git a/tests/baselines/reference/systemModule8.symbols b/tests/baselines/reference/systemModule8.symbols new file mode 100644 index 00000000000..3365ce7e37d --- /dev/null +++ b/tests/baselines/reference/systemModule8.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/systemModule8.ts === + +export var x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x = 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x++; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x--; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +++x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +--x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x += 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x -= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x *= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x /= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x |= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x &= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x + 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x - 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x & 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x | 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 5;;x++) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 8;;x--) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 15;;++x) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 18;;--x) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (let x = 50;;) {} +>x : Symbol(x, Decl(systemModule8.ts, 22, 8)) + +function foo() { +>foo : Symbol(foo, Decl(systemModule8.ts, 22, 21)) + + x = 100; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +} + +export let [y] = [1]; +>y : Symbol(y, Decl(systemModule8.ts, 27, 12)) + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>z0 : Symbol(z0, Decl(systemModule8.ts, 28, 14)) +>z1 : Symbol(z1, Decl(systemModule8.ts, 28, 25)) +>a : Symbol(a, Decl(systemModule8.ts, 28, 36)) +>b : Symbol(b, Decl(systemModule8.ts, 28, 44)) +>c : Symbol(c, Decl(systemModule8.ts, 28, 49)) + +for ([x] of [[1]]) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + diff --git a/tests/baselines/reference/systemModule8.types b/tests/baselines/reference/systemModule8.types new file mode 100644 index 00000000000..2c3dd1e48bb --- /dev/null +++ b/tests/baselines/reference/systemModule8.types @@ -0,0 +1,143 @@ +=== tests/cases/compiler/systemModule8.ts === + +export var x; +>x : any + +x = 1; +>x = 1 : number +>x : any +>1 : number + +x++; +>x++ : number +>x : any + +x--; +>x-- : number +>x : any + +++x; +>++x : number +>x : any + +--x; +>--x : number +>x : any + +x += 1; +>x += 1 : any +>x : any +>1 : number + +x -= 1; +>x -= 1 : number +>x : any +>1 : number + +x *= 1; +>x *= 1 : number +>x : any +>1 : number + +x /= 1; +>x /= 1 : number +>x : any +>1 : number + +x |= 1; +>x |= 1 : number +>x : any +>1 : number + +x &= 1; +>x &= 1 : number +>x : any +>1 : number + +x + 1; +>x + 1 : any +>x : any +>1 : number + +x - 1; +>x - 1 : number +>x : any +>1 : number + +x & 1; +>x & 1 : number +>x : any +>1 : number + +x | 1; +>x | 1 : number +>x : any +>1 : number + +for (x = 5;;x++) {} +>x = 5 : number +>x : any +>5 : number +>x++ : number +>x : any + +for (x = 8;;x--) {} +>x = 8 : number +>x : any +>8 : number +>x-- : number +>x : any + +for (x = 15;;++x) {} +>x = 15 : number +>x : any +>15 : number +>++x : number +>x : any + +for (x = 18;;--x) {} +>x = 18 : number +>x : any +>18 : number +>--x : number +>x : any + +for (let x = 50;;) {} +>x : number +>50 : number + +function foo() { +>foo : () => void + + x = 100; +>x = 100 : number +>x : any +>100 : number +} + +export let [y] = [1]; +>y : number +>[1] : [number] +>1 : number + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>a : any +>z0 : boolean +>b : any +>c : any +>z1 : string +>{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } +>a : boolean +>true : boolean +>b : { c: string; } +>{c: "123"} : { c: string; } +>c : string +>"123" : string + +for ([x] of [[1]]) {} +>[x] : any[] +>x : any +>[[1]] : number[][] +>[1] : number[] +>1 : number + diff --git a/tests/baselines/reference/systemModule9.errors.txt b/tests/baselines/reference/systemModule9.errors.txt new file mode 100644 index 00000000000..27af70cce6a --- /dev/null +++ b/tests/baselines/reference/systemModule9.errors.txt @@ -0,0 +1,42 @@ +tests/cases/compiler/systemModule9.ts(2,21): error TS2307: Cannot find module 'file1'. +tests/cases/compiler/systemModule9.ts(3,25): error TS2307: Cannot find module 'file2'. +tests/cases/compiler/systemModule9.ts(4,15): error TS2307: Cannot find module 'file3'. +tests/cases/compiler/systemModule9.ts(6,25): error TS2307: Cannot find module 'file5'. +tests/cases/compiler/systemModule9.ts(7,22): error TS2307: Cannot find module 'file6'. +tests/cases/compiler/systemModule9.ts(17,15): error TS2307: Cannot find module 'file7'. + + +==== tests/cases/compiler/systemModule9.ts (6 errors) ==== + + import * as ns from 'file1'; + ~~~~~~~ +!!! error TS2307: Cannot find module 'file1'. + import {a, b as c} from 'file2'; + ~~~~~~~ +!!! error TS2307: Cannot find module 'file2'. + import d from 'file3' + ~~~~~~~ +!!! error TS2307: Cannot find module 'file3'. + import 'file4' + import e, * as ns2 from 'file5'; + ~~~~~~~ +!!! error TS2307: Cannot find module 'file5'. + import ns3 = require('file6'); + ~~~~~~~ +!!! error TS2307: Cannot find module 'file6'. + + ns.f(); + a(); + c(); + d(); + e(); + ns2.f(); + ns3.f(); + + export * from 'file7'; + ~~~~~~~ +!!! error TS2307: Cannot find module 'file7'. + + var x, y = true; + export {x}; + export {y as z}; \ No newline at end of file diff --git a/tests/baselines/reference/systemModule9.js b/tests/baselines/reference/systemModule9.js new file mode 100644 index 00000000000..af05948c351 --- /dev/null +++ b/tests/baselines/reference/systemModule9.js @@ -0,0 +1,71 @@ +//// [systemModule9.ts] + +import * as ns from 'file1'; +import {a, b as c} from 'file2'; +import d from 'file3' +import 'file4' +import e, * as ns2 from 'file5'; +import ns3 = require('file6'); + +ns.f(); +a(); +c(); +d(); +e(); +ns2.f(); +ns3.f(); + +export * from 'file7'; + +var x, y = true; +export {x}; +export {y as z}; + +//// [systemModule9.js] +System.register(['file1', 'file2', 'file3', 'file4', 'file5', 'file6', 'file7'], function(exports_1) { + var ns, file2_1, file3_1, file5_1, ns3; + var x, y; + var exportedNames_1 = { + 'x': true, + 'z': true + }; + function exportStar_1(m) { + for(var n in m) { + if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports_1(n, m[n]); + } + } + return { + setters:[ + function (_ns) { + ns = _ns; + }, + function (_file2_1) { + file2_1 = _file2_1; + }, + function (_file3_1) { + file3_1 = _file3_1; + }, + function (_) {}, + function (_file5_1) { + file5_1 = _file5_1; + }, + function (_ns3) { + ns3 = _ns3; + }, + function (_file7_1) { + exportStar_1(_file7_1); + }], + execute: function() { + ns.f(); + file2_1.a(); + file2_1.b(); + file3_1["default"](); + file5_1["default"](); + ns2.f(); + ns3.f(); + y = true; + exports_1("x", x); + exports_1("z", y); + } + } +}); diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index c886183bacf..bde689ba2c9 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -19,7 +19,7 @@ class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // err //// [targetTypeBaseCalls.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols index 7191801513a..0cfe0d854be 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts === var x = `abc${ new String("Hi") }def`; >x : Symbol(x, Decl(templateStringWithEmbeddedNewOperatorES6.ts, 0, 3)) ->String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1508, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1)) diff --git a/tests/baselines/reference/thisInInvalidContexts.errors.txt b/tests/baselines/reference/thisInInvalidContexts.errors.txt index 481c4747c99..055e0770dea 100644 --- a/tests/baselines/reference/thisInInvalidContexts.errors.txt +++ b/tests/baselines/reference/thisInInvalidContexts.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(28,13): error TS2331: 'this' cannot be referenced in a module or namespace body. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): error TS2332: 'this' cannot be referenced in current location. @@ -40,7 +40,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9): //'this' in module variable var x = this; // Error ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } //'this' as type parameter constraint diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 5720156de0b..afce4ec0375 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -49,7 +49,7 @@ enum SomeEnum { //// [thisInInvalidContexts.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index a8bf99de27b..03c494cad45 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(22,15): error TS2332: 'this' cannot be referenced in current location. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(28,13): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(28,13): error TS2331: 'this' cannot be referenced in a module or namespace body. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS9002: Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(44,9): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(45,9): error TS2332: 'this' cannot be referenced in current location. -tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. ==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (7 errors) ==== @@ -41,7 +41,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod //'this' in module variable var x = this; // Error ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } //'this' as type parameter constraint @@ -69,4 +69,4 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod export = this; // Should be an error ~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index eee8bcc8487..8fcbe226437 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -49,7 +49,7 @@ enum SomeEnum { export = this; // Should be an error //// [thisInInvalidContextsExternalModule.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/thisInModule.errors.txt b/tests/baselines/reference/thisInModule.errors.txt index d60bf51c1ba..5c4374b14a3 100644 --- a/tests/baselines/reference/thisInModule.errors.txt +++ b/tests/baselines/reference/thisInModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/thisInModule.ts(3,5): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/compiler/thisInModule.ts(3,5): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/compiler/thisInModule.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/thisInModule.ts(3,5): error TS2331: 'this' cannot be refere var x; this.x = 5; ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } \ No newline at end of file diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 779d74daa58..3da6d9c8a68 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -23,7 +23,7 @@ class Foo3 extends Base { } //// [thisInSuperCall.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index 09b3c2cb591..b0ff1bd4bab 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -11,7 +11,7 @@ class Foo extends Base { //// [thisInSuperCall1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index d21496a9834..fca671a2c73 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -20,7 +20,7 @@ class Foo2 extends Base { //// [thisInSuperCall2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 6660788e40d..fe2bdec77ed 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -13,7 +13,7 @@ class Foo extends Base { //// [thisInSuperCall3.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/thisKeyword.errors.txt b/tests/baselines/reference/thisKeyword.errors.txt index ba55df7bff3..facf52a3995 100644 --- a/tests/baselines/reference/thisKeyword.errors.txt +++ b/tests/baselines/reference/thisKeyword.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/thisKeyword.ts(2,5): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/compiler/thisKeyword.ts(2,5): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/compiler/thisKeyword.ts (1 errors) ==== module foo { this.bar = 4; ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } \ No newline at end of file diff --git a/tests/baselines/reference/topLevelFileModuleMissing.errors.txt b/tests/baselines/reference/topLevelFileModuleMissing.errors.txt index ebeaf2e3474..7642bfd86a2 100644 --- a/tests/baselines/reference/topLevelFileModuleMissing.errors.txt +++ b/tests/baselines/reference/topLevelFileModuleMissing.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find external module 'vs/foo'. +tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find module 'vs/foo'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("vs/foo"); ~~~~~~~~ -!!! error TS2307: Cannot find external module 'vs/foo'. +!!! error TS2307: Cannot find module 'vs/foo'. var z = foo.x + 10; ==== tests/cases/conformance/externalModules/vs/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/topLevelLambda.errors.txt b/tests/baselines/reference/topLevelLambda.errors.txt index f83921cb5c8..c36864d243f 100644 --- a/tests/baselines/reference/topLevelLambda.errors.txt +++ b/tests/baselines/reference/topLevelLambda.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/topLevelLambda.ts(2,17): error TS2331: 'this' cannot be referenced in a module body. +tests/cases/compiler/topLevelLambda.ts(2,17): error TS2331: 'this' cannot be referenced in a module or namespace body. ==== tests/cases/compiler/topLevelLambda.ts (1 errors) ==== module M { var f = () => {this.window;} ~~~~ -!!! error TS2331: 'this' cannot be referenced in a module body. +!!! error TS2331: 'this' cannot be referenced in a module or namespace body. } \ No newline at end of file diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index 01acf58227b..51ca6a27f0e 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -43,7 +43,7 @@ someOther = someOther; //// [typeAssertions.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index 093e80cbb74..de7e9813a84 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -36,7 +36,7 @@ var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 // - when true, narrows the type of x to the type of the 'prototype' property in C provided // it is a subtype of the type of x, or // - when false, has no effect on the type of x. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt new file mode 100644 index 00000000000..4e6a8b83ae3 --- /dev/null +++ b/tests/baselines/reference/typeGuardsOnClassProperty.errors.txt @@ -0,0 +1,37 @@ +tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(14,70): error TS2339: Property 'join' does not exist on type 'string | string[]'. +tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,44): error TS2339: Property 'toLowerCase' does not exist on type 'string | number'. + + +==== tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts (2 errors) ==== + // Note that type guards affect types of variables and parameters only and + // have no effect on members of objects such as properties. + + // Note that the class's property must be copied to a local variable for + // the type guard to have an effect + class D { + data: string | string[]; + getData() { + var data = this.data; + return typeof data === "string" ? data : data.join(" "); + } + + getData1() { + return typeof this.data === "string" ? this.data : this.data.join(" "); + ~~~~ +!!! error TS2339: Property 'join' does not exist on type 'string | string[]'. + } + } + + var o: { + prop1: number|string; + prop2: boolean|string; + } = { + prop1: "string" , + prop2: true + } + + if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} + ~~~~~~~~~~~ +!!! error TS2339: Property 'toLowerCase' does not exist on type 'string | number'. + var prop1 = o.prop1; + if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.js b/tests/baselines/reference/typeGuardsOnClassProperty.js new file mode 100644 index 00000000000..de4fcb50638 --- /dev/null +++ b/tests/baselines/reference/typeGuardsOnClassProperty.js @@ -0,0 +1,54 @@ +//// [typeGuardsOnClassProperty.ts] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// Note that the class's property must be copied to a local variable for +// the type guard to have an effect +class D { + data: string | string[]; + getData() { + var data = this.data; + return typeof data === "string" ? data : data.join(" "); + } + + getData1() { + return typeof this.data === "string" ? this.data : this.data.join(" "); + } +} + +var o: { + prop1: number|string; + prop2: boolean|string; +} = { + prop1: "string" , + prop2: true + } + +if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} +var prop1 = o.prop1; +if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } + +//// [typeGuardsOnClassProperty.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// Note that the class's property must be copied to a local variable for +// the type guard to have an effect +var D = (function () { + function D() { + } + D.prototype.getData = function () { + var data = this.data; + return typeof data === "string" ? data : data.join(" "); + }; + D.prototype.getData1 = function () { + return typeof this.data === "string" ? this.data : this.data.join(" "); + }; + return D; +})(); +var o = { + prop1: "string", + prop2: true +}; +if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) { } +var prop1 = o.prop1; +if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } diff --git a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt new file mode 100644 index 00000000000..b963b2c33ae --- /dev/null +++ b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt @@ -0,0 +1,220 @@ +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(12,10): error TS2339: Property 'bar' does not exist on type 'A'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(34,10): error TS2339: Property 'bar' does not exist on type 'B'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(63,10): error TS2339: Property 'bar2' does not exist on type 'C1'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(82,10): error TS2339: Property 'bar' does not exist on type 'D'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(109,10): error TS2339: Property 'bar2' does not exist on type 'E1'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(131,11): error TS2339: Property 'foo' does not exist on type 'string | F'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(132,11): error TS2339: Property 'bar' does not exist on type 'string | F'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(157,11): error TS2339: Property 'foo2' does not exist on type 'G1'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(179,11): error TS2339: Property 'bar' does not exist on type 'H'. + + +==== tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts (10 errors) ==== + interface AConstructor { + new (): A; + } + interface A { + foo: string; + } + declare var A: AConstructor; + + var obj1: A | string; + if (obj1 instanceof A) { // narrowed to A. + obj1.foo; + obj1.bar; + ~~~ +!!! error TS2339: Property 'bar' does not exist on type 'A'. + } + + var obj2: any; + if (obj2 instanceof A) { // can't narrow type from 'any' + obj2.foo; + obj2.bar; + } + + // a construct signature with generics + interface BConstructor { + new (): B; + } + interface B { + foo: T; + } + declare var B: BConstructor; + + var obj3: B | string; + if (obj3 instanceof B) { // narrowed to B. + obj3.foo = 1; + obj3.foo = "str"; + ~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + obj3.bar = "str"; + ~~~ +!!! error TS2339: Property 'bar' does not exist on type 'B'. + } + + var obj4: any; + if (obj4 instanceof B) { // can't narrow type from 'any' + obj4.foo = "str"; + obj4.foo = 1; + obj4.bar = "str"; + } + + // has multiple construct signature + interface CConstructor { + new (value: string): C1; + new (value: number): C2; + } + interface C1 { + foo: string; + bar1: number; + } + interface C2 { + foo: string; + bar2: number; + } + declare var C: CConstructor; + + var obj5: C1 | A; + if (obj5 instanceof C) { // narrowed to C1. + obj5.foo; + obj5.bar1; + obj5.bar2; + ~~~~ +!!! error TS2339: Property 'bar2' does not exist on type 'C1'. + } + + var obj6: any; + if (obj6 instanceof C) { // can't narrow type from 'any' + obj6.foo; + obj6.bar1; + obj6.bar2; + } + + // with object type literal + interface D { + foo: string; + } + declare var D: { new (): D; }; + + var obj7: D | string; + if (obj7 instanceof D) { // narrowed to D. + obj7.foo; + obj7.bar; + ~~~ +!!! error TS2339: Property 'bar' does not exist on type 'D'. + } + + var obj8: any; + if (obj8 instanceof D) { // can't narrow type from 'any' + obj8.foo; + obj8.bar; + } + + // a construct signature that returns a union type + interface EConstructor { + new (): E1 | E2; + } + interface E1 { + foo: string; + bar1: number; + } + interface E2 { + foo: string; + bar2: number; + } + declare var E: EConstructor; + + var obj9: E1 | A; + if (obj9 instanceof E) { // narrowed to E1. + obj9.foo; + obj9.bar1; + obj9.bar2; + ~~~~ +!!! error TS2339: Property 'bar2' does not exist on type 'E1'. + } + + var obj10: any; + if (obj10 instanceof E) { // can't narrow type from 'any' + obj10.foo; + obj10.bar1; + obj10.bar2; + } + + // a construct signature that returns any + interface FConstructor { + new (): any; + } + interface F { + foo: string; + bar: number; + } + declare var F: FConstructor; + + var obj11: F | string; + if (obj11 instanceof F) { // can't type narrowing, construct signature returns any. + obj11.foo; + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'string | F'. + obj11.bar; + ~~~ +!!! error TS2339: Property 'bar' does not exist on type 'string | F'. + } + + var obj12: any; + if (obj12 instanceof F) { // can't narrow type from 'any' + obj12.foo; + obj12.bar; + } + + // a type with a prototype, it overrides the construct signature + interface GConstructor { + prototype: G1; // high priority + new (): G2; // low priority + } + interface G1 { + foo1: number; + } + interface G2 { + foo2: boolean; + } + declare var G: GConstructor; + + var obj13: G1 | G2; + if (obj13 instanceof G) { // narrowed to G1. G1 is return type of prototype property. + obj13.foo1; + obj13.foo2; + ~~~~ +!!! error TS2339: Property 'foo2' does not exist on type 'G1'. + } + + var obj14: any; + if (obj14 instanceof G) { // can't narrow type from 'any' + obj14.foo1; + obj14.foo2; + } + + // a type with a prototype that has any type + interface HConstructor { + prototype: any; // high priority, but any type is ignored. interface has implicit `prototype: any`. + new (): H; // low priority + } + interface H { + foo: number; + } + declare var H: HConstructor; + + var obj15: H | string; + if (obj15 instanceof H) { // narrowed to H. + obj15.foo; + obj15.bar; + ~~~ +!!! error TS2339: Property 'bar' does not exist on type 'H'. + } + + var obj16: any; + if (obj16 instanceof H) { // can't narrow type from 'any' + obj16.foo1; + obj16.foo2; + } + \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js new file mode 100644 index 00000000000..e5b12bacb1f --- /dev/null +++ b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js @@ -0,0 +1,276 @@ +//// [typeGuardsWithInstanceOfByConstructorSignature.ts] +interface AConstructor { + new (): A; +} +interface A { + foo: string; +} +declare var A: AConstructor; + +var obj1: A | string; +if (obj1 instanceof A) { // narrowed to A. + obj1.foo; + obj1.bar; +} + +var obj2: any; +if (obj2 instanceof A) { // can't narrow type from 'any' + obj2.foo; + obj2.bar; +} + +// a construct signature with generics +interface BConstructor { + new (): B; +} +interface B { + foo: T; +} +declare var B: BConstructor; + +var obj3: B | string; +if (obj3 instanceof B) { // narrowed to B. + obj3.foo = 1; + obj3.foo = "str"; + obj3.bar = "str"; +} + +var obj4: any; +if (obj4 instanceof B) { // can't narrow type from 'any' + obj4.foo = "str"; + obj4.foo = 1; + obj4.bar = "str"; +} + +// has multiple construct signature +interface CConstructor { + new (value: string): C1; + new (value: number): C2; +} +interface C1 { + foo: string; + bar1: number; +} +interface C2 { + foo: string; + bar2: number; +} +declare var C: CConstructor; + +var obj5: C1 | A; +if (obj5 instanceof C) { // narrowed to C1. + obj5.foo; + obj5.bar1; + obj5.bar2; +} + +var obj6: any; +if (obj6 instanceof C) { // can't narrow type from 'any' + obj6.foo; + obj6.bar1; + obj6.bar2; +} + +// with object type literal +interface D { + foo: string; +} +declare var D: { new (): D; }; + +var obj7: D | string; +if (obj7 instanceof D) { // narrowed to D. + obj7.foo; + obj7.bar; +} + +var obj8: any; +if (obj8 instanceof D) { // can't narrow type from 'any' + obj8.foo; + obj8.bar; +} + +// a construct signature that returns a union type +interface EConstructor { + new (): E1 | E2; +} +interface E1 { + foo: string; + bar1: number; +} +interface E2 { + foo: string; + bar2: number; +} +declare var E: EConstructor; + +var obj9: E1 | A; +if (obj9 instanceof E) { // narrowed to E1. + obj9.foo; + obj9.bar1; + obj9.bar2; +} + +var obj10: any; +if (obj10 instanceof E) { // can't narrow type from 'any' + obj10.foo; + obj10.bar1; + obj10.bar2; +} + +// a construct signature that returns any +interface FConstructor { + new (): any; +} +interface F { + foo: string; + bar: number; +} +declare var F: FConstructor; + +var obj11: F | string; +if (obj11 instanceof F) { // can't type narrowing, construct signature returns any. + obj11.foo; + obj11.bar; +} + +var obj12: any; +if (obj12 instanceof F) { // can't narrow type from 'any' + obj12.foo; + obj12.bar; +} + +// a type with a prototype, it overrides the construct signature +interface GConstructor { + prototype: G1; // high priority + new (): G2; // low priority +} +interface G1 { + foo1: number; +} +interface G2 { + foo2: boolean; +} +declare var G: GConstructor; + +var obj13: G1 | G2; +if (obj13 instanceof G) { // narrowed to G1. G1 is return type of prototype property. + obj13.foo1; + obj13.foo2; +} + +var obj14: any; +if (obj14 instanceof G) { // can't narrow type from 'any' + obj14.foo1; + obj14.foo2; +} + +// a type with a prototype that has any type +interface HConstructor { + prototype: any; // high priority, but any type is ignored. interface has implicit `prototype: any`. + new (): H; // low priority +} +interface H { + foo: number; +} +declare var H: HConstructor; + +var obj15: H | string; +if (obj15 instanceof H) { // narrowed to H. + obj15.foo; + obj15.bar; +} + +var obj16: any; +if (obj16 instanceof H) { // can't narrow type from 'any' + obj16.foo1; + obj16.foo2; +} + + +//// [typeGuardsWithInstanceOfByConstructorSignature.js] +var obj1; +if (obj1 instanceof A) { + obj1.foo; + obj1.bar; +} +var obj2; +if (obj2 instanceof A) { + obj2.foo; + obj2.bar; +} +var obj3; +if (obj3 instanceof B) { + obj3.foo = 1; + obj3.foo = "str"; + obj3.bar = "str"; +} +var obj4; +if (obj4 instanceof B) { + obj4.foo = "str"; + obj4.foo = 1; + obj4.bar = "str"; +} +var obj5; +if (obj5 instanceof C) { + obj5.foo; + obj5.bar1; + obj5.bar2; +} +var obj6; +if (obj6 instanceof C) { + obj6.foo; + obj6.bar1; + obj6.bar2; +} +var obj7; +if (obj7 instanceof D) { + obj7.foo; + obj7.bar; +} +var obj8; +if (obj8 instanceof D) { + obj8.foo; + obj8.bar; +} +var obj9; +if (obj9 instanceof E) { + obj9.foo; + obj9.bar1; + obj9.bar2; +} +var obj10; +if (obj10 instanceof E) { + obj10.foo; + obj10.bar1; + obj10.bar2; +} +var obj11; +if (obj11 instanceof F) { + obj11.foo; + obj11.bar; +} +var obj12; +if (obj12 instanceof F) { + obj12.foo; + obj12.bar; +} +var obj13; +if (obj13 instanceof G) { + obj13.foo1; + obj13.foo2; +} +var obj14; +if (obj14 instanceof G) { + obj14.foo1; + obj14.foo2; +} +var obj15; +if (obj15 instanceof H) { + obj15.foo; + obj15.bar; +} +var obj16; +if (obj16 instanceof H) { + obj16.foo1; + obj16.foo2; +} diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 1fd624e4e5b..6f05bf684f1 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -45,7 +45,7 @@ function f4() { //// [typeMatch2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index 206b44ea349..5df29d615e4 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -9,7 +9,7 @@ class D extends C { } //// [typeOfSuperCall.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index 8814b3a8531..b00a00abac5 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -3,7 +3,7 @@ class C extends T {} class C2 implements T {} //// [typeParameterAsBaseClass.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index c7b15484cba..2715c09fa23 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -13,7 +13,7 @@ interface I2 extends U { } //// [typeParameterAsBaseType.js] // type parameters cannot be used as base types // these are all errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index 2cfbe7b07b6..c5e8fccf350 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -13,7 +13,7 @@ function f(a: T) { } //// [typeParameterExtendingUnion1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index c5e462bb96c..e53aeb42f22 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -13,7 +13,7 @@ function f(a: T) { } //// [typeParameterExtendingUnion2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeResolution.js.map b/tests/baselines/reference/typeResolution.js.map index cdf29b6e8ab..8bbff8aa760 100644 --- a/tests/baselines/reference/typeResolution.js.map +++ b/tests/baselines/reference/typeResolution.js.map @@ -1,2 +1,2 @@ //// [typeResolution.js.map] -{"version":3,"file":"typeResolution.js","sourceRoot":"","sources":["typeResolution.ts"],"names":["TopLevelModule1","TopLevelModule1.SubModule1","TopLevelModule1.SubModule1.SubSubModule1","TopLevelModule1.SubModule1.SubSubModule1.ClassA","TopLevelModule1.SubModule1.SubSubModule1.ClassA.constructor","TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1","TopLevelModule1.SubModule1.SubSubModule1.ClassB","TopLevelModule1.SubModule1.SubSubModule1.ClassB.constructor","TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1","TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ","TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor","TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ","TopLevelModule1.SubModule1.ClassA","TopLevelModule1.SubModule1.ClassA.constructor","TopLevelModule1.SubModule1.ClassA.constructor.AA","TopLevelModule1.SubModule2","TopLevelModule1.SubModule2.SubSubModule2","TopLevelModule1.SubModule2.SubSubModule2.ClassA","TopLevelModule1.SubModule2.SubSubModule2.ClassA.constructor","TopLevelModule1.SubModule2.SubSubModule2.ClassA.AisIn1_2_2","TopLevelModule1.SubModule2.SubSubModule2.ClassB","TopLevelModule1.SubModule2.SubSubModule2.ClassB.constructor","TopLevelModule1.SubModule2.SubSubModule2.ClassB.BisIn1_2_2","TopLevelModule1.SubModule2.SubSubModule2.ClassC","TopLevelModule1.SubModule2.SubSubModule2.ClassC.constructor","TopLevelModule1.SubModule2.SubSubModule2.ClassC.CisIn1_2_2","TopLevelModule1.ClassA","TopLevelModule1.ClassA.constructor","TopLevelModule1.ClassA.AisIn1","TopLevelModule1.NotExportedModule","TopLevelModule1.NotExportedModule.ClassA","TopLevelModule1.NotExportedModule.ClassA.constructor","TopLevelModule2","TopLevelModule2.SubModule3","TopLevelModule2.SubModule3.ClassA","TopLevelModule2.SubModule3.ClassA.constructor","TopLevelModule2.SubModule3.ClassA.AisIn2_3"],"mappings":";IAAA,IAAc,eAAe,CAmG5B;IAnGD,WAAc,eAAe,EAAC,CAAC;QAC3BA,IAAcA,UAAUA,CAwEvBA;QAxEDA,WAAcA,UAAUA,EAACA,CAACA;YACtBC,IAAcA,aAAaA,CAwD1BA;YAxDDA,WAAcA,aAAaA,EAACA,CAACA;gBACzBC;oBAAAC;oBAmBAC,CAACA;oBAlBUD,2BAAUA,GAAjBA;wBACIE,uCAAuCA;wBACvCA,IAAIA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAwBA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAC9CA,IAAIA,EAAmCA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzDA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAEzEA,yCAAyCA;wBACzCA,IAAIA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAEzEA,qCAAqCA;wBACrCA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAEzEA,sBAAsBA;wBACtBA,IAAIA,EAAcA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACpCA,IAAIA,EAA4BA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;oBACtDA,CAACA;oBACLF,aAACA;gBAADA,CAACA,AAnBDD,IAmBCA;gBAnBYA,oBAAMA,SAmBlBA,CAAAA;gBACDA;oBAAAI;oBAsBAC,CAACA;oBArBUD,2BAAUA,GAAjBA;wBACIE,+CAA+CA;wBAE/CA,uCAAuCA;wBACvCA,IAAIA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAwBA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAC9CA,IAAIA,EAAmCA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzDA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAEzEA,yCAAyCA;wBACzCA,IAAIA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAEzEA,qCAAqCA;wBACrCA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzEA,IAAIA,EAAqCA,CAACA;wBAACA,EAAEA,CAACA,QAAQA,EAAEA,CAACA;wBAEzDA,sBAAsBA;wBACtBA,IAAIA,EAAcA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACpCA,IAAIA,EAA4BA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;oBACtDA,CAACA;oBACLF,aAACA;gBAADA,CAACA,AAtBDJ,IAsBCA;gBAtBYA,oBAAMA,SAsBlBA,CAAAA;gBAEDA;oBACIO;wBACIC;4BACIC,uCAAuCA;4BACvCA,IAAIA,EAAmDA,CAACA;4BAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;4BACzEA,IAAIA,EAAmDA,CAACA;4BAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;4BACzEA,IAAIA,EAAcA,CAACA;4BAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;4BACpCA,IAAIA,EAAqCA,CAACA;4BAACA,EAAEA,CAACA,QAAQA,EAAEA,CAACA;wBAC7DA,CAACA;oBACLD,CAACA;oBACLD,wBAACA;gBAADA,CAACA,AAVDP,IAUCA;YACLA,CAACA,EAxDaD,aAAaA,GAAbA,wBAAaA,KAAbA,wBAAaA,QAwD1BA;YAEDA,0EAA0EA;YAC1EA;gBACIW;oBACIC;wBACIC,IAAIA,EAAwBA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAC9CA,IAAIA,EAAmCA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzDA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAEzEA,sBAAsBA;wBACtBA,IAAIA,EAA4BA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;oBACtDA,CAACA;gBACLD,CAACA;gBACLD,aAACA;YAADA,CAACA,AAXDX,IAWCA;QACLA,CAACA,EAxEaD,UAAUA,GAAVA,0BAAUA,KAAVA,0BAAUA,QAwEvBA;QAEDA,IAAcA,UAAUA,CAWvBA;QAXDA,WAAcA,UAAUA,EAACA,CAACA;YACtBe,IAAcA,aAAaA,CAO1BA;YAPDA,WAAcA,aAAaA,EAACA,CAACA;gBACzBC,6DAA6DA;gBAC7DA;oBAAAC;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA,cAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CD,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAC/CA;oBAAAI;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA,cAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CJ,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAC/CA;oBAAAO;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA,cAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CP,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAEZA,JACvCA,CAACA,EAPaD,aAAaA,GAAbA,wBAAaA,KAAbA,wBAAaA,QAO1BA;YAE0CA,JAC/CA,CAACA,EAXaf,UAAUA,GAAVA,0BAAUA,KAAVA,0BAAUA,QAWvBA;QAEDA;YAAA0B;YAEAC,CAACA;YADUD,uBAAMA,GAAbA,cAAkBE,CAACA;YACvBF,aAACA;QAADA,CAACA,AAFD1B,IAECA;QAMDA,IAAOA,iBAAiBA,CAEvBA;QAFDA,WAAOA,iBAAiBA,EAACA,CAACA;YACtB6B;gBAAAC;gBAAsBC,CAACA;gBAADD,aAACA;YAADA,CAACA,AAAvBD,IAAuBA;YAAVA,wBAAMA,SAAIA,CAAAA;QAC3BA,CAACA,EAFM7B,iBAAiBA,KAAjBA,iBAAiBA,QAEvBA;IACLA,CAACA,EAnGa,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAmG5B;IAED,IAAO,eAAe,CAMrB;IAND,WAAO,eAAe,EAAC,CAAC;QACpBgC,IAAcA,UAAUA,CAIvBA;QAJDA,WAAcA,UAAUA,EAACA,CAACA;YACtBC;gBAAAC;gBAEAC,CAACA;gBADUD,yBAAQA,GAAfA,cAAoBE,CAACA;gBACzBF,aAACA;YAADA,CAACA,AAFDD,IAECA;YAFYA,iBAAMA,SAElBA,CAAAA;QACLA,CAACA,EAJaD,UAAUA,GAAVA,0BAAUA,KAAVA,0BAAUA,QAIvBA;IACLA,CAACA,EANM,eAAe,KAAf,eAAe,QAMrB"} \ No newline at end of file +{"version":3,"file":"typeResolution.js","sourceRoot":"","sources":["typeResolution.ts"],"names":["TopLevelModule1","TopLevelModule1.SubModule1","TopLevelModule1.SubModule1.SubSubModule1","TopLevelModule1.SubModule1.SubSubModule1.ClassA","TopLevelModule1.SubModule1.SubSubModule1.ClassA.constructor","TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1","TopLevelModule1.SubModule1.SubSubModule1.ClassB","TopLevelModule1.SubModule1.SubSubModule1.ClassB.constructor","TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1","TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ","TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor","TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ","TopLevelModule1.SubModule1.ClassA","TopLevelModule1.SubModule1.ClassA.constructor","TopLevelModule1.SubModule1.ClassA.constructor.AA","TopLevelModule1.SubModule2","TopLevelModule1.SubModule2.SubSubModule2","TopLevelModule1.SubModule2.SubSubModule2.ClassA","TopLevelModule1.SubModule2.SubSubModule2.ClassA.constructor","TopLevelModule1.SubModule2.SubSubModule2.ClassA.AisIn1_2_2","TopLevelModule1.SubModule2.SubSubModule2.ClassB","TopLevelModule1.SubModule2.SubSubModule2.ClassB.constructor","TopLevelModule1.SubModule2.SubSubModule2.ClassB.BisIn1_2_2","TopLevelModule1.SubModule2.SubSubModule2.ClassC","TopLevelModule1.SubModule2.SubSubModule2.ClassC.constructor","TopLevelModule1.SubModule2.SubSubModule2.ClassC.CisIn1_2_2","TopLevelModule1.ClassA","TopLevelModule1.ClassA.constructor","TopLevelModule1.ClassA.AisIn1","TopLevelModule1.NotExportedModule","TopLevelModule1.NotExportedModule.ClassA","TopLevelModule1.NotExportedModule.ClassA.constructor","TopLevelModule2","TopLevelModule2.SubModule3","TopLevelModule2.SubModule3.ClassA","TopLevelModule2.SubModule3.ClassA.constructor","TopLevelModule2.SubModule3.ClassA.AisIn2_3"],"mappings":";IAAA,IAAc,eAAe,CAmG5B;IAnGD,WAAc,eAAe,EAAC,CAAC;QAC3BA,IAAcA,UAAUA,CAwEvBA;QAxEDA,WAAcA,UAAUA,EAACA,CAACA;YACtBC,IAAcA,aAAaA,CAwD1BA;YAxDDA,WAAcA,aAAaA,EAACA,CAACA;gBACzBC;oBAAAC;oBAmBAC,CAACA;oBAlBUD,2BAAUA,GAAjBA;wBAEIE,AADAA,uCAAuCA;4BACnCA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAwBA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAC9CA,IAAIA,EAAmCA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzDA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAGzEA,AADAA,yCAAyCA;4BACrCA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAGzEA,AADAA,qCAAqCA;4BACjCA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAGzEA,AADAA,sBAAsBA;4BAClBA,EAAcA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACpCA,IAAIA,EAA4BA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;oBACtDA,CAACA;oBACLF,aAACA;gBAADA,CAACA,AAnBDD,IAmBCA;gBAnBYA,oBAAMA,SAmBlBA,CAAAA;gBACDA;oBAAAI;oBAsBAC,CAACA;oBArBUD,2BAAUA,GAAjBA;wBACIE,+CAA+CA;wBAG/CA,AADAA,uCAAuCA;4BACnCA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAwBA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAC9CA,IAAIA,EAAmCA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzDA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAGzEA,AADAA,yCAAyCA;4BACrCA,EAAUA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAChCA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAGzEA,AADAA,qCAAqCA;4BACjCA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzEA,IAAIA,EAAqCA,CAACA;wBAACA,EAAEA,CAACA,QAAQA,EAAEA,CAACA;wBAGzDA,AADAA,sBAAsBA;4BAClBA,EAAcA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACpCA,IAAIA,EAA4BA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;oBACtDA,CAACA;oBACLF,aAACA;gBAADA,CAACA,AAtBDJ,IAsBCA;gBAtBYA,oBAAMA,SAsBlBA,CAAAA;gBAEDA;oBACIO;wBACIC;4BAEIC,AADAA,uCAAuCA;gCACnCA,EAAmDA,CAACA;4BAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;4BACzEA,IAAIA,EAAmDA,CAACA;4BAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;4BACzEA,IAAIA,EAAcA,CAACA;4BAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;4BACpCA,IAAIA,EAAqCA,CAACA;4BAACA,EAAEA,CAACA,QAAQA,EAAEA,CAACA;wBAC7DA,CAACA;oBACLD,CAACA;oBACLD,wBAACA;gBAADA,CAACA,AAVDP,IAUCA;YACLA,CAACA,EAxDaD,aAAaA,GAAbA,wBAAaA,KAAbA,wBAAaA,QAwD1BA;YAGDA,AADAA,0EAA0EA;;gBAEtEW;oBACIC;wBACIC,IAAIA,EAAwBA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAC9CA,IAAIA,EAAmCA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBACzDA,IAAIA,EAAmDA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;wBAGzEA,AADAA,sBAAsBA;4BAClBA,EAA4BA,CAACA;wBAACA,EAAEA,CAACA,UAAUA,EAAEA,CAACA;oBACtDA,CAACA;gBACLD,CAACA;gBACLD,aAACA;YAADA,CAACA,AAXDX,IAWCA;QACLA,CAACA,EAxEaD,UAAUA,GAAVA,0BAAUA,KAAVA,0BAAUA,QAwEvBA;QAEDA,IAAcA,UAAUA,CAWvBA;QAXDA,WAAcA,UAAUA,EAACA,CAACA;YACtBe,IAAcA,aAAaA,CAO1BA;YAPDA,WAAcA,aAAaA,EAACA,CAACA;gBAEzBC,AADAA,6DAA6DA;;oBAC7DC;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA,cAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CD,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAC/CA;oBAAAI;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA,cAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CJ,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAC/CA;oBAAAO;oBAA8CC,CAACA;oBAAlBD,2BAAUA,GAAjBA,cAAsBE,CAACA;oBAACF,aAACA;gBAADA,CAACA,AAA/CP,IAA+CA;gBAAlCA,oBAAMA,SAA4BA,CAAAA;gBAEZA,JACvCA,CAACA,EAPaD,aAAaA,GAAbA,wBAAaA,KAAbA,wBAAaA,QAO1BA;YAE0CA,JAC/CA,CAACA,EAXaf,UAAUA,GAAVA,0BAAUA,KAAVA,0BAAUA,QAWvBA;QAEDA;YAAA0B;YAEAC,CAACA;YADUD,uBAAMA,GAAbA,cAAkBE,CAACA;YACvBF,aAACA;QAADA,CAACA,AAFD1B,IAECA;QAMDA,IAAOA,iBAAiBA,CAEvBA;QAFDA,WAAOA,iBAAiBA,EAACA,CAACA;YACtB6B;gBAAAC;gBAAsBC,CAACA;gBAADD,aAACA;YAADA,CAACA,AAAvBD,IAAuBA;YAAVA,wBAAMA,SAAIA,CAAAA;QAC3BA,CAACA,EAFM7B,iBAAiBA,KAAjBA,iBAAiBA,QAEvBA;IACLA,CAACA,EAnGa,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAmG5B;IAED,IAAO,eAAe,CAMrB;IAND,WAAO,eAAe,EAAC,CAAC;QACpBgC,IAAcA,UAAUA,CAIvBA;QAJDA,WAAcA,UAAUA,EAACA,CAACA;YACtBC;gBAAAC;gBAEAC,CAACA;gBADUD,yBAAQA,GAAfA,cAAoBE,CAACA;gBACzBF,aAACA;YAADA,CAACA,AAFDD,IAECA;YAFYA,iBAAMA,SAElBA,CAAAA;QACLA,CAACA,EAJaD,UAAUA,GAAVA,0BAAUA,KAAVA,0BAAUA,QAIvBA;IACLA,CAACA,EANM,eAAe,KAAf,eAAe,QAMrB"} \ No newline at end of file diff --git a/tests/baselines/reference/typeResolution.sourcemap.txt b/tests/baselines/reference/typeResolution.sourcemap.txt index be8d2212ea4..a7d8bd170f1 100644 --- a/tests/baselines/reference/typeResolution.sourcemap.txt +++ b/tests/baselines/reference/typeResolution.sourcemap.txt @@ -390,28 +390,29 @@ sourceFile:typeResolution.ts --- >>> // Try all qualified names of this type 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->public AisIn1_1_1() { + > // Try all qualified names of this type > -2 > // Try all qualified names of this type -1->Emitted(12, 25) Source(6, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(12, 64) Source(6, 60) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 > +3 > // Try all qualified names of this type +1->Emitted(12, 25) Source(7, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(12, 25) Source(6, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(12, 64) Source(6, 60) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> var a1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > a1: ClassA -4 > ; -1 >Emitted(13, 25) Source(7, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(13, 29) Source(7, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -3 >Emitted(13, 31) Source(7, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -4 >Emitted(13, 32) Source(7, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) + > var +2 > a1: ClassA +3 > ; +1 >Emitted(13, 29) Source(7, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(13, 31) Source(7, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(13, 32) Source(7, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> a1.AisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -544,29 +545,30 @@ sourceFile:typeResolution.ts --- >>> // Two variants of qualifying a peer type 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Two variants of qualifying a peer type > -2 > // Two variants of qualifying a peer type -1->Emitted(21, 25) Source(12, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(21, 66) Source(12, 62) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 > +3 > // Two variants of qualifying a peer type +1->Emitted(21, 25) Source(13, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(21, 25) Source(12, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(21, 66) Source(12, 62) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> var b1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > b1: ClassB -4 > ; -1 >Emitted(22, 25) Source(13, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(22, 29) Source(13, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -3 >Emitted(22, 31) Source(13, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -4 >Emitted(22, 32) Source(13, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) + > var +2 > b1: ClassB +3 > ; +1 >Emitted(22, 29) Source(13, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(22, 31) Source(13, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(22, 32) Source(13, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> b1.BisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -627,29 +629,30 @@ sourceFile:typeResolution.ts --- >>> // Type only accessible from the root 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Type only accessible from the root > -2 > // Type only accessible from the root -1->Emitted(26, 25) Source(16, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(26, 62) Source(16, 58) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 > +3 > // Type only accessible from the root +1->Emitted(26, 25) Source(17, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(26, 25) Source(16, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(26, 62) Source(16, 58) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> var c1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA -4 > ; -1 >Emitted(27, 25) Source(17, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(27, 29) Source(17, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -3 >Emitted(27, 31) Source(17, 76) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -4 >Emitted(27, 32) Source(17, 77) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) + > var +2 > c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA +3 > ; +1 >Emitted(27, 29) Source(17, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(27, 31) Source(17, 76) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(27, 32) Source(17, 77) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> c1.AisIn1_2_2(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -674,29 +677,30 @@ sourceFile:typeResolution.ts --- >>> // Interface reference 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Interface reference > -2 > // Interface reference -1->Emitted(29, 25) Source(19, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(29, 47) Source(19, 43) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 > +3 > // Interface reference +1->Emitted(29, 25) Source(20, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(29, 25) Source(19, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(29, 47) Source(19, 43) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> var d1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > d1: InterfaceX -4 > ; -1 >Emitted(30, 25) Source(20, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -2 >Emitted(30, 29) Source(20, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -3 >Emitted(30, 31) Source(20, 39) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) -4 >Emitted(30, 32) Source(20, 40) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) + > var +2 > d1: InterfaceX +3 > ; +1 >Emitted(30, 29) Source(20, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +2 >Emitted(30, 31) Source(20, 39) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) +3 >Emitted(30, 32) Source(20, 40) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassA.AisIn1_1_1) --- >>> d1.XisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -907,29 +911,30 @@ sourceFile:typeResolution.ts --- >>> // Try all qualified names of this type 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 > > + > // Try all qualified names of this type > -2 > // Try all qualified names of this type -1 >Emitted(43, 25) Source(28, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(43, 64) Source(28, 60) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 > +3 > // Try all qualified names of this type +1 >Emitted(43, 25) Source(29, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(43, 25) Source(28, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(43, 64) Source(28, 60) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> var a1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > a1: ClassA -4 > ; -1 >Emitted(44, 25) Source(29, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(44, 29) Source(29, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -3 >Emitted(44, 31) Source(29, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -4 >Emitted(44, 32) Source(29, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) + > var +2 > a1: ClassA +3 > ; +1 >Emitted(44, 29) Source(29, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(44, 31) Source(29, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(44, 32) Source(29, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> a1.AisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1062,29 +1067,30 @@ sourceFile:typeResolution.ts --- >>> // Two variants of qualifying a peer type 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Two variants of qualifying a peer type > -2 > // Two variants of qualifying a peer type -1->Emitted(52, 25) Source(34, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(52, 66) Source(34, 62) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 > +3 > // Two variants of qualifying a peer type +1->Emitted(52, 25) Source(35, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(52, 25) Source(34, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(52, 66) Source(34, 62) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> var b1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > b1: ClassB -4 > ; -1 >Emitted(53, 25) Source(35, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(53, 29) Source(35, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -3 >Emitted(53, 31) Source(35, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -4 >Emitted(53, 32) Source(35, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) + > var +2 > b1: ClassB +3 > ; +1 >Emitted(53, 29) Source(35, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(53, 31) Source(35, 35) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(53, 32) Source(35, 36) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> b1.BisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1145,29 +1151,30 @@ sourceFile:typeResolution.ts --- >>> // Type only accessible from the root 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Type only accessible from the root > -2 > // Type only accessible from the root -1->Emitted(57, 25) Source(38, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(57, 62) Source(38, 58) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 > +3 > // Type only accessible from the root +1->Emitted(57, 25) Source(39, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(57, 25) Source(38, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(57, 62) Source(38, 58) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> var c1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA -4 > ; -1 >Emitted(58, 25) Source(39, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(58, 29) Source(39, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -3 >Emitted(58, 31) Source(39, 76) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -4 >Emitted(58, 32) Source(39, 77) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) + > var +2 > c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA +3 > ; +1 >Emitted(58, 29) Source(39, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(58, 31) Source(39, 76) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(58, 32) Source(39, 77) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> c1.AisIn1_2_2(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1228,29 +1235,30 @@ sourceFile:typeResolution.ts --- >>> // Interface reference 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Interface reference > -2 > // Interface reference -1->Emitted(62, 25) Source(42, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(62, 47) Source(42, 43) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 > +3 > // Interface reference +1->Emitted(62, 25) Source(43, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(62, 25) Source(42, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(62, 47) Source(42, 43) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> var d1; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > d1: InterfaceX -4 > ; -1 >Emitted(63, 25) Source(43, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -2 >Emitted(63, 29) Source(43, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -3 >Emitted(63, 31) Source(43, 39) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) -4 >Emitted(63, 32) Source(43, 40) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) + > var +2 > d1: InterfaceX +3 > ; +1 >Emitted(63, 29) Source(43, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +2 >Emitted(63, 31) Source(43, 39) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) +3 >Emitted(63, 32) Source(43, 40) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.ClassB.BisIn1_1_1) --- >>> d1.XisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1425,28 +1433,29 @@ sourceFile:typeResolution.ts --- >>> /* Sampling of stuff from AisIn1_1_1 */ 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->function QQ() { + > /* Sampling of stuff from AisIn1_1_1 */ > -2 > /* Sampling of stuff from AisIn1_1_1 */ -1->Emitted(74, 29) Source(51, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) -2 >Emitted(74, 68) Source(51, 64) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) +2 > +3 > /* Sampling of stuff from AisIn1_1_1 */ +1->Emitted(74, 29) Source(52, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) +2 >Emitted(74, 29) Source(51, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) +3 >Emitted(74, 68) Source(51, 64) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) --- >>> var a4; -1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA -4 > ; -1 >Emitted(75, 29) Source(52, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) -2 >Emitted(75, 33) Source(52, 29) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) -3 >Emitted(75, 35) Source(52, 80) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) -4 >Emitted(75, 36) Source(52, 81) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) + > var +2 > a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA +3 > ; +1 >Emitted(75, 33) Source(52, 29) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) +2 >Emitted(75, 35) Source(52, 80) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) +3 >Emitted(75, 36) Source(52, 81) + SourceIndex(0) name (TopLevelModule1.SubModule1.SubSubModule1.NonExportedClassQ.constructor.QQ) --- >>> a4.AisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1717,27 +1726,26 @@ sourceFile:typeResolution.ts --- >>> // Should have no effect on S1.SS1.ClassA above because it is not exported 1 >^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 > > + > // Should have no effect on S1.SS1.ClassA above because it is not exported > -2 > // Should have no effect on S1.SS1.ClassA above because it is not exported -1 >Emitted(88, 13) Source(61, 9) + SourceIndex(0) name (TopLevelModule1.SubModule1) -2 >Emitted(88, 87) Source(61, 83) + SourceIndex(0) name (TopLevelModule1.SubModule1) +2 > +3 > // Should have no effect on S1.SS1.ClassA above because it is not exported +1 >Emitted(88, 13) Source(62, 9) + SourceIndex(0) name (TopLevelModule1.SubModule1) +2 >Emitted(88, 13) Source(61, 9) + SourceIndex(0) name (TopLevelModule1.SubModule1) +3 >Emitted(88, 87) Source(61, 83) + SourceIndex(0) name (TopLevelModule1.SubModule1) --- >>> var ClassA = (function () { -1 >^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(89, 13) Source(62, 9) + SourceIndex(0) name (TopLevelModule1.SubModule1) ---- >>> function ClassA() { -1->^^^^^^^^^^^^^^^^ +1 >^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^-> -1->class ClassA { +1 > + > class ClassA { > -1->Emitted(90, 17) Source(63, 13) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA) +1 >Emitted(90, 17) Source(63, 13) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA) --- >>> function AA() { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1857,29 +1865,30 @@ sourceFile:typeResolution.ts --- >>> // Interface reference 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^ 1-> > + > // Interface reference > -2 > // Interface reference -1->Emitted(98, 25) Source(69, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) -2 >Emitted(98, 47) Source(69, 43) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) +2 > +3 > // Interface reference +1->Emitted(98, 25) Source(70, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) +2 >Emitted(98, 25) Source(69, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) +3 >Emitted(98, 47) Source(69, 43) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) --- >>> var d2; -1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^ -3 > ^^ -4 > ^ -5 > ^^^^^^^^^^-> +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^^^^-> 1 > - > -2 > var -3 > d2: SubSubModule1.InterfaceX -4 > ; -1 >Emitted(99, 25) Source(70, 21) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) -2 >Emitted(99, 29) Source(70, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) -3 >Emitted(99, 31) Source(70, 53) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) -4 >Emitted(99, 32) Source(70, 54) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) + > var +2 > d2: SubSubModule1.InterfaceX +3 > ; +1 >Emitted(99, 29) Source(70, 25) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) +2 >Emitted(99, 31) Source(70, 53) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) +3 >Emitted(99, 32) Source(70, 54) + SourceIndex(0) name (TopLevelModule1.SubModule1.ClassA.constructor.AA) --- >>> d2.XisIn1_1_1(); 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2145,25 +2154,24 @@ sourceFile:typeResolution.ts --- >>> // No code here since these are the mirror of the above calls 1->^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> + > // No code here since these are the mirror of the above calls > -2 > // No code here since these are the mirror of the above calls -1->Emitted(110, 17) Source(78, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) -2 >Emitted(110, 78) Source(78, 74) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +2 > +3 > // No code here since these are the mirror of the above calls +1->Emitted(110, 17) Source(79, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +2 >Emitted(110, 17) Source(78, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) +3 >Emitted(110, 78) Source(78, 74) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) --- >>> var ClassA = (function () { -1 >^^^^^^^^^^^^^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +>>> function ClassA() { +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^^-> 1 > > -1 >Emitted(111, 17) Source(79, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2) ---- ->>> function ClassA() { -1->^^^^^^^^^^^^^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(112, 21) Source(79, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) +1 >Emitted(112, 21) Source(79, 13) + SourceIndex(0) name (TopLevelModule1.SubModule2.SubSubModule2.ClassA) --- >>> } 1->^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index 8f39b913f82..d036d90262f 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -12,7 +12,7 @@ module M2 { //// [typeValueConflict1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typeValueConflict2.js b/tests/baselines/reference/typeValueConflict2.js index 52d3d906cfd..c927e70615a 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -19,7 +19,7 @@ module M3 { //// [typeValueConflict2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typedArrays.symbols b/tests/baselines/reference/typedArrays.symbols index c0ddc7183f0..27b72cc54f1 100644 --- a/tests/baselines/reference/typedArrays.symbols +++ b/tests/baselines/reference/typedArrays.symbols @@ -8,39 +8,39 @@ function CreateTypedArrayTypes() { typedArrays[0] = Int8Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) typedArrays[1] = Uint8Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) typedArrays[2] = Int16Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) typedArrays[3] = Uint16Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) typedArrays[4] = Int32Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) typedArrays[5] = Uint32Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) typedArrays[6] = Float32Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) typedArrays[7] = Float64Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) typedArrays[8] = Uint8ClampedArray; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) return typedArrays; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 2, 7)) @@ -55,47 +55,47 @@ function CreateTypedArrayInstancesFromLength(obj: number) { typedArrays[0] = new Int8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[1] = new Uint8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[2] = new Int16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[3] = new Uint16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[4] = new Int32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[5] = new Uint32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[6] = new Float32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[7] = new Float64Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) typedArrays[8] = new Uint8ClampedArray(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 17, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 16, 45)) return typedArrays; @@ -111,47 +111,47 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { typedArrays[0] = new Int8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[1] = new Uint8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[2] = new Int16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[3] = new Uint16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[4] = new Int32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[5] = new Uint32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[6] = new Float32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[7] = new Float64Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) typedArrays[8] = new Uint8ClampedArray(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 32, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) >obj : Symbol(obj, Decl(typedArrays.ts, 31, 44)) return typedArrays; @@ -167,65 +167,65 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { typedArrays[0] = Int8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[1] = Uint8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[2] = Int16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[3] = Uint16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[4] = Int32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[5] = Uint32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[6] = Float32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[7] = Float64Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) typedArrays[8] = Uint8ClampedArray.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 47, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) >obj : Symbol(obj, Decl(typedArrays.ts, 46, 44)) return typedArrays; @@ -235,72 +235,72 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >CreateIntegerTypedArraysFromArrayLike : Symbol(CreateIntegerTypedArraysFromArrayLike, Decl(typedArrays.ts, 59, 1)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) ->ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, 1404, 1)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, 1434, 1)) var typedArrays = []; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) typedArrays[0] = Int8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[1] = Uint8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[2] = Int16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[3] = Uint16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[4] = Int32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[5] = Uint32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[6] = Float32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[7] = Float64Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) typedArrays[8] = Uint8ClampedArray.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 62, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) >obj : Symbol(obj, Decl(typedArrays.ts, 61, 47)) return typedArrays; @@ -332,57 +332,57 @@ function CreateTypedArraysOf2() { typedArrays[0] = Int8Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, 2351, 30)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) ->of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, 2351, 30)) +>Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, 2381, 30)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) +>of : Symbol(Int8ArrayConstructor.of, Decl(lib.d.ts, 2381, 30)) typedArrays[1] = Uint8Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, 2641, 30)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) ->of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, 2641, 30)) +>Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, 2671, 30)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) +>of : Symbol(Uint8ArrayConstructor.of, Decl(lib.d.ts, 2671, 30)) typedArrays[2] = Int16Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, 3221, 30)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) ->of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, 3221, 30)) +>Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, 3251, 30)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) +>of : Symbol(Int16ArrayConstructor.of, Decl(lib.d.ts, 3251, 30)) typedArrays[3] = Uint16Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, 3511, 30)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) ->of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, 3511, 30)) +>Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, 3541, 30)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) +>of : Symbol(Uint16ArrayConstructor.of, Decl(lib.d.ts, 3541, 30)) typedArrays[4] = Int32Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, 3801, 30)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) ->of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, 3801, 30)) +>Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, 3831, 30)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) +>of : Symbol(Int32ArrayConstructor.of, Decl(lib.d.ts, 3831, 30)) typedArrays[5] = Uint32Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, 4091, 30)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) ->of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, 4091, 30)) +>Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, 4121, 30)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) +>of : Symbol(Uint32ArrayConstructor.of, Decl(lib.d.ts, 4121, 30)) typedArrays[6] = Float32Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, 4381, 30)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) ->of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, 4381, 30)) +>Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, 4411, 30)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) +>of : Symbol(Float32ArrayConstructor.of, Decl(lib.d.ts, 4411, 30)) typedArrays[7] = Float64Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, 4671, 30)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) ->of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, 4671, 30)) +>Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, 4701, 30)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) +>of : Symbol(Float64ArrayConstructor.of, Decl(lib.d.ts, 4701, 30)) typedArrays[8] = Uint8ClampedArray.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) ->Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, 2931, 30)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) ->of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, 2931, 30)) +>Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, 2961, 30)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) +>of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.d.ts, 2961, 30)) return typedArrays; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 94, 7)) @@ -391,7 +391,7 @@ function CreateTypedArraysOf2() { function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:number)=> number) { >CreateTypedArraysFromMapFn : Symbol(CreateTypedArraysFromMapFn, Decl(typedArrays.ts, 106, 1)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) ->ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, 1404, 1)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, 1434, 1)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) >n : Symbol(n, Decl(typedArrays.ts, 108, 67)) >v : Symbol(v, Decl(typedArrays.ts, 108, 76)) @@ -401,73 +401,73 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n typedArrays[0] = Int8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[1] = Uint8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[2] = Int16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[3] = Uint16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[4] = Int32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[5] = Uint32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[6] = Float32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[7] = Float64Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 109, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) >obj : Symbol(obj, Decl(typedArrays.ts, 108, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 108, 58)) @@ -478,7 +478,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v:number)=> number, thisArg: {}) { >CreateTypedArraysFromThisObj : Symbol(CreateTypedArraysFromThisObj, Decl(typedArrays.ts, 121, 1)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) ->ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, 1404, 1)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.d.ts, 1434, 1)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >n : Symbol(n, Decl(typedArrays.ts, 123, 69)) >v : Symbol(v, Decl(typedArrays.ts, 123, 78)) @@ -489,81 +489,81 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v typedArrays[0] = Int8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) ->Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2077, 42), Decl(lib.d.ts, 2367, 11)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2357, 38)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) +>Int8Array : Symbol(Int8Array, Decl(lib.d.ts, 2107, 42), Decl(lib.d.ts, 2397, 11)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.d.ts, 2387, 38)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2367, 44), Decl(lib.d.ts, 2657, 11)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2647, 39)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.d.ts, 2397, 44), Decl(lib.d.ts, 2687, 11)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.d.ts, 2677, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[2] = Int16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) ->Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2947, 60), Decl(lib.d.ts, 3237, 11)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3227, 39)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) +>Int16Array : Symbol(Int16Array, Decl(lib.d.ts, 2977, 60), Decl(lib.d.ts, 3267, 11)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.d.ts, 3257, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3237, 46), Decl(lib.d.ts, 3527, 11)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3517, 40)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.d.ts, 3267, 46), Decl(lib.d.ts, 3557, 11)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.d.ts, 3547, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[4] = Int32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) ->Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3527, 48), Decl(lib.d.ts, 3817, 11)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3807, 39)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) +>Int32Array : Symbol(Int32Array, Decl(lib.d.ts, 3557, 48), Decl(lib.d.ts, 3847, 11)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.d.ts, 3837, 39)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3817, 46), Decl(lib.d.ts, 4107, 11)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4097, 40)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.d.ts, 3847, 46), Decl(lib.d.ts, 4137, 11)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.d.ts, 4127, 40)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[6] = Float32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) ->Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4107, 48), Decl(lib.d.ts, 4397, 11)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4387, 41)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) +>Float32Array : Symbol(Float32Array, Decl(lib.d.ts, 4137, 48), Decl(lib.d.ts, 4427, 11)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.d.ts, 4417, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[7] = Float64Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) ->Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4397, 50), Decl(lib.d.ts, 4687, 11)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4677, 41)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) +>Float64Array : Symbol(Float64Array, Decl(lib.d.ts, 4427, 50), Decl(lib.d.ts, 4717, 11)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.d.ts, 4707, 41)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 124, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2657, 46), Decl(lib.d.ts, 2947, 11)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2937, 46)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.d.ts, 2687, 46), Decl(lib.d.ts, 2977, 11)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.d.ts, 2967, 46)) >obj : Symbol(obj, Decl(typedArrays.ts, 123, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 123, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 123, 98)) diff --git a/tests/baselines/reference/typeofANonExportedType.errors.txt b/tests/baselines/reference/typeofANonExportedType.errors.txt index 9bcef8a3ded..d07468f62e1 100644 --- a/tests/baselines/reference/typeofANonExportedType.errors.txt +++ b/tests/baselines/reference/typeofANonExportedType.errors.txt @@ -1,11 +1,12 @@ -tests/cases/conformance/types/specifyingTypes/typeQueries/typeofANonExportedType.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/types/specifyingTypes/typeQueries/typeofANonExportedType.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. +tests/cases/conformance/types/specifyingTypes/typeQueries/typeofANonExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or indirectly in its own type annotation. -==== tests/cases/conformance/types/specifyingTypes/typeQueries/typeofANonExportedType.ts (1 errors) ==== +==== tests/cases/conformance/types/specifyingTypes/typeQueries/typeofANonExportedType.ts (2 errors) ==== var x = 1; export var r1: typeof x; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. var y = { foo: '' }; export var r2: typeof y; class C { @@ -46,6 +47,8 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/typeofANonExportedType export var r11: typeof E.A; export var r12: typeof r12; + ~~~ +!!! error TS2502: 'r12' is referenced directly or indirectly in its own type annotation. function foo() { } module foo { diff --git a/tests/baselines/reference/typeofAnExportedType.errors.txt b/tests/baselines/reference/typeofAnExportedType.errors.txt index dc23127aa05..cb6d8c68887 100644 --- a/tests/baselines/reference/typeofAnExportedType.errors.txt +++ b/tests/baselines/reference/typeofAnExportedType.errors.txt @@ -1,10 +1,11 @@ -tests/cases/conformance/types/specifyingTypes/typeQueries/typeofAnExportedType.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/types/specifyingTypes/typeQueries/typeofAnExportedType.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. +tests/cases/conformance/types/specifyingTypes/typeQueries/typeofAnExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or indirectly in its own type annotation. -==== tests/cases/conformance/types/specifyingTypes/typeQueries/typeofAnExportedType.ts (1 errors) ==== +==== tests/cases/conformance/types/specifyingTypes/typeQueries/typeofAnExportedType.ts (2 errors) ==== export var x = 1; ~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. export var r1: typeof x; export var y = { foo: '' }; export var r2: typeof y; @@ -46,6 +47,8 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/typeofAnExportedType.t export var r11: typeof E.A; export var r12: typeof r12; + ~~~ +!!! error TS2502: 'r12' is referenced directly or indirectly in its own type annotation. export function foo() { } export module foo { diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index 1cef22bf2eb..f4401db1549 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -22,7 +22,7 @@ var r1: typeof D; var r2: typeof d; //// [typeofClass2.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.js b/tests/baselines/reference/typesWithSpecializedCallSignatures.js index e33c0302a2a..4baa9d71194 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -43,7 +43,7 @@ var r3: Base = c.foo('hm'); //// [typesWithSpecializedCallSignatures.js] // basic uses of specialized signatures without errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index ecb43cfcc9e..8f64b4be3bf 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -41,7 +41,7 @@ var r3: Base = new a('hm'); //// [typesWithSpecializedConstructSignatures.js] // basic uses of specialized signatures without errors -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/umdDependencyComment2.errors.txt b/tests/baselines/reference/umdDependencyComment2.errors.txt new file mode 100644 index 00000000000..316bac0576c --- /dev/null +++ b/tests/baselines/reference/umdDependencyComment2.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/umdDependencyComment2.ts(3,21): error TS2307: Cannot find module 'm2'. + + +==== tests/cases/compiler/umdDependencyComment2.ts (1 errors) ==== + /// + + import m1 = require("m2") + ~~~~ +!!! error TS2307: Cannot find module 'm2'. + m1.f(); + \ No newline at end of file diff --git a/tests/baselines/reference/umdDependencyComment2.js b/tests/baselines/reference/umdDependencyComment2.js new file mode 100644 index 00000000000..cae34631517 --- /dev/null +++ b/tests/baselines/reference/umdDependencyComment2.js @@ -0,0 +1,20 @@ +//// [umdDependencyComment2.ts] +/// + +import m1 = require("m2") +m1.f(); + + +//// [umdDependencyComment2.js] +/// +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports", "bar", "m2"], function (require, exports) { + var m1 = require("m2"); + m1.f(); +}); diff --git a/tests/baselines/reference/umdDependencyCommentName1.errors.txt b/tests/baselines/reference/umdDependencyCommentName1.errors.txt new file mode 100644 index 00000000000..197753127d1 --- /dev/null +++ b/tests/baselines/reference/umdDependencyCommentName1.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/umdDependencyCommentName1.ts(3,21): error TS2307: Cannot find module 'm2'. + + +==== tests/cases/compiler/umdDependencyCommentName1.ts (1 errors) ==== + /// + + import m1 = require("m2") + ~~~~ +!!! error TS2307: Cannot find module 'm2'. + m1.f(); + \ No newline at end of file diff --git a/tests/baselines/reference/umdDependencyCommentName1.js b/tests/baselines/reference/umdDependencyCommentName1.js new file mode 100644 index 00000000000..6cb87eb45f5 --- /dev/null +++ b/tests/baselines/reference/umdDependencyCommentName1.js @@ -0,0 +1,20 @@ +//// [umdDependencyCommentName1.ts] +/// + +import m1 = require("m2") +m1.f(); + + +//// [umdDependencyCommentName1.js] +/// +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports", "bar", "m2"], function (require, exports, b) { + var m1 = require("m2"); + m1.f(); +}); diff --git a/tests/baselines/reference/umdDependencyCommentName2.errors.txt b/tests/baselines/reference/umdDependencyCommentName2.errors.txt new file mode 100644 index 00000000000..d8920aed91b --- /dev/null +++ b/tests/baselines/reference/umdDependencyCommentName2.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/umdDependencyCommentName2.ts(5,21): error TS2307: Cannot find module 'm2'. + + +==== tests/cases/compiler/umdDependencyCommentName2.ts (1 errors) ==== + /// + /// + /// + + import m1 = require("m2") + ~~~~ +!!! error TS2307: Cannot find module 'm2'. + m1.f(); + \ No newline at end of file diff --git a/tests/baselines/reference/umdDependencyCommentName2.js b/tests/baselines/reference/umdDependencyCommentName2.js new file mode 100644 index 00000000000..d474454936d --- /dev/null +++ b/tests/baselines/reference/umdDependencyCommentName2.js @@ -0,0 +1,24 @@ +//// [umdDependencyCommentName2.ts] +/// +/// +/// + +import m1 = require("m2") +m1.f(); + + +//// [umdDependencyCommentName2.js] +/// +/// +/// +(function (deps, factory) { + if (typeof module === 'object' && typeof module.exports === 'object') { + var v = factory(require, exports); if (v !== undefined) module.exports = v; + } + else if (typeof define === 'function' && define.amd) { + define(deps, factory); + } +})(["require", "exports", "bar", "goo", "foo", "m2"], function (require, exports, b, c) { + var m1 = require("m2"); + m1.f(); +}); diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index 33e1d522b1f..bb78d5995c3 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -4,7 +4,7 @@ module M { export class C extends M.I { } } //// [undeclaredBase.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/undeclaredModuleError.errors.txt b/tests/baselines/reference/undeclaredModuleError.errors.txt index 62faef02eea..74e36318595 100644 --- a/tests/baselines/reference/undeclaredModuleError.errors.txt +++ b/tests/baselines/reference/undeclaredModuleError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/undeclaredModuleError.ts(1,21): error TS2307: Cannot find external module 'fs'. +tests/cases/compiler/undeclaredModuleError.ts(1,21): error TS2307: Cannot find module 'fs'. tests/cases/compiler/undeclaredModuleError.ts(8,29): error TS2345: Argument of type '() => void' is not assignable to parameter of type '(stat: any, name: string) => boolean'. Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. @@ -7,7 +7,7 @@ tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find ==== tests/cases/compiler/undeclaredModuleError.ts (3 errors) ==== import fs = require('fs'); ~~~~ -!!! error TS2307: Cannot find external module 'fs'. +!!! error TS2307: Cannot find module 'fs'. function readdir(path: string, accept: (stat: fs.Stats, name: string) => boolean, callback: (error: Error, results: { name: string; stat: fs.Stats; }[]) => void ) {} function join(...paths: string[]) {} diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index b1ef3e19edd..49877eb62e0 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -123,7 +123,7 @@ class D17 extends Base { //// [undefinedIsSubtypeOfEverything.js] // undefined is a subtype of every other types, no errors expected below -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index bff8b7ef43f..c1839fadfdc 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -49,7 +49,7 @@ class MyView extends View { //// [underscoreMapFirst.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index 8343b8e5208..04ee64b73e3 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -20,7 +20,7 @@ var z1: string | typeof BC; //// [unionTypeEquivalence.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.js b/tests/baselines/reference/unionTypeFromArrayLiteral.js index 0aa549f5490..ab43a6273b2 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -28,7 +28,7 @@ var arr9 = [e, f]; // (E|F)[] // If the array literal is empty, the resulting type is an array type with the element type Undefined. // Otherwise, if the array literal is contextually typed by a type that has a property with the numeric name ‘0’, the resulting type is a tuple type constructed from the types of the element expressions. // Otherwise, the resulting type is an array type with an element type that is the union of the types of the element expressions. -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/unionTypePropertyAccessibility.errors.txt b/tests/baselines/reference/unionTypePropertyAccessibility.errors.txt new file mode 100644 index 00000000000..ab60674ddc6 --- /dev/null +++ b/tests/baselines/reference/unionTypePropertyAccessibility.errors.txt @@ -0,0 +1,87 @@ +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(35,1): error TS2445: Property 'member' is protected and only accessible within class 'Protected' and its subclasses. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(36,1): error TS2341: Property 'member' is private and only accessible within class 'Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(38,4): error TS2339: Property 'member' does not exist on type 'Default | Protected'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(39,4): error TS2339: Property 'member' does not exist on type 'Default | Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(40,4): error TS2339: Property 'member' does not exist on type 'Public | Protected'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(41,4): error TS2339: Property 'member' does not exist on type 'Public | Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(42,5): error TS2339: Property 'member' does not exist on type 'Protected | Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(43,5): error TS2339: Property 'member' does not exist on type 'Default | Public | Protected'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(44,5): error TS2339: Property 'member' does not exist on type 'Default | Public | Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(45,5): error TS2339: Property 'member' does not exist on type 'Default | Protected | Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(46,5): error TS2339: Property 'member' does not exist on type 'Public | Protected | Private'. +tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts(47,5): error TS2339: Property 'member' does not exist on type 'Default | Public | Protected | Private'. + + +==== tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts (12 errors) ==== + class Default { + member: string; + } + + class Public { + public member: string; + } + + class Protected { + protected member: string; + } + + class Private { + private member: number; + } + + var v1: Default; + var v2: Public; + var v3: Protected; + var v4: Private; + var v5: Default | Public; + var v6: Default | Protected; + var v7: Default | Private; + var v8: Public | Protected; + var v9: Public | Private; + var v10: Protected | Private; + var v11: Default | Public | Protected; + var v12: Default | Public | Private; + var v13: Default | Protected | Private; + var v14: Public | Private | Protected; + var v15: Default | Public | Private | Protected; + + v1.member; + v2.member; + v3.member; + ~~~~~~~~~ +!!! error TS2445: Property 'member' is protected and only accessible within class 'Protected' and its subclasses. + v4.member; + ~~~~~~~~~ +!!! error TS2341: Property 'member' is private and only accessible within class 'Private'. + v5.member; + v6.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Default | Protected'. + v7.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Default | Private'. + v8.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Public | Protected'. + v9.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Public | Private'. + v10.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Protected | Private'. + v11.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Default | Public | Protected'. + v12.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Default | Public | Private'. + v13.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Default | Protected | Private'. + v14.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Public | Protected | Private'. + v15.member; + ~~~~~~ +!!! error TS2339: Property 'member' does not exist on type 'Default | Public | Protected | Private'. + \ No newline at end of file diff --git a/tests/baselines/reference/unionTypePropertyAccessibility.js b/tests/baselines/reference/unionTypePropertyAccessibility.js new file mode 100644 index 00000000000..3c5c4b42fee --- /dev/null +++ b/tests/baselines/reference/unionTypePropertyAccessibility.js @@ -0,0 +1,101 @@ +//// [unionTypePropertyAccessibility.ts] +class Default { + member: string; +} + +class Public { + public member: string; +} + +class Protected { + protected member: string; +} + +class Private { + private member: number; +} + +var v1: Default; +var v2: Public; +var v3: Protected; +var v4: Private; +var v5: Default | Public; +var v6: Default | Protected; +var v7: Default | Private; +var v8: Public | Protected; +var v9: Public | Private; +var v10: Protected | Private; +var v11: Default | Public | Protected; +var v12: Default | Public | Private; +var v13: Default | Protected | Private; +var v14: Public | Private | Protected; +var v15: Default | Public | Private | Protected; + +v1.member; +v2.member; +v3.member; +v4.member; +v5.member; +v6.member; +v7.member; +v8.member; +v9.member; +v10.member; +v11.member; +v12.member; +v13.member; +v14.member; +v15.member; + + +//// [unionTypePropertyAccessibility.js] +var Default = (function () { + function Default() { + } + return Default; +})(); +var Public = (function () { + function Public() { + } + return Public; +})(); +var Protected = (function () { + function Protected() { + } + return Protected; +})(); +var Private = (function () { + function Private() { + } + return Private; +})(); +var v1; +var v2; +var v3; +var v4; +var v5; +var v6; +var v7; +var v8; +var v9; +var v10; +var v11; +var v12; +var v13; +var v14; +var v15; +v1.member; +v2.member; +v3.member; +v4.member; +v5.member; +v6.member; +v7.member; +v8.member; +v9.member; +v10.member; +v11.member; +v12.member; +v13.member; +v14.member; +v15.member; diff --git a/tests/baselines/reference/unionTypesAssignability.js b/tests/baselines/reference/unionTypesAssignability.js index a94ea07dce2..7778e1beded 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -73,7 +73,7 @@ function foo(t: T, u: U) { //// [unionTypesAssignability.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index cbcdd2ea27f..0e081a66b83 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -33,7 +33,7 @@ class C5 { } //// [unknownSymbols1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/unknownSymbols2.errors.txt b/tests/baselines/reference/unknownSymbols2.errors.txt index e78b4a14b61..e85d3c2f3bc 100644 --- a/tests/baselines/reference/unknownSymbols2.errors.txt +++ b/tests/baselines/reference/unknownSymbols2.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/unknownSymbols2.ts(15,13): error TS2304: Cannot find name ' tests/cases/compiler/unknownSymbols2.ts(16,14): error TS2304: Cannot find name 'qwerty'. tests/cases/compiler/unknownSymbols2.ts(22,19): error TS2304: Cannot find name 'asdf'. tests/cases/compiler/unknownSymbols2.ts(23,32): error TS2304: Cannot find name 'qwerty'. -tests/cases/compiler/unknownSymbols2.ts(29,16): error TS2304: Cannot find name 'asdf'. +tests/cases/compiler/unknownSymbols2.ts(29,16): error TS2503: Cannot find namespace 'asdf'. ==== tests/cases/compiler/unknownSymbols2.ts (10 errors) ==== @@ -59,5 +59,5 @@ tests/cases/compiler/unknownSymbols2.ts(29,16): error TS2304: Cannot find name ' import c = N; import d = asdf; ~~~~ -!!! error TS2304: Cannot find name 'asdf'. +!!! error TS2503: Cannot find namespace 'asdf'. } \ No newline at end of file diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 0ca464a93af..df64daff2bf 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -154,7 +154,7 @@ module ts { //// [unspecializedConstraints.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index 9e0ff95536d..8304aae576f 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -44,7 +44,7 @@ c5(1); // error //// [untypedFunctionCallsWithTypeParameters1.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index d71548e02e8..6f2fc67d7e1 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -10,7 +10,7 @@ class Super extends Base { } //// [validUseOfThisInSuper.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index e61377e255b..005ba55d761 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -25,7 +25,7 @@ reg.register(B); //// [varArgsOnConstructorTypes.js] -var __extends = this.__extends || function (d, b) { +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; } __.prototype = b.prototype; diff --git a/tests/cases/compiler/contextualTyping.ts b/tests/cases/compiler/contextualTyping.ts index e378fd82065..a50d542343a 100644 --- a/tests/cases/compiler/contextualTyping.ts +++ b/tests/cases/compiler/contextualTyping.ts @@ -1,4 +1,4 @@ -// @newline: \n +// @normalizenewline: \n // @sourcemap: true // DEFAULT INTERFACES interface IFoo { diff --git a/tests/cases/compiler/es5-umd.ts b/tests/cases/compiler/es5-umd.ts new file mode 100644 index 00000000000..d0f65f76982 --- /dev/null +++ b/tests/cases/compiler/es5-umd.ts @@ -0,0 +1,17 @@ +// @target: ES5 +// @sourcemap: false +// @declaration: false +// @module: umd + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} diff --git a/tests/cases/compiler/es5-umd2.ts b/tests/cases/compiler/es5-umd2.ts new file mode 100644 index 00000000000..a74ae21f4dd --- /dev/null +++ b/tests/cases/compiler/es5-umd2.ts @@ -0,0 +1,17 @@ +// @target: ES5 +// @sourcemap: false +// @declaration: false +// @module: umd + +export class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} diff --git a/tests/cases/compiler/es5-umd3.ts b/tests/cases/compiler/es5-umd3.ts new file mode 100644 index 00000000000..b4ab3cc1cf1 --- /dev/null +++ b/tests/cases/compiler/es5-umd3.ts @@ -0,0 +1,17 @@ +// @target: ES5 +// @sourcemap: false +// @declaration: false +// @module: umd + +export default class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} diff --git a/tests/cases/compiler/es5-umd4.ts b/tests/cases/compiler/es5-umd4.ts new file mode 100644 index 00000000000..5ab7e7de4e3 --- /dev/null +++ b/tests/cases/compiler/es5-umd4.ts @@ -0,0 +1,19 @@ +// @target: ES5 +// @sourcemap: false +// @declaration: false +// @module: umd + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +export = A; diff --git a/tests/cases/compiler/es6-umd.ts b/tests/cases/compiler/es6-umd.ts new file mode 100644 index 00000000000..239ff49ef6c --- /dev/null +++ b/tests/cases/compiler/es6-umd.ts @@ -0,0 +1,17 @@ +// @target: ES6 +// @sourcemap: false +// @declaration: false +// @module: umd + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/es6-umd2.ts b/tests/cases/compiler/es6-umd2.ts new file mode 100644 index 00000000000..54622fe81aa --- /dev/null +++ b/tests/cases/compiler/es6-umd2.ts @@ -0,0 +1,17 @@ +// @target: ES6 +// @sourcemap: false +// @declaration: false +// @module: umd + +export class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/es6ExportAssignment2.ts b/tests/cases/compiler/es6ExportAssignment2.ts new file mode 100644 index 00000000000..b07427209f9 --- /dev/null +++ b/tests/cases/compiler/es6ExportAssignment2.ts @@ -0,0 +1,8 @@ +// @target: es6 + +// @filename: a.ts +var a = 10; +export = a; // Error: export = not allowed in ES6 + +// @filename: b.ts +import * as a from "a"; diff --git a/tests/cases/compiler/es6ExportAssignment3.ts b/tests/cases/compiler/es6ExportAssignment3.ts new file mode 100644 index 00000000000..5c104accb85 --- /dev/null +++ b/tests/cases/compiler/es6ExportAssignment3.ts @@ -0,0 +1,8 @@ +// @target: es6 + +// @filename: a.d.ts +declare var a: number; +export = a; // OK, in ambient context + +// @filename: b.ts +import * as a from "a"; diff --git a/tests/cases/compiler/es6ExportAssignment4.ts b/tests/cases/compiler/es6ExportAssignment4.ts new file mode 100644 index 00000000000..60ef1ccbc9e --- /dev/null +++ b/tests/cases/compiler/es6ExportAssignment4.ts @@ -0,0 +1,10 @@ +// @target: es6 + +// @filename: modules.d.ts +declare module "a" { + var a: number; + export = a; // OK, in ambient context +} + +// @filename: b.ts +import * as a from "a"; diff --git a/tests/cases/compiler/exportDefaultVariable.ts b/tests/cases/compiler/exportDefaultVariable.ts new file mode 100644 index 00000000000..95fd503dfc4 --- /dev/null +++ b/tests/cases/compiler/exportDefaultVariable.ts @@ -0,0 +1,7 @@ +// Regression test for #3018 + +declare var io: any; + +declare module 'module' { + export default io; +} diff --git a/tests/cases/compiler/inlineSourceMap.ts b/tests/cases/compiler/inlineSourceMap.ts new file mode 100644 index 00000000000..35e9845ba58 --- /dev/null +++ b/tests/cases/compiler/inlineSourceMap.ts @@ -0,0 +1,5 @@ +// @target: ES3 +// @inlinesourcemap: true + +var x = 0; +console.log(x); \ No newline at end of file diff --git a/tests/cases/compiler/inlineSourceMap2.ts b/tests/cases/compiler/inlineSourceMap2.ts new file mode 100644 index 00000000000..1d426f17736 --- /dev/null +++ b/tests/cases/compiler/inlineSourceMap2.ts @@ -0,0 +1,11 @@ +// @target: ES3 +// @sourcemap: true +// @maproot: file:///folder +// @sourceroot: file:///folder +// @out: outfile.js +// @inlinesourcemap: true + +// configuration errors + +var x = 0; +console.log(x); \ No newline at end of file diff --git a/tests/cases/compiler/inlineSources.ts b/tests/cases/compiler/inlineSources.ts new file mode 100644 index 00000000000..f46eacdb57c --- /dev/null +++ b/tests/cases/compiler/inlineSources.ts @@ -0,0 +1,12 @@ +// @target: ES3 +// @sourcemap: true +// @inlinesources: true +// @out: out.js + +// @filename: a.ts +var a = 0; +console.log(a); + +// @filename: b.ts +var b = 0; +console.log(b); \ No newline at end of file diff --git a/tests/cases/compiler/inlineSources2.ts b/tests/cases/compiler/inlineSources2.ts new file mode 100644 index 00000000000..6fa567dc521 --- /dev/null +++ b/tests/cases/compiler/inlineSources2.ts @@ -0,0 +1,12 @@ +// @target: ES3 +// @inlinesourcemap: true +// @inlinesources: true +// @out: out.js + +// @filename: a.ts +var a = 0; +console.log(a); + +// @filename: b.ts +var b = 0; +console.log(b); \ No newline at end of file diff --git a/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts b/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts new file mode 100644 index 00000000000..231476ee339 --- /dev/null +++ b/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts @@ -0,0 +1,10 @@ +// @target: es6 +module M { + export class C { } +} +module M { + { + let M = 0; + new C(); + } +} \ No newline at end of file diff --git a/tests/cases/compiler/newLineFlagWithCRLF.ts b/tests/cases/compiler/newLineFlagWithCRLF.ts new file mode 100644 index 00000000000..2a25ebc50d1 --- /dev/null +++ b/tests/cases/compiler/newLineFlagWithCRLF.ts @@ -0,0 +1,4 @@ +// @newline: CRLF +var x=1; +x=2; + diff --git a/tests/cases/compiler/newLineFlagWithLF.ts b/tests/cases/compiler/newLineFlagWithLF.ts new file mode 100644 index 00000000000..2f85a3a1e7f --- /dev/null +++ b/tests/cases/compiler/newLineFlagWithLF.ts @@ -0,0 +1,4 @@ +// @newline: LF +var x=1; +x=2; + diff --git a/tests/cases/compiler/noEmitHelpers.ts b/tests/cases/compiler/noEmitHelpers.ts new file mode 100644 index 00000000000..cb37c0db961 --- /dev/null +++ b/tests/cases/compiler/noEmitHelpers.ts @@ -0,0 +1,4 @@ +// @noemithelpers: true + +class A { } +class B extends A { } diff --git a/tests/cases/compiler/noEmitHelpers2.ts b/tests/cases/compiler/noEmitHelpers2.ts new file mode 100644 index 00000000000..df71f4fae82 --- /dev/null +++ b/tests/cases/compiler/noEmitHelpers2.ts @@ -0,0 +1,11 @@ +// @noemithelpers: true +// @emitdecoratormetadata: true +// @target: es5 + +function decorator() { } + +@decorator +class A { + constructor(a: number, @decorator b: string) { + } +} \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationPlainFile-AMD.ts b/tests/cases/compiler/separateCompilationPlainFile-AMD.ts new file mode 100644 index 00000000000..a1010ce3e8c --- /dev/null +++ b/tests/cases/compiler/separateCompilationPlainFile-AMD.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: amd +// @separateCompilation: true + +declare function run(a: number): void; +run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts b/tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts new file mode 100644 index 00000000000..532d97f09eb --- /dev/null +++ b/tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: commonjs +// @separateCompilation: true + +declare function run(a: number): void; +run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-ES6.ts b/tests/cases/compiler/separateCompilationPlainFile-ES6.ts new file mode 100644 index 00000000000..20d4e8d79a2 --- /dev/null +++ b/tests/cases/compiler/separateCompilationPlainFile-ES6.ts @@ -0,0 +1,5 @@ +// @target: es6 +// @separateCompilation: true + +declare function run(a: number): void; +run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-System.ts b/tests/cases/compiler/separateCompilationPlainFile-System.ts new file mode 100644 index 00000000000..69065718254 --- /dev/null +++ b/tests/cases/compiler/separateCompilationPlainFile-System.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: system +// @separateCompilation: true + +declare function run(a: number): void; +run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-UMD.ts b/tests/cases/compiler/separateCompilationPlainFile-UMD.ts new file mode 100644 index 00000000000..4ab45686c90 --- /dev/null +++ b/tests/cases/compiler/separateCompilationPlainFile-UMD.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: umd +// @separateCompilation: true + +declare function run(a: number): void; +run(1); diff --git a/tests/cases/compiler/systemExportAssignment.ts b/tests/cases/compiler/systemExportAssignment.ts new file mode 100644 index 00000000000..dbf2826b788 --- /dev/null +++ b/tests/cases/compiler/systemExportAssignment.ts @@ -0,0 +1,9 @@ +// @target: es5 +// @module: system + +// @filename: a.d.ts +declare var a: number; +export = a; // OK, in ambient context + +// @filename: b.ts +import * as a from "a"; diff --git a/tests/cases/compiler/systemExportAssignment2.ts b/tests/cases/compiler/systemExportAssignment2.ts new file mode 100644 index 00000000000..e7b1bf9f24a --- /dev/null +++ b/tests/cases/compiler/systemExportAssignment2.ts @@ -0,0 +1,9 @@ +// @target: es5 +// @module: system + +// @filename: a.ts +var a = 10; +export = a; // Error: export = not allowed in ES6 + +// @filename: b.ts +import * as a from "a"; diff --git a/tests/cases/compiler/systemExportAssignment3.ts b/tests/cases/compiler/systemExportAssignment3.ts new file mode 100644 index 00000000000..6ff15b8692a --- /dev/null +++ b/tests/cases/compiler/systemExportAssignment3.ts @@ -0,0 +1,11 @@ +// @target: es5 +// @module: system + +// @filename: modules.d.ts +declare module "a" { + var a: number; + export = a; // OK, in ambient context +} + +// @filename: b.ts +import * as a from "a"; diff --git a/tests/cases/compiler/systemModule1.ts b/tests/cases/compiler/systemModule1.ts new file mode 100644 index 00000000000..cec8c07e7fc --- /dev/null +++ b/tests/cases/compiler/systemModule1.ts @@ -0,0 +1,4 @@ +// @target: es6 +// @module: system + +export var x = 1; \ No newline at end of file diff --git a/tests/cases/compiler/systemModule10.ts b/tests/cases/compiler/systemModule10.ts new file mode 100644 index 00000000000..49e99fb1c63 --- /dev/null +++ b/tests/cases/compiler/systemModule10.ts @@ -0,0 +1,11 @@ +// @module: system +// @separateCompilation: true + +import n, {x} from 'file1' +import n2 = require('file2'); +export {x} +export {x as y} +export {n} +export {n as n1} +export {n2} +export {n2 as n3} \ No newline at end of file diff --git a/tests/cases/compiler/systemModule10_ES5.ts b/tests/cases/compiler/systemModule10_ES5.ts new file mode 100644 index 00000000000..6468e4125d1 --- /dev/null +++ b/tests/cases/compiler/systemModule10_ES5.ts @@ -0,0 +1,12 @@ +// @target: es5 +// @module: system +// @separateCompilation: true + +import n, {x} from 'file1' +import n2 = require('file2'); +export {x} +export {x as y} +export {n} +export {n as n1} +export {n2} +export {n2 as n3} \ No newline at end of file diff --git a/tests/cases/compiler/systemModule11.ts b/tests/cases/compiler/systemModule11.ts new file mode 100644 index 00000000000..28e88688f87 --- /dev/null +++ b/tests/cases/compiler/systemModule11.ts @@ -0,0 +1,41 @@ +// @module: system +// @separateCompilation: true + +// set of tests cases that checks generation of local storage for exported names + +// @filename: file1.ts + +export var x; +export function foo() {} +export * from 'bar'; + +// @filename: file2.ts + +var x; +var y; +export {x}; +export {y as y1} + +export * from 'bar'; + +// @filename: file3.ts + +export {x, y as z} from 'a'; +export default function foo() {} +export * from 'bar'; + +// @filename: file4.ts + +export var x; +export function foo() {} +export default function (){} + +var z, z1; +export {z, z1 as z2}; + +export {s, s1 as s2} from 'a' + +// @filename: file5.ts + +function foo() {} +export * from 'a'; \ No newline at end of file diff --git a/tests/cases/compiler/systemModule2.ts b/tests/cases/compiler/systemModule2.ts new file mode 100644 index 00000000000..13e965a657c --- /dev/null +++ b/tests/cases/compiler/systemModule2.ts @@ -0,0 +1,4 @@ +// @module: system + +var x = 1; +export = x; \ No newline at end of file diff --git a/tests/cases/compiler/systemModule3.ts b/tests/cases/compiler/systemModule3.ts new file mode 100644 index 00000000000..2c33e2ac131 --- /dev/null +++ b/tests/cases/compiler/systemModule3.ts @@ -0,0 +1,17 @@ +// @module: system + +// @filename: file1.ts + +export default function() {} + +// @filename: file2.ts + +export default function f() {} + +// @filename: file3.ts + +export default class C {} + +// @filename: file4.ts + +export default class {} \ No newline at end of file diff --git a/tests/cases/compiler/systemModule4.ts b/tests/cases/compiler/systemModule4.ts new file mode 100644 index 00000000000..2dc46ee68e5 --- /dev/null +++ b/tests/cases/compiler/systemModule4.ts @@ -0,0 +1,4 @@ +// @module: system + +export var x = 1; +export var y; \ No newline at end of file diff --git a/tests/cases/compiler/systemModule5.ts b/tests/cases/compiler/systemModule5.ts new file mode 100644 index 00000000000..c30eefa978a --- /dev/null +++ b/tests/cases/compiler/systemModule5.ts @@ -0,0 +1,3 @@ +// @module: system + +export function foo() {} diff --git a/tests/cases/compiler/systemModule6.ts b/tests/cases/compiler/systemModule6.ts new file mode 100644 index 00000000000..1d1801e37c7 --- /dev/null +++ b/tests/cases/compiler/systemModule6.ts @@ -0,0 +1,6 @@ +// @module: system + +export class C {} +function foo() { + new C(); +} diff --git a/tests/cases/compiler/systemModule7.ts b/tests/cases/compiler/systemModule7.ts new file mode 100644 index 00000000000..bb22822d0d1 --- /dev/null +++ b/tests/cases/compiler/systemModule7.ts @@ -0,0 +1,11 @@ +// @module: system + +// filename: instantiatedModule.ts +export module M { + var x = 1; +} + +// filename: nonInstantiatedModule.ts +export module M { + interface I {} +} \ No newline at end of file diff --git a/tests/cases/compiler/systemModule8.ts b/tests/cases/compiler/systemModule8.ts new file mode 100644 index 00000000000..c3e0c7c7437 --- /dev/null +++ b/tests/cases/compiler/systemModule8.ts @@ -0,0 +1,31 @@ +// @module: system + +export var x; +x = 1; +x++; +x--; +++x; +--x; +x += 1; +x -= 1; +x *= 1; +x /= 1; +x |= 1; +x &= 1; +x + 1; +x - 1; +x & 1; +x | 1; +for (x = 5;;x++) {} +for (x = 8;;x--) {} +for (x = 15;;++x) {} +for (x = 18;;--x) {} + +for (let x = 50;;) {} +function foo() { + x = 100; +} + +export let [y] = [1]; +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +for ([x] of [[1]]) {} \ No newline at end of file diff --git a/tests/cases/compiler/systemModule9.ts b/tests/cases/compiler/systemModule9.ts new file mode 100644 index 00000000000..c6ff742b1bf --- /dev/null +++ b/tests/cases/compiler/systemModule9.ts @@ -0,0 +1,23 @@ +// @module: system +// @separateCompilation: true + +import * as ns from 'file1'; +import {a, b as c} from 'file2'; +import d from 'file3' +import 'file4' +import e, * as ns2 from 'file5'; +import ns3 = require('file6'); + +ns.f(); +a(); +c(); +d(); +e(); +ns2.f(); +ns3.f(); + +export * from 'file7'; + +var x, y = true; +export {x}; +export {y as z}; \ No newline at end of file diff --git a/tests/cases/compiler/umdDependencyComment2.ts b/tests/cases/compiler/umdDependencyComment2.ts new file mode 100644 index 00000000000..87e4fd48526 --- /dev/null +++ b/tests/cases/compiler/umdDependencyComment2.ts @@ -0,0 +1,5 @@ +//@module: umd +/// + +import m1 = require("m2") +m1.f(); diff --git a/tests/cases/compiler/umdDependencyCommentName1.ts b/tests/cases/compiler/umdDependencyCommentName1.ts new file mode 100644 index 00000000000..90b852c9bfd --- /dev/null +++ b/tests/cases/compiler/umdDependencyCommentName1.ts @@ -0,0 +1,5 @@ +//@module: umd +/// + +import m1 = require("m2") +m1.f(); diff --git a/tests/cases/compiler/umdDependencyCommentName2.ts b/tests/cases/compiler/umdDependencyCommentName2.ts new file mode 100644 index 00000000000..bbdd847b84b --- /dev/null +++ b/tests/cases/compiler/umdDependencyCommentName2.ts @@ -0,0 +1,7 @@ +//@module: umd +/// +/// +/// + +import m1 = require("m2") +m1.f(); diff --git a/tests/cases/conformance/ambient/ambientEnumDeclaration1.ts b/tests/cases/conformance/ambient/ambientEnumDeclaration1.ts new file mode 100644 index 00000000000..9cafe943d13 --- /dev/null +++ b/tests/cases/conformance/ambient/ambientEnumDeclaration1.ts @@ -0,0 +1,9 @@ +// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. + +declare enum E { + a = 10, + b = 10 + 1, + c = b, + d = (c) + 1, + e = 10 << 2 * 8, +} \ No newline at end of file diff --git a/tests/cases/conformance/ambient/ambientEnumDeclaration2.ts b/tests/cases/conformance/ambient/ambientEnumDeclaration2.ts new file mode 100644 index 00000000000..dd6e1a1605e --- /dev/null +++ b/tests/cases/conformance/ambient/ambientEnumDeclaration2.ts @@ -0,0 +1,12 @@ +// In ambient enum declarations that specify no const modifier, enum member declarations +// that omit a value are considered computed members (as opposed to having auto- incremented values assigned). + +declare enum E { + a, // E.a + b, // E.b +} + +declare const enum E1 { + a, // E.a = 0 + b, // E.b = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/constEnums/constEnum1.ts b/tests/cases/conformance/constEnums/constEnum1.ts new file mode 100644 index 00000000000..6bf59b772e9 --- /dev/null +++ b/tests/cases/conformance/constEnums/constEnum1.ts @@ -0,0 +1,16 @@ +// @declaration: true + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +const enum E { + a = 10, + b = a, + c = (a+1), + e, + d = ~e, + f = a << 2 >> 1, + g = a << 2 >>> 1, + h = a | b +} \ No newline at end of file diff --git a/tests/cases/conformance/constEnums/constEnum2.ts b/tests/cases/conformance/constEnums/constEnum2.ts new file mode 100644 index 00000000000..a90e83d6c43 --- /dev/null +++ b/tests/cases/conformance/constEnums/constEnum2.ts @@ -0,0 +1,15 @@ +// @declaration: true + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +// Error : not a constant enum expression + +const CONST = 9000 % 2; +const enum D { + d = 10, + e = 199 * Math.floor(Math.random() * 1000), + f = d - (100 * Math.floor(Math.random() % 8)) + g = CONST, +} \ No newline at end of file diff --git a/tests/cases/conformance/constEnums/constEnumPropertyAccess1.ts b/tests/cases/conformance/constEnums/constEnumPropertyAccess1.ts new file mode 100644 index 00000000000..bf1b277e3b5 --- /dev/null +++ b/tests/cases/conformance/constEnums/constEnumPropertyAccess1.ts @@ -0,0 +1,32 @@ +// @declaration: true +// @target: es6 + +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members + +const enum G { + A = 1, + B = 2, + C = A + B, + D = A * 2 +} + +var o: { + [idx: number]: boolean +} = { + 1: true + }; + +var a = G.A; +var a1 = G["A"]; +var g = o[G.A]; + +class C { + [G.A]() { } + get [G.B]() { + return true; + } + set [G.B](x: number) { } +} + diff --git a/tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts b/tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts new file mode 100644 index 00000000000..229f034269b --- /dev/null +++ b/tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts @@ -0,0 +1,20 @@ +// @declaration: true + +// constant enum declarations are completely erased in the emitted JavaScript code. +// it is an error to reference a constant enum object in any other context +// than a property access that selects one of the enum's members + +const enum G { + A = 1, + B = 2, + C = A + B, + D = A * 2 +} + +// Error from referring constant enum in any other context than a property access +var z = G; +var z1 = G[G.A]; +var g: G; +g = "string"; +function foo(x: G) { } +G.B = 3; diff --git a/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts b/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts new file mode 100644 index 00000000000..5b594e3cada --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts @@ -0,0 +1,52 @@ +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +var [a2 = false, a3 = 1]: any = undefined; + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; + +function foo() { + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +var [...b8] = foo(); + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [,,, c8] = [1, 2, 3, 4]; +var [,,, c9] = [1, 2, 3, 4]; +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; + diff --git a/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts b/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts new file mode 100644 index 00000000000..9b631706bfd --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts @@ -0,0 +1,53 @@ +// @target: es6 + +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// 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 the type Any, or + +var [a0, a1]: any = undefined; +var [a2 = false, a3 = 1]: any = undefined; + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; + +function foo() { + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +var [...b8] = foo(); + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [,,, c8] = [1, 2, 3, 4]; +var [,,, c9] = [1, 2, 3, 4]; +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts b/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts new file mode 100644 index 00000000000..bc5a2da176b --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts @@ -0,0 +1,34 @@ +// 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 the type Any, or +var [[a0], [[a1]]] = [] // Error +var [[a2], [[a3]]] = undefined // Error + +// 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 a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error +interface J extends Array { + 2: number; +} + +function bar(): J { + return <[number, number, number]>[1, 2, 3]; +} +var [b3 = "string", b4, b5] = bar(); // Error + +// 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. +var temp = [1, 2, 3] +var [c0, c1]: [number, number] = [...temp]; // Error +var [c2, c3]: [string, string] = [...temp]; // Error + +interface F { + [idx: number]: boolean +} + +function foo(idx: number): F { + return { + 2: true + } +} +var [c4, c5, c6] = foo(1); // Error \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts b/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts new file mode 100644 index 00000000000..e25a11ba5b0 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts @@ -0,0 +1,54 @@ +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +var { a2 }: any = {}; + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +var {1: b3} = { 1: "string" }; +var {b4 = 1}: any = { b4: 100000 }; +var {b5: { b52 } } = { b5: { b52 } }; + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { + [idx: number]: boolean; +} + +function foo(): F { + return { + 1: true + }; +} + +function bar(): F { + return { + 2: true + }; +} +var {1: c0} = foo(); +var {1: c1} = bar(); + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { + [str: string]: number; +} + +function foo1(): F1 { + return { + "prop1": 2 + } +} + +var {"prop1": d1} = foo1(); +var {"prop2": d1} = foo1(); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts b/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts new file mode 100644 index 00000000000..a99b48d75da --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts @@ -0,0 +1,55 @@ +// @target: es6 +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an object assignment pattern and, for each assignment property P in V, +// S is the type Any, or +var { a1 }: any = undefined; +var { a2 }: any = {}; + +// V is an object assignment pattern and, for each assignment property P in V, +// S has an apparent property with the property name specified in +// P of a type that is assignable to the target given in P, or +var { b1, } = { b1:1, }; +var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; +var {1: b3} = { 1: "string" }; +var {b4 = 1}: any = { b4: 100000 }; +var {b5: { b52 } } = { b5: { b52 } }; + +// V is an object assignment pattern and, for each assignment property P in V, +// P specifies a numeric property name and S has a numeric index signature +// of a type that is assignable to the target given in P, or + +interface F { + [idx: number]: boolean; +} + +function foo(): F { + return { + 1: true + }; +} + +function bar(): F { + return { + 2: true + }; +} +var {1: c0} = foo(); +var {1: c1} = bar(); + +// V is an object assignment pattern and, for each assignment property P in V, +// S has a string index signature of a type that is assignable to the target given in P + +interface F1 { + [str: string]: number; +} + +function foo1(): F1 { + return { + "prop1": 2 + } +} + +var {"prop1": d1} = foo1(); +var {"prop2": d1} = foo1(); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts b/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts new file mode 100644 index 00000000000..2b3192bc9a2 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts @@ -0,0 +1,10 @@ +// Error +var {h?} = { h?: 1 }; +var {i}: string | number = { i: 2 }; +var {i1}: string | number| {} = { i1: 2 }; +var { f2: {f21} = { f212: "string" } }: any = undefined; +var { ...d1 } = { + a: 1, b: 1, d1: 9, e: 10 +} +var {1} = { 1 }; +var {"prop"} = { "prop": 1 }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts new file mode 100644 index 00000000000..01f3cda52bf --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts @@ -0,0 +1,96 @@ +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +function a2(o: { x: number, a: number }) { } +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +function a4({x, a}: { x: number, a: number }) { } + +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + +interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); +b6(["string", 1, 2]); // Shouldn't be an error +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string} = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c=1]]]) { } + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + +c1(); // Implied type is {z:number}? +c1({ z: 1 }) // Implied type is {z:number}? + +c2({}); // Implied type is {z?: number} +c2({z:1}); // Implied type is {z?: number} + +c3({ b: 1 }); // Implied type is { b: number|string }. + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +function d0(x?) { } +function d0(x = 10) { } + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } +} + +class C3 implements F2 { + d3([a, b, c]) { } + d4({x, y, z}) { } + e0([a, b, c]) { } +} + + +function d5({x, y} = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +function e2({x}: { x: number }) { } // x is type number +function e3({x}: { x?: number }) { } // x is an optional with type number +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts new file mode 100644 index 00000000000..58d69729b98 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts @@ -0,0 +1,99 @@ +// Conformance for emitting ES6 +// @target: es6 + +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +function a2(o: { x: number, a: number }) { } +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +function a4({x, a}: { x: number, a: number }) { } + +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); + + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + +interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string} = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c=1]]]) { } + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + +c1(); // Implied type is {z:number}? +c1({ z: 1 }) // Implied type is {z:number}? + +c2({}); // Implied type is {z?: number} +c2({z:1}); // Implied type is {z?: number} + +c3({ b: 1 }); // Implied type is { b: number|string }. + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } +} + +class C3 implements F2 { + d3([a, b, c]) { } + d4({x, y, z}) { } + e0([a, b, c]) { } +} + +function d5({x, y} = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +function e2({x}: { x: number }) { } // x is type number +function e3({x}: { x?: number }) { } // x is an optional with type number +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] + +function e6({x: [number, number, number]}) { } // should be an error, duplicate identifier; + + diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts new file mode 100644 index 00000000000..19f508c0625 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts @@ -0,0 +1,67 @@ +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a0([a, b, [[c]]]: [number, number, string[][]]) { } +a0([1, "string", [["world"]]); // Error +a0([1, 2, [["world"]], "string"]); // Error + + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +interface F1 { + b0(z = 10, [[a, b], d, {u}] = [[1, 2], "string", { u: false }]); // Error, no function body +} + +function b1(z = null, o = { x: 0, y: undefined }) { } +function b2([a, z, y] = [undefined, null, undefined]) { } +function b3([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1("string", { x: "string", y: true }); // Error + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string } = { b: "hello" }) { } +function c4([z], z: number) { } // Error Duplicate identifier +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c = 1]]]) { } + +c0({ z: 1 }); // Error, implied type is { z: {x: any, y: {j: any}} } +c1({}); // Error, implied type is {z:number}? +c1({ z: true }); // Error, implied type is {z:number}? +c2({ z: false }); // Error, implied type is {z?: number} +c3({ b: true }); // Error, implied type is { b: number|string }. +c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]] +c6([1, 2, [["string"]]]); // Error, implied type is [any, any, [[number]]] // Use initializer + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. Initializers (including binding property or element initializers) are +// permitted only when the parameter list occurs in conjunction with a function body + +function d1([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature +function d2({x, y, z}?) { } // Error, binding pattern can't be optional in implementation signature + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C4 implements F2 { + d3([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature + d4({x, y, c}) { } + e0([a, b, q]) { } +} + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e0({x: [number, number, number]}) { } // should be an error, duplicate identifier; + + diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5.ts new file mode 100644 index 00000000000..6eab2225e03 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5.ts @@ -0,0 +1,46 @@ +// @target: es6 + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a1(...x: (number|string)[]) { } +function a2(...a) { } +function a3(...a: Array) { } +function a4(...a: arrayString) { } +function a5(...a: stringOrNumArray) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]: number[]) { } + + +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] + +// Rest parameter with generic +function foo(...a: T[]) { } +foo("hello", 1, 2); +foo("hello", "world"); + +enum E { a, b } +const enum E1 { a, b } +function foo1(...a: T[]) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, E1.a, E.b); + + diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts new file mode 100644 index 00000000000..6eab2225e03 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts @@ -0,0 +1,46 @@ +// @target: es6 + +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a1(...x: (number|string)[]) { } +function a2(...a) { } +function a3(...a: Array) { } +function a4(...a: arrayString) { } +function a5(...a: stringOrNumArray) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]: number[]) { } + + +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] + +// Rest parameter with generic +function foo(...a: T[]) { } +foo("hello", 1, 2); +foo("hello", "world"); + +enum E { a, b } +const enum E1 { a, b } +function foo1(...a: T[]) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, E1.a, E.b); + + diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts new file mode 100644 index 00000000000..02fc84b380a --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts @@ -0,0 +1,36 @@ +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a0(...x: [number, number, string]) { } // Error, rest parameter must be array type +function a1(...x: (number|string)[]) { } +function a2(...a: someArray) { } // Error, rest parameter must be array type +function a3(...b?) { } // Error, can't be optional +function a4(...b = [1,2,3]) { } // Error, can't have initializer +function a5([a, b, [[c]]]) { } +function a6([a, b, c, ...x]: number[]) { } + + +a1(1, 2, "hello", true); // Error, parameter type is (number|string)[] +a1(...array2); // Error parameter type is (number|string)[] +a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] +a5([1, 2]); // Error, parameter type is [any, any, [[any]]] +a6([1, 2, "string"]); // Error, parameter type is number[] + + +var temp = [1, 2, 3]; +class C { + constructor(public ...temp) { } // Error, rest parameter can't have accessibilityModifier +} + +// Rest parameter with generic +function foo1(...a: T[]) { } +foo1(1, 2, "string", E1.a, E.b); // Error + + diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts new file mode 100644 index 00000000000..c4fcffed491 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts @@ -0,0 +1,50 @@ +// Parameter Declaration with generic + +interface F { } +class Class implements F { + constructor() { } +} + +class SubClass extends Class { + foo: boolean; + constructor() { super(); } +} + +class D implements F { + foo: boolean + constructor() { } +} + +class SubD extends D { + bar: number + constructor() { + super(); + } +} + + +function d0({x} = { x: new Class() }) { } +function d1({x}: { x: F }) { } +function d2({x}: { x: Class }) { } +function d3({y}: { y: D }) { } +function d4({y} = { y: new D() }) { } + +var obj = new Class(); +d0({ x: 1 }); +d0({ x: {} }); +d0({ x: "string" }); + +d1({ x: new Class() }); +d1({ x: {} }); +d1({ x: "string" }); + +d2({ x: new SubClass() }); +d2({ x: {} }); + +d3({ y: new SubD() }); +d3({ y: new SubClass() }); +// Error +d3({ y: new Class() }); +d3({}); +d3({ y: 1 }); +d3({ y: "world" }); \ No newline at end of file diff --git a/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts new file mode 100644 index 00000000000..c583b750fef --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts @@ -0,0 +1,20 @@ +// A parameter declaration may specify either an identifier or a binding pattern. + +// Reserved words are not allowed to be used as an identifier in parameter declaration +"use strict" + +// Error +function a({while}) { } +function a1({public}) { } +function a4([while, for, public]){ } +function a5(...while) { } +function a6(...public) { } +function a7(...a: string) { } +a({ while: 1 }); + +// No Error +function b1({public: x}) { } +function b2({while: y}) { } +b1({ public: 1 }); +b2({ while: 1 }); + diff --git a/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts b/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts new file mode 100644 index 00000000000..6121c00a784 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts @@ -0,0 +1,40 @@ +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +var temp = { t1: true, t2: "false" }; +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +var [...c2] = [1,2,3, "string"]; + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +var [d3, d4] = [1, "string", ...temp1]; + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; + diff --git a/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts b/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts new file mode 100644 index 00000000000..dee06e000ce --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts @@ -0,0 +1,41 @@ +// @target: es6 +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; +var temp = { t1: true, t2: "false" }; +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [...c1] = [1,2,3]; +var [...c2] = [1,2,3, "string"]; + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Let N be the zero-based index of the binding element in the array binding pattern. +// If S has a property with the numerical name N, T is the type of that property. +var [d1,d2] = [1,"string"] + +// The type T associated with a binding element is determined as follows: +// Otherwise, if S is a tuple- like type (section 3.3.3): +// Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. +var temp1 = [true, false, true] +var [d3, d4] = [1, "string", ...temp1]; + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; + diff --git a/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts b/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts new file mode 100644 index 00000000000..8ffd3bddd58 --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts @@ -0,0 +1,19 @@ +// The type T associated with a destructuring variable declaration is determined as follows: +// If the declaration includes a type annotation, T is that type. +var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error + +// The type T associated with a destructuring variable declaration is determined as follows: +// Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. +var temp = { t1: true, t2: "false" }; +var [b0 = 3, b1 = true, b2 = temp] = [3, false, { t1: false, t2: 5}]; // Error + +// The type T associated with a binding element is determined as follows: +// If the binding element is a rest element, T is an array type with +// an element type E, where E is the type of the numeric index signature of S. +var [c1, c2, { c3: c4, c5 }, , ...c6] = [1, 2, { c3: 4, c5: 0 }]; // Error + +// When a destructuring variable declaration, binding property, or binding element specifies +// an initializer expression, the type of the initializer expression is required to be assignable +// to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. +var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error \ No newline at end of file diff --git a/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts b/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts new file mode 100644 index 00000000000..34c77288f3f --- /dev/null +++ b/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts @@ -0,0 +1,56 @@ +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [,, 2, 3, 4] +var a1 = ["hello", "world"] +var a2 = [, , , ...a0, "hello"]; +var a3 = [,, ...a0] +var a4 = [() => 1, ]; +var a5 = [...a0, , ] + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; +var temp3 = [undefined, null, undefined]; +var temp4 = []; + +interface myArray extends Array { } +interface myArray2 extends Array { } +var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] +var d1 = [...temp]; // has type string[] +var d2: number[] = [...temp1]; +var d3: myArray = [...temp1]; +var d4: myArray2 = [...temp, ...temp1]; +var d5 = [...temp3]; +var d6 = [...temp4]; +var d7 = [...[...temp1]]; +var d8: number[][] = [[...temp1]] +var d9 = [[...temp1], ...["hello"]]; \ No newline at end of file diff --git a/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES6.ts b/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES6.ts new file mode 100644 index 00000000000..1a4e11e31eb --- /dev/null +++ b/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES6.ts @@ -0,0 +1,55 @@ +// @target:es6 +// ElementList: ( Modified ) +// Elisionopt AssignmentExpression +// Elisionopt SpreadElement +// ElementList, Elisionopt AssignmentExpression +// ElementList, Elisionopt SpreadElement + +// SpreadElement: +// ... AssignmentExpression + +var a0 = [, , 2, 3, 4] +var a1 = ["hello", "world"] +var a2 = [, , , ...a0, "hello"]; +var a3 = [, , ...a0] +var a4 = [() => 1, ]; +var a5 = [...a0, , ] + +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var b0: [any, any, any] = [undefined, null, undefined]; +var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [c0, c1] = [1, 2]; // tuple type [number, number] +var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +interface myArray extends Array { } +interface myArray2 extends Array { } +var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] +var d1 = [...temp]; // has type string[] +var d2: number[] = [...temp1]; +var d3: myArray = [...temp1]; +var d4: myArray2 = [...temp, ...temp1]; +var d5 = [...a2]; +var d6 = [...a3]; +var d7 = [...a4]; +var d8: number[][] = [[...temp1]] +var d9 = [[...temp1], ...["hello"]]; \ No newline at end of file diff --git a/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts b/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts new file mode 100644 index 00000000000..fd07347f503 --- /dev/null +++ b/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts @@ -0,0 +1,34 @@ +// Each element expression in a non-empty array literal is processed as follows: +// - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) +// by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, +// the element expression is contextually typed by the type of that property. + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is contextually typed by a tuple-like type, +// the resulting type is a tuple type constructed from the types of the element expressions. + +var a0: [any, any, any] = []; // Error +var a1: [boolean, string, number] = ["string", 1, true]; // Error + +// The resulting type an array literal expression is determined as follows: +// - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), +// the resulting type is a tuple type constructed from the types of the element expressions. + +var [b1, b2]: [number, number] = [1, 2, "string", true]; + +// The resulting type an array literal expression is determined as follows: +// - the resulting type is an array type with an element type that is the union of the types of the +// non - spread element expressions and the numeric index signature types of the spread element expressions +var temp = ["s", "t", "r"]; +var temp1 = [1, 2, 3]; +var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; + +interface tup { + 0: number[]|string[]; + 1: number[]|string[]; +} +interface myArray extends Array { } +interface myArray2 extends Array { } +var c0: tup = [...temp2]; // Error +var c1: [number, number, number] = [...temp1]; // Error cannot assign number[] to [number, number, number] +var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[] diff --git a/tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts b/tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts new file mode 100644 index 00000000000..a6ee88c1076 --- /dev/null +++ b/tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts @@ -0,0 +1,18 @@ +// In a typed function call, argument expressions are contextually typed by their corresponding parameter types. +function foo({x: [a, b], y: {c, d, e}}) { } +function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { } +function baz(x: [string, number, boolean]) { } + +var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; +var o1: { x: [string, number], y: { c: boolean, d: string, e: number } } = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; +foo(o1); // Not error since x has contextual type of tuple namely [string, number] +foo({ x: ["string", 1], y: { c: true, d: "world", e: 3 } }); // Not error + +var array = ["string", 1, true]; +var tuple: [string, number, boolean] = ["string", 1, true]; +baz(tuple); +baz(["string", 1, true]); + +baz(array); // Error +baz(["string", 1, true, ...array]); // Error +foo(o); // Error because x has an array type namely (string|number)[] \ No newline at end of file diff --git a/tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts b/tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts new file mode 100644 index 00000000000..17bca640a29 --- /dev/null +++ b/tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts @@ -0,0 +1,14 @@ +// In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by +// the type of the property with the numeric name N in the contextual type, if any, or otherwise +// the numeric index type of the contextual type, if any. +var array = [1, 2, 3]; +var array1 = [true, 2, 3]; // Contextual type by the numeric index type of the contextual type +var tup: [number, number, number] = [1, 2, 3, 4]; +var tup1: [number|string, number|string, number|string] = [1, 2, 3, "string"]; +var tup2: [number, number, number] = [1, 2, 3, "string"]; // Error + +// In a contextually typed array literal expression containing one or more spread elements, +// an element expression at index N is contextually typed by the numeric index type of the contextual type, if any. +var spr = [1, 2, 3, ...array]; +var spr1 = [1, 2, 3, ...tup]; +var spr2:[number, number, number] = [1, 2, 3, ...tup]; // Error diff --git a/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping1.ts b/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping1.ts new file mode 100644 index 00000000000..ea8e60cb5b9 --- /dev/null +++ b/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping1.ts @@ -0,0 +1,56 @@ +// When a function expression with no type parameters and no parameter type annotations +// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T + +enum E { red, blue } + +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. + +var a0: (n: number, s: string) => number = (num, str) => { + num.toExponential(); + return 0; +} + +class Class { + foo() { } +} + +var a1: (c: Class) => number = (a1) => { + a1.foo(); + return 1; +} + +// A contextual signature S is extracted from a function type T as follows: +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, +// then S is a signature with the same parameters and a union of the return types. +var b1: ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string); +b1 = (k, h) => { }; +var b2: typeof a0 | ((n: number, s: string) => string); +b2 = (foo, bar) => { return foo + 1; } +b2 = (foo, bar) => { return "hello"; } +var b3: (name: string, num: number, boo: boolean) => void; +b3 = (name, number) => { }; + +var b4: (n: E) => string = (number = 1) => { return "hello"; }; +var b5: (n: {}) => string = (number = "string") => { return "hello"; }; + +// A contextual signature S is extracted from a function type T as follows: +// Otherwise, no contextual signature can be extracted from T and S is undefined. +var b6: ((s: string, w: boolean) => void) | ((n: number) => number); +var b7: ((s: string, w: boolean) => void) | ((s: string, w: number) => string); +b6 = (k) => { k.toLowerCase() }; +b6 = (i) => { + i.toExponential(); + return i; +}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) +b7 = (j, m) => { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause) + +class C { + constructor() { + var k: ((j: T, k: U) => (T|U)[]) | ((j: number,k :U) => number[]) = (j, k) => { + return [j, k]; + } // Per spec, no contextual signature can be extracted in this case. + } +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts b/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts new file mode 100644 index 00000000000..1b88c1a8cfb --- /dev/null +++ b/tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts @@ -0,0 +1,11 @@ +// A contextual signature S is extracted from a function type T as follows: +// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. +// If T is a union type, let U be the set of element types in T that have call signatures. +// If each type in U has exactly one call signature and that call signature is non- generic, +// and if all of the signatures are identical ignoring return types, then S is a signature +// with the same parameters and a union of the return types. +// Otherwise, no contextual signature can be extracted from T and S is undefined. + +var a0: (n: number, s: string) => number +var a1: typeof a0 | ((n: number, s: string) => string); +a1 = (foo, bar) => { return true; } // Error \ No newline at end of file diff --git a/tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts b/tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts new file mode 100644 index 00000000000..dcea1cfe2ba --- /dev/null +++ b/tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts @@ -0,0 +1,26 @@ +// @target: es5 +// In the body of a get accessor with no return type annotation, +// if a matching set accessor exists and that set accessor has a parameter type annotation, +// return expressions are contextually typed by the type given in the set accessor's parameter type annotation. + +class C { + set X(x: number) { } + get X() { + return "string"; // Error; get contextual type by set accessor parameter type annotation + } + + set Y(y) { } + get Y() { + return true; + } + + set W(w) { } + get W(): boolean { + return true; + } + + set Z(z: number) { } + get Z() { + return 1; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts b/tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts index cb2fe8ee8d4..97c399211be 100644 --- a/tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts +++ b/tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts @@ -1,4 +1,7 @@ -// Tests related to #1774 +// In a contextually typed object literal, each property value expression is contextually typed by +// the type of the property with a matching name in the contextual type, if any, or otherwise +// for a numerically named property, the numeric index type of the contextual type, if any, or otherwise +// the string index type of the contextual type, if any. interface Item { name: string; diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts new file mode 100644 index 00000000000..2c26b10c6a1 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts @@ -0,0 +1,28 @@ +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// Note that the class's property must be copied to a local variable for +// the type guard to have an effect +class D { + data: string | string[]; + getData() { + var data = this.data; + return typeof data === "string" ? data : data.join(" "); + } + + getData1() { + return typeof this.data === "string" ? this.data : this.data.join(" "); + } +} + +var o: { + prop1: number|string; + prop2: boolean|string; +} = { + prop1: "string" , + prop2: true + } + +if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} +var prop1 = o.prop1; +if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts new file mode 100644 index 00000000000..fee92ff10ca --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts @@ -0,0 +1,186 @@ +interface AConstructor { + new (): A; +} +interface A { + foo: string; +} +declare var A: AConstructor; + +var obj1: A | string; +if (obj1 instanceof A) { // narrowed to A. + obj1.foo; + obj1.bar; +} + +var obj2: any; +if (obj2 instanceof A) { // can't narrow type from 'any' + obj2.foo; + obj2.bar; +} + +// a construct signature with generics +interface BConstructor { + new (): B; +} +interface B { + foo: T; +} +declare var B: BConstructor; + +var obj3: B | string; +if (obj3 instanceof B) { // narrowed to B. + obj3.foo = 1; + obj3.foo = "str"; + obj3.bar = "str"; +} + +var obj4: any; +if (obj4 instanceof B) { // can't narrow type from 'any' + obj4.foo = "str"; + obj4.foo = 1; + obj4.bar = "str"; +} + +// has multiple construct signature +interface CConstructor { + new (value: string): C1; + new (value: number): C2; +} +interface C1 { + foo: string; + bar1: number; +} +interface C2 { + foo: string; + bar2: number; +} +declare var C: CConstructor; + +var obj5: C1 | A; +if (obj5 instanceof C) { // narrowed to C1. + obj5.foo; + obj5.bar1; + obj5.bar2; +} + +var obj6: any; +if (obj6 instanceof C) { // can't narrow type from 'any' + obj6.foo; + obj6.bar1; + obj6.bar2; +} + +// with object type literal +interface D { + foo: string; +} +declare var D: { new (): D; }; + +var obj7: D | string; +if (obj7 instanceof D) { // narrowed to D. + obj7.foo; + obj7.bar; +} + +var obj8: any; +if (obj8 instanceof D) { // can't narrow type from 'any' + obj8.foo; + obj8.bar; +} + +// a construct signature that returns a union type +interface EConstructor { + new (): E1 | E2; +} +interface E1 { + foo: string; + bar1: number; +} +interface E2 { + foo: string; + bar2: number; +} +declare var E: EConstructor; + +var obj9: E1 | A; +if (obj9 instanceof E) { // narrowed to E1. + obj9.foo; + obj9.bar1; + obj9.bar2; +} + +var obj10: any; +if (obj10 instanceof E) { // can't narrow type from 'any' + obj10.foo; + obj10.bar1; + obj10.bar2; +} + +// a construct signature that returns any +interface FConstructor { + new (): any; +} +interface F { + foo: string; + bar: number; +} +declare var F: FConstructor; + +var obj11: F | string; +if (obj11 instanceof F) { // can't type narrowing, construct signature returns any. + obj11.foo; + obj11.bar; +} + +var obj12: any; +if (obj12 instanceof F) { // can't narrow type from 'any' + obj12.foo; + obj12.bar; +} + +// a type with a prototype, it overrides the construct signature +interface GConstructor { + prototype: G1; // high priority + new (): G2; // low priority +} +interface G1 { + foo1: number; +} +interface G2 { + foo2: boolean; +} +declare var G: GConstructor; + +var obj13: G1 | G2; +if (obj13 instanceof G) { // narrowed to G1. G1 is return type of prototype property. + obj13.foo1; + obj13.foo2; +} + +var obj14: any; +if (obj14 instanceof G) { // can't narrow type from 'any' + obj14.foo1; + obj14.foo2; +} + +// a type with a prototype that has any type +interface HConstructor { + prototype: any; // high priority, but any type is ignored. interface has implicit `prototype: any`. + new (): H; // low priority +} +interface H { + foo: number; +} +declare var H: HConstructor; + +var obj15: H | string; +if (obj15 instanceof H) { // narrowed to H. + obj15.foo; + obj15.bar; +} + +var obj16: any; +if (obj16 instanceof H) { // can't narrow type from 'any' + obj16.foo1; + obj16.foo2; +} diff --git a/tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts b/tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts new file mode 100644 index 00000000000..e3483aa27d3 --- /dev/null +++ b/tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts @@ -0,0 +1,9 @@ +type typeAlias1 = typeof varOfAliasedType1; +var varOfAliasedType1: typeAlias1; + +var varOfAliasedType2: typeAlias2; +type typeAlias2 = typeof varOfAliasedType2; + +function func(): typeAlias3 { return null; } +var varOfAliasedType3 = func(); +type typeAlias3 = typeof varOfAliasedType3; diff --git a/tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts b/tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts index 7852f99dd9b..b39d9dd53a8 100644 --- a/tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts +++ b/tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts @@ -1,5 +1,4 @@ -// None of these declarations should have any errors! -// Using typeof directly, these should be any +// The following are errors because of circular references var c: typeof c; var c: any; var d: typeof e; @@ -7,7 +6,6 @@ var d: any; var e: typeof d; var e: any; -// In type arguments, these should be any interface Foo { } var f: Array; var f: any; @@ -16,6 +14,7 @@ var f2: any; var f3: Foo[]; var f3: any; +// None of these declarations should have any errors! // Truly recursive types var g: { x: typeof g; }; var g: typeof g.x; @@ -48,6 +47,6 @@ var hy2 = hy2.x[0]; interface Foo2 { } -// This one should be any because the first type argument is not contained inside a type literal +// This one should be an error because the first type argument is not contained inside a type literal var hy3: Foo2; var hy3: any; \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts b/tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts new file mode 100644 index 00000000000..e7cca719f4b --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts @@ -0,0 +1,17 @@ +var v0: T0; +type T0 = string | I0; +class I0 { + x: T0; +} + +var v3: T3; +type T3 = string | I3; +class I3 { + [x: number]: T3; +} + +var v4: T4; +type T4 = string | I4; +class I4 { + [x: string]: T4; +} diff --git a/tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts b/tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts new file mode 100644 index 00000000000..c3eab454384 --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts @@ -0,0 +1,29 @@ +var v0: T0; +type T0 = string | I0; +interface I0 { + x: T0; +} + +var v1: T1; +type T1 = string | I1; +interface I1 { + (): T1; +} + +var v2: T2; +type T2 = string | I2; +interface I2 { + new (): T2; +} + +var v3: T3; +type T3 = string | I3; +interface I3 { + [x: number]: T3; +} + +var v4: T4; +type T4 = string | I4; +interface I4 { + [x: string]: T4; +} diff --git a/tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts b/tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts new file mode 100644 index 00000000000..531ffe96e83 --- /dev/null +++ b/tests/cases/conformance/types/union/unionTypePropertyAccessibility.ts @@ -0,0 +1,47 @@ +class Default { + member: string; +} + +class Public { + public member: string; +} + +class Protected { + protected member: string; +} + +class Private { + private member: number; +} + +var v1: Default; +var v2: Public; +var v3: Protected; +var v4: Private; +var v5: Default | Public; +var v6: Default | Protected; +var v7: Default | Private; +var v8: Public | Protected; +var v9: Public | Private; +var v10: Protected | Private; +var v11: Default | Public | Protected; +var v12: Default | Public | Private; +var v13: Default | Protected | Private; +var v14: Public | Private | Protected; +var v15: Default | Public | Private | Protected; + +v1.member; +v2.member; +v3.member; +v4.member; +v5.member; +v6.member; +v7.member; +v8.member; +v9.member; +v10.member; +v11.member; +v12.member; +v13.member; +v14.member; +v15.member; diff --git a/tests/cases/fourslash/addMemberToInterface.ts b/tests/cases/fourslash/addMemberToInterface.ts index ab0f99e4683..a420cab7fa2 100644 --- a/tests/cases/fourslash/addMemberToInterface.ts +++ b/tests/cases/fourslash/addMemberToInterface.ts @@ -1,7 +1,7 @@ /// //// -//// module /*check*/Mod{ +//// namespace /*check*/Mod{ //// } //// //// interface MyInterface { @@ -11,10 +11,10 @@ edit.disableFormatting(); goTo.marker('check'); -verify.quickInfoIs('module Mod'); +verify.quickInfoIs('namespace Mod'); goTo.marker('insert'); edit.insert("x: number;\n"); goTo.marker('check'); -verify.quickInfoIs('module Mod'); +verify.quickInfoIs('namespace Mod'); diff --git a/tests/cases/fourslash/augmentedTypesClass3.ts b/tests/cases/fourslash/augmentedTypesClass3.ts index e26fe744624..47c941e0787 100644 --- a/tests/cases/fourslash/augmentedTypesClass3.ts +++ b/tests/cases/fourslash/augmentedTypesClass3.ts @@ -1,14 +1,14 @@ /// ////class c/*1*/5b { public foo() { } } -////module c/*2*/5b { export var y = 2; } // should be ok +////namespace c/*2*/5b { export var y = 2; } // should be ok /////*3*/ goTo.marker('1'); -verify.quickInfoIs("class c5b\nmodule c5b"); +verify.quickInfoIs("class c5b\nnamespace c5b"); goTo.marker('2'); -verify.quickInfoIs("class c5b\nmodule c5b"); +verify.quickInfoIs("class c5b\nnamespace c5b"); goTo.marker('3'); -verify.completionListContains("c5b", "class c5b\nmodule c5b"); \ No newline at end of file +verify.completionListContains("c5b", "class c5b\nnamespace c5b"); \ No newline at end of file diff --git a/tests/cases/fourslash/augmentedTypesModule2.ts b/tests/cases/fourslash/augmentedTypesModule2.ts index 844bee7642a..1868ec45dfc 100644 --- a/tests/cases/fourslash/augmentedTypesModule2.ts +++ b/tests/cases/fourslash/augmentedTypesModule2.ts @@ -1,12 +1,12 @@ /// ////function /*11*/m2f(x: number) { }; -////module m2f { export interface I { foo(): void } } +////namespace m2f { export interface I { foo(): void } } ////var x: m2f./*1*/ ////var /*2*/r = m2f/*3*/; goTo.marker('11'); -verify.quickInfoIs('function m2f(x: number): void\nmodule m2f'); +verify.quickInfoIs('function m2f(x: number): void\nnamespace m2f'); goTo.marker('1'); verify.completionListContains('I'); diff --git a/tests/cases/fourslash/commentsExternalModules.ts b/tests/cases/fourslash/commentsExternalModules.ts index 1b000b854b1..088a60d9119 100644 --- a/tests/cases/fourslash/commentsExternalModules.ts +++ b/tests/cases/fourslash/commentsExternalModules.ts @@ -1,8 +1,8 @@ /// // @Filename: commentsExternalModules_file0.ts -/////** Module comment*/ -////export module m/*1*/1 { +/////** Namespace comment*/ +////export namespace m/*1*/1 { //// /** b's comment*/ //// export var b: number; //// /** foo's comment*/ @@ -10,7 +10,7 @@ //// return /*2*/b; //// } //// /** m2 comments*/ -//// export module m2 { +//// export namespace m2 { //// /** class comment;*/ //// export class c { //// }; @@ -36,7 +36,7 @@ edit.insert(''); goTo.file("commentsExternalModules_file0.ts"); goTo.marker('1'); -verify.quickInfoIs("module m1", "Module comment"); +verify.quickInfoIs("namespace m1", "Namespace comment"); goTo.marker('2'); verify.completionListContains("b", "var m1.b: number", "b's comment"); @@ -48,12 +48,12 @@ goTo.marker('3q'); verify.quickInfoIs("function foo(): number", "foo's comment"); goTo.marker('4'); -verify.completionListContains("m1", "module m1", "Module comment"); +verify.completionListContains("m1", "namespace m1", "Namespace comment"); goTo.marker('5'); verify.memberListContains("b", "var m1.b: number", "b's comment"); verify.memberListContains("fooExport", "function m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "module m1.m2"); +verify.memberListContains("m2", "namespace m1.m2"); goTo.marker('6'); verify.currentSignatureHelpDocCommentIs("exported function"); @@ -75,12 +75,12 @@ goTo.marker('10'); verify.completionListContains("extMod", 'import extMod = require("commentsExternalModules_file0")', "This is on import declaration"); goTo.marker('11'); -verify.memberListContains("m1", "module extMod.m1"); +verify.memberListContains("m1", "namespace extMod.m1"); goTo.marker('12'); verify.memberListContains("b", "var extMod.m1.b: number", "b's comment"); verify.memberListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "module extMod.m1.m2"); +verify.memberListContains("m2", "namespace extMod.m1.m2"); goTo.marker('13'); verify.currentSignatureHelpDocCommentIs("exported function"); diff --git a/tests/cases/fourslash/commentsImportDeclaration.ts b/tests/cases/fourslash/commentsImportDeclaration.ts index d5c6a7fa537..35c6d45330d 100644 --- a/tests/cases/fourslash/commentsImportDeclaration.ts +++ b/tests/cases/fourslash/commentsImportDeclaration.ts @@ -1,12 +1,12 @@ /// // @Filename: commentsImportDeclaration_file0.ts -/////** ModuleComment*/ -////export module m/*2*/1 { +/////** NamespaceComment*/ +////export namespace m/*2*/1 { //// /** b's comment*/ //// export var b: number; //// /** m2 comments*/ -//// export module m2 { +//// export namespace m2 { //// /** class comment;*/ //// export class c { //// }; @@ -25,18 +25,18 @@ ////var new/*9*/Var = new extMod.m1.m2./*10*/c(); goTo.marker('2'); -verify.quickInfoIs("module m1", "ModuleComment"); +verify.quickInfoIs("namespace m1", "NamespaceComment"); goTo.marker('3'); verify.quickInfoIs('import extMod = require("commentsImportDeclaration_file0")', "Import declaration"); goTo.marker('6'); -verify.memberListContains("m1", "module extMod.m1"); +verify.memberListContains("m1", "namespace extMod.m1"); goTo.marker('7'); verify.memberListContains("b", "var extMod.m1.b: number", "b's comment"); verify.memberListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "module extMod.m1.m2"); +verify.memberListContains("m2", "namespace extMod.m1.m2"); goTo.marker('8'); verify.currentSignatureHelpDocCommentIs("exported function"); diff --git a/tests/cases/fourslash/commentsModules.ts b/tests/cases/fourslash/commentsModules.ts index 4954359fedf..9415c1bc85e 100644 --- a/tests/cases/fourslash/commentsModules.ts +++ b/tests/cases/fourslash/commentsModules.ts @@ -1,7 +1,7 @@ /// -/////** Module comment*/ -////module m/*1*/1 { +/////** Namespace comment*/ +////namespace m/*1*/1 { //// /** b's comment*/ //// export var b: number; //// /** foo's comment*/ @@ -9,7 +9,7 @@ //// return /*2*/b; //// } //// /** m2 comments*/ -//// export module m2 { +//// export namespace m2 { //// /** class comment;*/ //// export class c { //// }; @@ -23,50 +23,50 @@ ////} /////*4*/m1./*5*/fooExport(/*6*/); ////var my/*7*/var = new m1.m2./*8*/c(); -/////** module comment of m2.m3*/ -////module m2.m3 { +/////** namespace comment of m2.m3*/ +////namespace m2.m3 { //// /** Exported class comment*/ //// export class c { //// } ////} ////new /*9*/m2./*10*/m3./*11*/c(); -/////** module comment of m3.m4.m5*/ -////module m3.m4.m5 { +/////** namespace comment of m3.m4.m5*/ +////namespace m3.m4.m5 { //// /** Exported class comment*/ //// export class c { //// } ////} ////new /*12*/m3./*13*/m4./*14*/m5./*15*/c(); -/////** module comment of m4.m5.m6*/ -////module m4.m5.m6 { -//// export module m7 { +/////** namespace comment of m4.m5.m6*/ +////namespace m4.m5.m6 { +//// export namespace m7 { //// /** Exported class comment*/ //// export class c { //// } //// } ////} ////new /*16*/m4./*17*/m5./*18*/m6./*19*/m7./*20*/c(); -/////** module comment of m5.m6.m7*/ -////module m5.m6.m7 { -//// /** module m8 comment*/ -//// export module m8 { +/////** namespace comment of m5.m6.m7*/ +////namespace m5.m6.m7 { +//// /** namespace m8 comment*/ +//// export namespace m8 { //// /** Exported class comment*/ //// export class c { //// } //// } ////} ////new /*21*/m5./*22*/m6./*23*/m7./*24*/m8./*25*/c(); -////module m6.m7 { -//// export module m8 { +////namespace m6.m7 { +//// export namespace m8 { //// /** Exported class comment*/ //// export class c { //// } //// } ////} ////new /*26*/m6./*27*/m7./*28*/m8./*29*/c(); -////module m7.m8 { -//// /** module m9 comment*/ -//// export module m9 { +////namespace m7.m8 { +//// /** namespace m9 comment*/ +//// export namespace m9 { //// /** Exported class comment*/ //// export class c { //// } @@ -78,15 +78,15 @@ //// } //// export var b: /*34*/c; ////} -////module complexM { -//// export module m1 { +////namespace complexM { +//// export namespace m1 { //// export class c { //// public foo() { //// return 30; //// } //// } //// } -//// export module m2 { +//// export namespace m2 { //// export class c { //// public foo2() { //// return new complexM.m1.c(); @@ -97,7 +97,7 @@ ////var myComp/*35*/lexVal = new compl/*36*/exM.m/*37*/2./*38*/c().f/*39*/oo2().f/*40*/oo(); goTo.marker('1'); -verify.quickInfoIs("module m1", "Module comment"); +verify.quickInfoIs("namespace m1", "Namespace comment"); goTo.marker('2'); verify.completionListContains("b", "var m1.b: number", "b's comment"); @@ -109,12 +109,12 @@ goTo.marker('3q'); verify.quickInfoIs("function foo(): number", "foo's comment"); goTo.marker('4'); -verify.completionListContains("m1", "module m1", "Module comment"); +verify.completionListContains("m1", "namespace m1", "Namespace comment"); goTo.marker('5'); verify.memberListContains("b", "var m1.b: number", "b's comment"); verify.memberListContains("fooExport", "function m1.fooExport(): number", "exported function"); -verify.memberListContains("m2", "module m1.m2"); +verify.memberListContains("m2", "namespace m1.m2"); verify.quickInfoIs("function m1.fooExport(): number", "exported function"); goTo.marker('6'); @@ -129,100 +129,100 @@ verify.memberListContains("c", "constructor m1.m2.c(): m1.m2.c", ""); verify.memberListContains("i", "var m1.m2.i: m1.m2.c", "i"); goTo.marker('9'); -verify.completionListContains("m2", "module m2", ""); -verify.quickInfoIs("module m2", ""); +verify.completionListContains("m2", "namespace m2", ""); +verify.quickInfoIs("namespace m2", ""); goTo.marker('10'); -verify.memberListContains("m3", "module m2.m3"); -verify.quickInfoIs("module m2.m3", "module comment of m2.m3"); +verify.memberListContains("m3", "namespace m2.m3"); +verify.quickInfoIs("namespace m2.m3", "namespace comment of m2.m3"); goTo.marker('11'); verify.quickInfoIs("constructor m2.m3.c(): m2.m3.c", ""); verify.memberListContains("c", "constructor m2.m3.c(): m2.m3.c", ""); goTo.marker('12'); -verify.completionListContains("m3", "module m3", ""); -verify.quickInfoIs("module m3", ""); +verify.completionListContains("m3", "namespace m3", ""); +verify.quickInfoIs("namespace m3", ""); goTo.marker('13'); -verify.memberListContains("m4", "module m3.m4", ""); -verify.quickInfoIs("module m3.m4", ""); +verify.memberListContains("m4", "namespace m3.m4", ""); +verify.quickInfoIs("namespace m3.m4", ""); goTo.marker('14'); -verify.memberListContains("m5", "module m3.m4.m5"); -verify.quickInfoIs("module m3.m4.m5", "module comment of m3.m4.m5"); +verify.memberListContains("m5", "namespace m3.m4.m5"); +verify.quickInfoIs("namespace m3.m4.m5", "namespace comment of m3.m4.m5"); goTo.marker('15'); verify.quickInfoIs("constructor m3.m4.m5.c(): m3.m4.m5.c", ""); verify.memberListContains("c", "constructor m3.m4.m5.c(): m3.m4.m5.c", ""); goTo.marker('16'); -verify.completionListContains("m4", "module m4", ""); -verify.quickInfoIs("module m4", ""); +verify.completionListContains("m4", "namespace m4", ""); +verify.quickInfoIs("namespace m4", ""); goTo.marker('17'); -verify.memberListContains("m5", "module m4.m5", ""); -verify.quickInfoIs("module m4.m5", ""); +verify.memberListContains("m5", "namespace m4.m5", ""); +verify.quickInfoIs("namespace m4.m5", ""); goTo.marker('18'); -verify.memberListContains("m6", "module m4.m5.m6"); -verify.quickInfoIs("module m4.m5.m6", "module comment of m4.m5.m6"); +verify.memberListContains("m6", "namespace m4.m5.m6"); +verify.quickInfoIs("namespace m4.m5.m6", "namespace comment of m4.m5.m6"); goTo.marker('19'); -verify.memberListContains("m7", "module m4.m5.m6.m7"); -verify.quickInfoIs("module m4.m5.m6.m7", ""); +verify.memberListContains("m7", "namespace m4.m5.m6.m7"); +verify.quickInfoIs("namespace m4.m5.m6.m7", ""); goTo.marker('20'); verify.memberListContains("c", "constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); verify.quickInfoIs("constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); goTo.marker('21'); -verify.completionListContains("m5", "module m5"); -verify.quickInfoIs("module m5", ""); +verify.completionListContains("m5", "namespace m5"); +verify.quickInfoIs("namespace m5", ""); goTo.marker('22'); -verify.memberListContains("m6", "module m5.m6"); -verify.quickInfoIs("module m5.m6", ""); +verify.memberListContains("m6", "namespace m5.m6"); +verify.quickInfoIs("namespace m5.m6", ""); goTo.marker('23'); -verify.memberListContains("m7", "module m5.m6.m7"); -verify.quickInfoIs("module m5.m6.m7", "module comment of m5.m6.m7"); +verify.memberListContains("m7", "namespace m5.m6.m7"); +verify.quickInfoIs("namespace m5.m6.m7", "namespace comment of m5.m6.m7"); goTo.marker('24'); -verify.memberListContains("m8", "module m5.m6.m7.m8"); -verify.quickInfoIs("module m5.m6.m7.m8", "module m8 comment"); +verify.memberListContains("m8", "namespace m5.m6.m7.m8"); +verify.quickInfoIs("namespace m5.m6.m7.m8", "namespace m8 comment"); goTo.marker('25'); verify.memberListContains("c", "constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); verify.quickInfoIs("constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); goTo.marker('26'); -verify.completionListContains("m6", "module m6"); -verify.quickInfoIs("module m6", ""); +verify.completionListContains("m6", "namespace m6"); +verify.quickInfoIs("namespace m6", ""); goTo.marker('27'); -verify.memberListContains("m7", "module m6.m7"); -verify.quickInfoIs("module m6.m7", ""); +verify.memberListContains("m7", "namespace m6.m7"); +verify.quickInfoIs("namespace m6.m7", ""); goTo.marker('28'); -verify.memberListContains("m8", "module m6.m7.m8"); -verify.quickInfoIs("module m6.m7.m8", ""); +verify.memberListContains("m8", "namespace m6.m7.m8"); +verify.quickInfoIs("namespace m6.m7.m8", ""); goTo.marker('29'); verify.memberListContains("c", "constructor m6.m7.m8.c(): m6.m7.m8.c", ""); verify.quickInfoIs("constructor m6.m7.m8.c(): m6.m7.m8.c", ""); goTo.marker('30'); -verify.completionListContains("m7", "module m7"); -verify.quickInfoIs("module m7", ""); +verify.completionListContains("m7", "namespace m7"); +verify.quickInfoIs("namespace m7", ""); goTo.marker('31'); -verify.memberListContains("m8", "module m7.m8"); -verify.quickInfoIs("module m7.m8", ""); +verify.memberListContains("m8", "namespace m7.m8"); +verify.quickInfoIs("namespace m7.m8", ""); goTo.marker('32'); -verify.memberListContains("m9", "module m7.m8.m9"); -verify.quickInfoIs("module m7.m8.m9", "module m9 comment"); +verify.memberListContains("m9", "namespace m7.m8.m9"); +verify.quickInfoIs("namespace m7.m8.m9", "namespace m9 comment"); goTo.marker('33'); verify.memberListContains("c", "constructor m7.m8.m9.c(): m7.m8.m9.c", ""); @@ -236,10 +236,10 @@ goTo.marker('35'); verify.quickInfoIs("var myComplexVal: number", ""); goTo.marker('36'); -verify.quickInfoIs("module complexM", ""); +verify.quickInfoIs("namespace complexM", ""); goTo.marker('37'); -verify.quickInfoIs("module complexM.m2", ""); +verify.quickInfoIs("namespace complexM.m2", ""); goTo.marker('38'); verify.quickInfoIs("constructor complexM.m2.c(): complexM.m2.c", ""); diff --git a/tests/cases/fourslash/commentsMultiModuleMultiFile.ts b/tests/cases/fourslash/commentsMultiModuleMultiFile.ts index 9cbe47dd560..40d7b6d9bc4 100644 --- a/tests/cases/fourslash/commentsMultiModuleMultiFile.ts +++ b/tests/cases/fourslash/commentsMultiModuleMultiFile.ts @@ -1,14 +1,14 @@ /// // @Filename: commentsMultiModuleMultiFile_0.ts -/////** this is multi declare module*/ -////module mult/*3*/iM { +/////** this is multi declare namespace*/ +////namespace mult/*3*/iM { //// /** class b*/ //// export class b { //// } ////} -/////** thi is multi module 2*/ -////module mu/*2*/ltiM { +/////** thi is multi namespace 2*/ +////namespace mu/*2*/ltiM { //// /** class c comment*/ //// export class c { //// } @@ -18,8 +18,8 @@ ////new mu/*5*/ltiM.c(); // @Filename: commentsMultiModuleMultiFile_1.ts -/////** this is multi module 3 comment*/ -////module mu/*6*/ltiM { +/////** this is multi namespace 3 comment*/ +////namespace mu/*6*/ltiM { //// /** class d comment*/ //// export class d { //// } @@ -30,25 +30,25 @@ edit.insert(''); debugger; goTo.marker('1'); -verify.completionListContains("multiM", "module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.completionListContains("multiM", "namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('2'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('3'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('4'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('5'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('6'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('7'); -verify.completionListContains("multiM", "module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); +verify.completionListContains("multiM", "namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); goTo.marker('8'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2\nthis is multi module 3 comment"); \ No newline at end of file +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2\nthis is multi namespace 3 comment"); \ No newline at end of file diff --git a/tests/cases/fourslash/commentsMultiModuleSingleFile.ts b/tests/cases/fourslash/commentsMultiModuleSingleFile.ts index 29102e7eefb..c2bd677ce9a 100644 --- a/tests/cases/fourslash/commentsMultiModuleSingleFile.ts +++ b/tests/cases/fourslash/commentsMultiModuleSingleFile.ts @@ -1,13 +1,13 @@ /// -/////** this is multi declare module*/ -////module mult/*3*/iM { +/////** this is multi declare namespace*/ +////namespace mult/*3*/iM { //// /** class b*/ //// export class b { //// } ////} -/////** thi is multi module 2*/ -////module mu/*2*/ltiM { +/////** thi is multi namespace 2*/ +////namespace mu/*2*/ltiM { //// /** class c comment*/ //// export class c { //// } @@ -20,16 +20,16 @@ edit.insert(''); goTo.marker('1'); -verify.completionListContains("multiM", "module multiM", "this is multi declare module\nthi is multi module 2"); +verify.completionListContains("multiM", "namespace multiM", "this is multi declare namespace\nthi is multi namespace 2"); goTo.marker('2'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2"); goTo.marker('3'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2"); goTo.marker('4'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2"); +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2"); goTo.marker('5'); -verify.quickInfoIs("module multiM", "this is multi declare module\nthi is multi module 2"); \ No newline at end of file +verify.quickInfoIs("namespace multiM", "this is multi declare namespace\nthi is multi namespace 2"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListWithModulesFromModule.ts b/tests/cases/fourslash/completionListWithModulesFromModule.ts index 3db8cc0490c..3a1f3daa29e 100644 --- a/tests/cases/fourslash/completionListWithModulesFromModule.ts +++ b/tests/cases/fourslash/completionListWithModulesFromModule.ts @@ -1,6 +1,6 @@ /// -////module mod1 { +////namespace mod1 { //// var mod1var = 1; //// function mod1fn() { //// var bar = 1; @@ -19,7 +19,7 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module mod1mod { +//// namespace mod1mod { //// var m1X = 1; //// function m1Func() { //// var bar = 1; @@ -56,8 +56,8 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module m1Mod { } -//// export module m1eMod { } +//// namespace m1Mod { } +//// export namespace m1eMod { } //// } //// export var mod1evar = 1; //// export function mod1efn() { @@ -78,7 +78,7 @@ //// bar: any; //// foob(bar: any): any; //// } -//// export module mod1emod { +//// export namespace mod1emod { //// var mX = 1; //// function mFunc() { //// var bar = 1; @@ -114,18 +114,18 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module mMod { } -//// export module meMod { } +//// namespace mMod { } +//// export namespace meMod { } //// } ////} //// -////// EXTENDING MODULE 1 -////module mod1 { +////// EXTENDING NAMESPACE 1 +////namespace mod1 { //// export var mod1eexvar = 1; //// var mod1exvar = 2; ////} //// -////module mod2 { +////namespace mod2 { //// var mod2var = "shadow"; //// function mod2fn() { //// var bar = 1; @@ -139,7 +139,7 @@ //// static csVar = 1; //// static csFunc() { } //// } -//// module mod2mod { } +//// namespace mod2mod { } //// interface mod2int { //// (bar: any): any; //// new (bar: any): any; @@ -162,14 +162,14 @@ //// bar: any; //// foob(bar: any): any; //// } -//// export module mod2emod { } +//// export namespace mod2emod { } ////} //// -////module mod2 { +////namespace mod2 { //// export var mod2eexvar = 1; ////} //// -////module mod3 { +////namespace mod3 { //// var shwvar = "shadow"; //// function shwfn(shadow: any) { //// var bar = 1; @@ -190,10 +190,10 @@ //// sivar: string; //// sifn(shadow: any): any; //// } -//// /*shadowModuleWithNoExport*/ +//// /*shadowNamespaceWithNoExport*/ ////} //// -////module mod4 { +////namespace mod4 { //// export var shwvar = "shadow"; //// export function shwfn(shadow: any) { //// var bar = 1; @@ -213,13 +213,13 @@ //// sivar: string; //// sifn(shadow: any): any; //// } -//// /*shadowModuleWithExport*/ +//// /*shadowNamespaceWithExport*/ ////} //// -////module mod5 { +////namespace mod5 { //// import Mod1 = mod1; //// import iMod1 = mod1.mod1emod; -//// /*moduleWithImport*/ +//// /*namespaceWithImport*/ ////} //// ////function shwfn() { @@ -276,27 +276,27 @@ function goToMarkAndVerifyShadow() verify.not.completionListContains('mod2emod'); } -// from a shadow module with no export -goTo.marker('shadowModuleWithNoExport'); +// from a shadow namespace with no export +goTo.marker('shadowNamespaceWithNoExport'); verify.completionListContains('shwvar', 'var shwvar: string'); verify.completionListContains('shwfn', 'function shwfn(shadow: any): void'); verify.completionListContains('shwcls', 'class shwcls'); verify.completionListContains('shwint', 'interface shwint'); goToMarkAndVerifyShadow(); -// from a shadow module with export -goTo.marker('shadowModuleWithExport'); +// from a shadow namespace with export +goTo.marker('shadowNamespaceWithExport'); verify.completionListContains('shwvar', 'var mod4.shwvar: string'); verify.completionListContains('shwfn', 'function mod4.shwfn(shadow: any): void'); verify.completionListContains('shwcls', 'class mod4.shwcls'); verify.completionListContains('shwint', 'interface mod4.shwint'); goToMarkAndVerifyShadow(); -// from a modlue with import -goTo.marker('moduleWithImport'); -verify.completionListContains('mod1', 'module mod1'); -verify.completionListContains('mod2', 'module mod2'); -verify.completionListContains('mod3', 'module mod3'); +// from a namespace with import +goTo.marker('namespaceWithImport'); +verify.completionListContains('mod1', 'namespace mod1'); +verify.completionListContains('mod2', 'namespace mod2'); +verify.completionListContains('mod3', 'namespace mod3'); verify.completionListContains('shwvar', 'var shwvar: number'); verify.completionListContains('shwfn', 'function shwfn(): void'); verify.completionListContains('shwcls', 'class shwcls'); diff --git a/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts b/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts index f7fdea277c7..51e4013e53a 100644 --- a/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts +++ b/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts @@ -1,6 +1,6 @@ /// -////module mod1 { +////namespace mod1 { //// var mod1var = 1; //// function mod1fn() { //// var bar = 1; @@ -22,7 +22,7 @@ //// foob(bar: any): any; //// /*interface*/ //// } -//// module mod1mod { +//// namespace mod1mod { //// var m1X = 1; //// function m1Func() { //// var bar = 1; @@ -59,9 +59,9 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module m1Mod { } -//// export module m1eMod { } -//// /*module*/ +//// namespace m1Mod { } +//// export namespace m1eMod { } +//// /*namespace*/ //// } //// export var mod1evar = 1; //// export function mod1efn() { @@ -85,7 +85,7 @@ //// foob(bar: any): any; //// /*exportedInterface*/ //// } -//// export module mod1emod { +//// export namespace mod1emod { //// var mX = 1; //// function mFunc() { //// var bar = 1; @@ -121,21 +121,21 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module mMod { } -//// export module meMod { } -//// /*exportedModule*/ +//// namespace mMod { } +//// export namespace meMod { } +//// /*exportedNamespace*/ //// } //// /*mod1*/ ////} //// -////// EXTENDING MODULE 1 -////module mod1 { +////// EXTENDING NAMESPACE 1 +////namespace mod1 { //// export var mod1eexvar = 1; //// var mod1exvar = 2; -//// /*extendedModule*/ +//// /*extendedNamespace*/ ////} //// -////module mod2 { +////namespace mod2 { //// var mod2var = "shadow"; //// function mod2fn() { //// var bar = 1; @@ -149,7 +149,7 @@ //// static csVar = 1; //// static csFunc() { } //// } -//// module mod2mod { } +//// namespace mod2mod { } //// interface mod2int { //// (bar: any): any; //// new (bar: any): any; @@ -172,14 +172,14 @@ //// bar: any; //// foob(bar: any): any; //// } -//// export module mod2emod { } +//// export namespace mod2emod { } ////} //// -////module mod2 { +////namespace mod2 { //// export var mod2eexvar = 1; ////} //// -////module mod3 { +////namespace mod3 { //// var shwvar = "shadow"; //// function shwfn() { //// var bar = 1; @@ -233,15 +233,15 @@ function goToMarkAndGeneralVerify(marker: string) verify.completionListContains('mod1fn', 'function mod1fn(): void'); verify.completionListContains('mod1cls', 'class mod1cls'); verify.completionListContains('mod1int', 'interface mod1int'); - verify.completionListContains('mod1mod', 'module mod1mod'); + verify.completionListContains('mod1mod', 'namespace mod1mod'); verify.completionListContains('mod1evar', 'var mod1.mod1evar: number'); verify.completionListContains('mod1efn', 'function mod1.mod1efn(): void'); verify.completionListContains('mod1ecls', 'class mod1.mod1ecls'); verify.completionListContains('mod1eint', 'interface mod1.mod1eint'); - verify.completionListContains('mod1emod', 'module mod1.mod1emod'); + verify.completionListContains('mod1emod', 'namespace mod1.mod1emod'); verify.completionListContains('mod1eexvar', 'var mod1.mod1eexvar: number'); - verify.completionListContains('mod2', 'module mod2'); - verify.completionListContains('mod3', 'module mod3'); + verify.completionListContains('mod2', 'namespace mod2'); + verify.completionListContains('mod3', 'namespace mod3'); verify.completionListContains('shwvar', 'var shwvar: number'); verify.completionListContains('shwfn', 'function shwfn(): void'); verify.completionListContains('shwcls', 'class shwcls'); @@ -287,18 +287,18 @@ goToMarkAndGeneralVerify('class'); // from interface in mod1 goToMarkAndGeneralVerify('interface'); -// from module in mod1 -goToMarkAndGeneralVerify('module'); +// from namespace in mod1 +goToMarkAndGeneralVerify('namespace'); verify.completionListContains('m1X', 'var m1X: number'); verify.completionListContains('m1Func', 'function m1Func(): void'); verify.completionListContains('m1Class', 'class m1Class'); verify.completionListContains('m1Int', 'interface m1Int'); -verify.completionListContains('m1Mod', 'module m1Mod'); +verify.completionListContains('m1Mod', 'namespace m1Mod'); verify.completionListContains('m1eX', 'var mod1mod.m1eX: number'); verify.completionListContains('m1eFunc', 'function mod1mod.m1eFunc(): void'); verify.completionListContains('m1eClass', 'class mod1mod.m1eClass'); verify.completionListContains('m1eInt', 'interface mod1mod.m1eInt'); -verify.completionListContains('m1eMod', 'module mod1mod.m1eMod'); +verify.completionListContains('m1eMod', 'namespace mod1mod.m1eMod'); // from exported function in mod1 goToMarkAndGeneralVerify('exportedFunction'); @@ -313,29 +313,29 @@ goToMarkAndGeneralVerify('exportedClass'); // from exported interface in mod1 goToMarkAndGeneralVerify('exportedInterface'); -// from exported module in mod1 -goToMarkAndGeneralVerify('exportedModule'); +// from exported namespace in mod1 +goToMarkAndGeneralVerify('exportedNamespace'); verify.completionListContains('mX', 'var mX: number'); verify.completionListContains('mFunc', 'function mFunc(): void'); verify.completionListContains('mClass', 'class mClass'); verify.completionListContains('mInt', 'interface mInt'); -verify.completionListContains('mMod', 'module mMod'); +verify.completionListContains('mMod', 'namespace mMod'); verify.completionListContains('meX', 'var mod1.mod1emod.meX: number'); verify.completionListContains('meFunc', 'function mod1.mod1emod.meFunc(): void'); verify.completionListContains('meClass', 'class mod1.mod1emod.meClass'); verify.completionListContains('meInt', 'interface mod1.mod1emod.meInt'); -verify.completionListContains('meMod', 'module mod1.mod1emod.meMod'); +verify.completionListContains('meMod', 'namespace mod1.mod1emod.meMod'); -// from extended module -goTo.marker('extendedModule'); +// from extended namespace +goTo.marker('extendedNamespace'); verify.completionListContains('mod1evar', 'var mod1.mod1evar: number'); verify.completionListContains('mod1efn', 'function mod1.mod1efn(): void'); verify.completionListContains('mod1ecls', 'class mod1.mod1ecls'); verify.completionListContains('mod1eint', 'interface mod1.mod1eint'); -verify.completionListContains('mod1emod', 'module mod1.mod1emod'); +verify.completionListContains('mod1emod', 'namespace mod1.mod1emod'); verify.completionListContains('mod1eexvar', 'var mod1.mod1eexvar: number'); -verify.completionListContains('mod2', 'module mod2'); -verify.completionListContains('mod3', 'module mod3'); +verify.completionListContains('mod2', 'namespace mod2'); +verify.completionListContains('mod3', 'namespace mod3'); verify.completionListContains('shwvar', 'var shwvar: number'); verify.completionListContains('shwfn', 'function shwfn(): void'); verify.completionListContains('shwcls', 'class shwcls'); diff --git a/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts index 03ba952fde7..d6c44f4b7eb 100644 --- a/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts +++ b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts @@ -1,6 +1,6 @@ /// -////module mod1 { +////namespace mod1 { //// var mod1var = 1; //// function mod1fn() { //// var bar = 1; @@ -19,7 +19,7 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module mod1mod { +//// namespace mod1mod { //// var m1X = 1; //// function m1Func() { //// var bar = 1; @@ -56,8 +56,8 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module m1Mod { } -//// export module m1eMod { } +//// namespace m1Mod { } +//// export namespace m1eMod { } //// } //// export var mod1evar = 1; //// export function mod1efn() { @@ -78,7 +78,7 @@ //// bar: any; //// foob(bar: any): any; //// } -//// export module mod1emod { +//// export namespace mod1emod { //// var mX = 1; //// function mFunc() { //// var bar = 1; @@ -114,18 +114,18 @@ //// bar: any; //// foob(bar: any): any; //// } -//// module mMod { } -//// export module meMod { } +//// namespace mMod { } +//// export namespace meMod { } //// } ////} //// -////// EXTENDING MODULE 1 -////module mod1 { +////// EXTENDING NAMESPACE 1 +////namespace mod1 { //// export var mod1eexvar = 1; //// var mod1exvar = 2; ////} //// -////module mod2 { +////namespace mod2 { //// var mod2var = "shadow"; //// function mod2fn() { //// var bar = 1; @@ -139,7 +139,7 @@ //// static csVar = 1; //// static csFunc() { } //// } -//// module mod2mod { } +//// namespace mod2mod { } //// interface mod2int { //// (bar: any): any; //// new (bar: any): any; @@ -162,14 +162,14 @@ //// bar: any; //// foob(bar: any): any; //// } -//// export module mod2emod { } +//// export namespace mod2emod { } ////} //// -////module mod2 { +////namespace mod2 { //// export var mod2eexvar = 1; ////} //// -////module mod3 { +////namespace mod3 { //// var shwvar = "shadow"; //// function shwfn() { //// var bar = 1; @@ -260,9 +260,9 @@ function goToMarkAndGeneralVerify(marker: string) // from global scope goToMarkAndGeneralVerify('global'); -verify.completionListContains('mod1', 'module mod1'); -verify.completionListContains('mod2', 'module mod2'); -verify.completionListContains('mod3', 'module mod3'); +verify.completionListContains('mod1', 'namespace mod1'); +verify.completionListContains('mod2', 'namespace mod2'); +verify.completionListContains('mod3', 'namespace mod3'); verify.completionListContains('shwvar', 'var shwvar: number'); verify.completionListContains('shwfn', 'function shwfn(): void'); verify.completionListContains('shwcls', 'class shwcls'); diff --git a/tests/cases/fourslash/formattingEqualsBeforeBracketInTypeAlias.ts b/tests/cases/fourslash/formattingEqualsBeforeBracketInTypeAlias.ts new file mode 100644 index 00000000000..043ff2247a9 --- /dev/null +++ b/tests/cases/fourslash/formattingEqualsBeforeBracketInTypeAlias.ts @@ -0,0 +1,6 @@ +/// + +////type X = [number]/*1*/ +goTo.marker("1"); +edit.insert(";"); +verify.currentLineContentIs("type X = [number];"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnChainedCallbacks.ts b/tests/cases/fourslash/formattingOnChainedCallbacks.ts index 0d72364d506..37fa6ff03f1 100644 --- a/tests/cases/fourslash/formattingOnChainedCallbacks.ts +++ b/tests/cases/fourslash/formattingOnChainedCallbacks.ts @@ -4,7 +4,7 @@ //// .resolve() //// .then(() => {/*1*/""/*2*/ ////}).then(() => {/*3*//*4*/ -////})/*semi1*/ /*semi2*/ +////})/*semi1*//*semi2*/ ////function foo() { //// return Promise.resolve() @@ -16,8 +16,7 @@ goTo.marker('1'); edit.insertLine(''); goTo.marker('2'); -// Expected, with bug 1888: verify.currentLineContentIs(' ""'); -verify.currentLineContentIs(' ""'); +verify.currentLineContentIs(' ""'); goTo.marker('4'); edit.insertLine(''); goTo.marker('3'); @@ -25,8 +24,7 @@ verify.currentLineContentIs(' }).then(() => {'); goTo.marker("semi1"); edit.insert(';'); -// Expected, with bug 1888: verify.currentLineContentIs(' });'); -verify.currentLineContentIs('}); '); +verify.currentLineContentIs(' });'); goTo.marker("semi2"); edit.insert(';'); verify.currentLineContentIs(' });;'); @@ -36,5 +34,4 @@ edit.insert(';'); verify.currentLineContentIs(' "";'); goTo.marker('b'); edit.insert(';'); -// Expected, with bug 1888: verify.currentLineContentIs(' });'); -verify.currentLineContentIs(' });'); \ No newline at end of file +verify.currentLineContentIs(' });'); \ No newline at end of file diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 867f7b16641..9c6fd814d9f 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -119,6 +119,10 @@ module FourSlashInterface { FourSlash.currentTestState.goToDefinition(definitionIndex); } + public type(definitionIndex: number = 0) { + FourSlash.currentTestState.goToTypeDefinition(definitionIndex); + } + public position(position: number, fileIndex?: number); public position(position: number, fileName?: string); public position(position: number, fileNameOrIndex?: any) { @@ -234,6 +238,10 @@ module FourSlashInterface { FourSlash.currentTestState.verifyDefinitionsCount(this.negative, expectedCount); } + public typeDefinitionCountIs(expectedCount: number) { + FourSlash.currentTestState.verifyTypeDefinitionsCount(this.negative, expectedCount); + } + public definitionLocationExists() { FourSlash.currentTestState.verifyDefinitionLocationExists(this.negative); } diff --git a/tests/cases/fourslash/goToTypeDefinition.ts b/tests/cases/fourslash/goToTypeDefinition.ts new file mode 100644 index 00000000000..6b34e7e4886 --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinition.ts @@ -0,0 +1,14 @@ +/// + +// @Filename: goToTypeDefinition_Definition.ts +/////*definition*/class C { +//// p; +////} +////var c: C; + +// @Filename: goToTypeDefinition_Consumption.ts +/////*reference*/c = undefined; + +goTo.marker('reference'); +goTo.type(); +verify.caretAtMarker('definition'); diff --git a/tests/cases/fourslash/goToTypeDefinition2.ts b/tests/cases/fourslash/goToTypeDefinition2.ts new file mode 100644 index 00000000000..8c76655f4a8 --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinition2.ts @@ -0,0 +1,18 @@ +/// + +// @Filename: goToTypeDefinition2_Definition.ts +/////*definition*/interface I1 { +//// p; +////} +////type propertyType = I1; +////interface I2 { +//// property: propertyType; +////} + +// @Filename: goToTypeDefinition2_Consumption.ts +////var i2: I2; +////i2.prop/*reference*/erty; + +goTo.marker('reference'); +goTo.type(); +verify.caretAtMarker('definition'); diff --git a/tests/cases/fourslash/goToTypeDefinitionAliases.ts b/tests/cases/fourslash/goToTypeDefinitionAliases.ts new file mode 100644 index 00000000000..19abc22ca30 --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinitionAliases.ts @@ -0,0 +1,24 @@ +/// + +// @Filename: goToTypeDefinitioAliases_module1.ts +/////*definition*/interface I { +//// p; +////} +////export {I as I2}; + +// @Filename: goToTypeDefinitioAliases_module2.ts +////import {I2 as I3} from "goToTypeDefinitioAliases_module1"; +////var v1: I3; +////export {v1 as v2}; + +// @Filename: goToTypeDefinitioAliases_module3.ts +////import {/*reference1*/v2 as v3} from "goToTypeDefinitioAliases_module2"; +/////*reference2*/v3; + +goTo.marker('reference1'); +goTo.type(); +verify.caretAtMarker('definition'); + +goTo.marker('reference2'); +goTo.type(); +verify.caretAtMarker('definition'); diff --git a/tests/cases/fourslash/goToTypeDefinitionEnumMembers.ts b/tests/cases/fourslash/goToTypeDefinitionEnumMembers.ts new file mode 100644 index 00000000000..4b5f151498c --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinitionEnumMembers.ts @@ -0,0 +1,13 @@ +/// + +/////*definition*/enum E { +//// value1, +//// value2 +////} +////var x = E.value2; +//// +/////*reference*/x; + +goTo.marker('reference'); +goTo.type(); +verify.caretAtMarker('definition'); diff --git a/tests/cases/fourslash/goToTypeDefinitionModule.ts b/tests/cases/fourslash/goToTypeDefinitionModule.ts new file mode 100644 index 00000000000..2afccab97c3 --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinitionModule.ts @@ -0,0 +1,19 @@ +/// + +// @Filename: goToTypeDefinitioAliases_module1.ts +/////*definition*/module M { +//// export var p; +////} +////var m: typeof M; + +// @Filename: goToTypeDefinitioAliases_module3.ts +/////*reference1*/M; +/////*reference2*/m; + +goTo.marker('reference1'); +goTo.type(); +verify.caretAtMarker('definition'); + +goTo.marker('reference2'); +goTo.type(); +verify.caretAtMarker('definition'); \ No newline at end of file diff --git a/tests/cases/fourslash/goToTypeDefinitionPrimitives.ts b/tests/cases/fourslash/goToTypeDefinitionPrimitives.ts new file mode 100644 index 00000000000..d38a0c16343 --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinitionPrimitives.ts @@ -0,0 +1,25 @@ +/// + +// @Filename: module1.ts +////var w: {a: number}; +////var x = "string"; +////var y: number | string; +////var z; // any + +// @Filename: module2.ts +////w./*reference1*/a; +/////*reference2*/x; +/////*reference3*/y; +/////*reference4*/y; + +goTo.marker('reference1'); +verify.typeDefinitionCountIs(0); + +goTo.marker('reference1'); +verify.typeDefinitionCountIs(0); + +goTo.marker('reference2'); +verify.typeDefinitionCountIs(0); + +goTo.marker('reference4'); +verify.typeDefinitionCountIs(0); diff --git a/tests/cases/fourslash/goToTypeDefinitionUnionType.ts b/tests/cases/fourslash/goToTypeDefinitionUnionType.ts new file mode 100644 index 00000000000..0630ae3ebb9 --- /dev/null +++ b/tests/cases/fourslash/goToTypeDefinitionUnionType.ts @@ -0,0 +1,31 @@ +/// + +/////*definition0*/class C { +//// p; +////} +//// +/////*definition1*/interface I { +//// x; +////} +//// +////module M { +//// /*definition2*/export interface I { +//// y; +//// } +////} +//// +////var x: C | I | M.I; +//// +/////*reference*/x; + +goTo.marker('reference'); +goTo.type(0); +verify.caretAtMarker('definition0'); + +goTo.marker('reference'); +goTo.type(1); +verify.caretAtMarker('definition1'); + +goTo.marker('reference'); +goTo.type(2); +verify.caretAtMarker('definition2'); diff --git a/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts b/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts index 2908e303855..d8b90a3c219 100644 --- a/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts +++ b/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts @@ -1,19 +1,19 @@ /// -////module mod1 { +////namespace mod1 { //// var mX = 1; //// function mFunc() { } //// class mClass { } -//// module mMod { } +//// namespace mMod { } //// interface mInt {} //// export var meX = 1; //// export function meFunc() { } //// export class meClass { } -//// export module meMod { export var iMex = 1; } +//// export namespace meMod { export var iMex = 1; } //// export interface meInt {} ////} //// -////module frmConfirm { +////namespace frmConfirm { //// import Mod1 = mod1; //// import iMod1 = mod1./*1*/meMod; //// Mod1./*2*/meX = 1; @@ -24,14 +24,14 @@ goTo.marker('1'); verify.completionListContains('meX', 'var mod1.meX: number'); verify.completionListContains('meFunc', 'function mod1.meFunc(): void'); verify.completionListContains('meClass', 'class mod1.meClass'); -verify.completionListContains('meMod', 'module mod1.meMod'); +verify.completionListContains('meMod', 'namespace mod1.meMod'); verify.completionListContains('meInt', 'interface mod1.meInt'); goTo.marker('2'); verify.completionListContains('meX', 'var mod1.meX: number'); verify.completionListContains('meFunc', 'function mod1.meFunc(): void'); verify.completionListContains('meClass', 'class mod1.meClass'); -verify.completionListContains('meMod', 'module mod1.meMod'); +verify.completionListContains('meMod', 'namespace mod1.meMod'); goTo.marker('3'); verify.completionListContains('iMex', 'var mod1.meMod.iMex: number'); diff --git a/tests/cases/fourslash/missingMethodAfterEditAfterImport.ts b/tests/cases/fourslash/missingMethodAfterEditAfterImport.ts index 442ea89f0a3..285f67639f8 100644 --- a/tests/cases/fourslash/missingMethodAfterEditAfterImport.ts +++ b/tests/cases/fourslash/missingMethodAfterEditAfterImport.ts @@ -1,7 +1,7 @@ /// -//// module foo { -//// export module bar { module baz { export class boo { } } } +//// namespace foo { +//// export namespace bar { namespace baz { export class boo { } } } //// } //// //// import f = /*foo*/foo; @@ -10,7 +10,7 @@ // Sanity check goTo.marker('foo'); -verify.quickInfoIs('module foo'); +verify.quickInfoIs('namespace foo'); // Delete some code goTo.marker('delete'); @@ -18,4 +18,4 @@ edit.deleteAtCaret('var x;'.length); // Pull on the RHS of an import goTo.marker('foo'); -verify.quickInfoIs('module foo'); +verify.quickInfoIs('namespace foo'); diff --git a/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts b/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts index 2c43326469c..77e12476574 100644 --- a/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts +++ b/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts @@ -1,7 +1,7 @@ /// // @Filename: quickInfoDisplayPartsExternalModuleAlias_file0.ts -////export module m1 { +////export namespace m1 { //// export class c { //// } ////} diff --git a/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts b/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts index 070b908d901..1b71cc1f1e0 100644 --- a/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts +++ b/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts @@ -1,14 +1,14 @@ /// -////export module /*1*/m { -//// var /*2*/moduleElemWithoutExport = 10; -//// export var /*3*/moduleElemWithExport = 10; +////export namespace /*1*/m { +//// var /*2*/namespaceElemWithoutExport = 10; +//// export var /*3*/namespaceElemWithExport = 10; ////} ////export var /*4*/a = /*5*/m; ////export var /*6*/b: typeof /*7*/m; -////export module /*8*/m1./*9*/m2 { -//// var /*10*/moduleElemWithoutExport = 10; -//// export var /*11*/moduleElemWithExport = 10; +////export namespace /*8*/m1./*9*/m2 { +//// var /*10*/namespaceElemWithoutExport = 10; +//// export var /*11*/namespaceElemWithExport = 10; ////} ////export var /*12*/x = /*13*/m1./*14*/m2; ////export var /*15*/y: typeof /*16*/m1./*17*/m2; @@ -19,45 +19,45 @@ function goToMarker() { goTo.marker(marker.toString()); } -function verifyModule(name: string, optionalParentName?: string) { +function verifyNamespace(name: string, optionalParentName?: string) { goToMarker(); - var moduleNameDisplay = [{ text: name, kind: "moduleName" }]; + var namespaceNameDisplay = [{ text: name, kind: "moduleName" }]; if (optionalParentName) { - moduleNameDisplay = [{ text: optionalParentName, kind: "moduleName" }, { text: ".", kind: "punctuation" }].concat(moduleNameDisplay); + namespaceNameDisplay = [{ text: optionalParentName, kind: "moduleName" }, { text: ".", kind: "punctuation" }].concat(namespaceNameDisplay); } verify.verifyQuickInfoDisplayParts("module", "export", { start: test.markerByName(marker.toString()).position, length: name.length }, - [{ text: "module", kind: "keyword" }, { text: " ", kind: "space" }].concat(moduleNameDisplay), + [{ text: "namespace", kind: "keyword" }, { text: " ", kind: "space" }].concat(namespaceNameDisplay), []); } function verifyVar(name: string, optionalFullName?: ts.SymbolDisplayPart[], typeDisplay: ts.SymbolDisplayPart[]= [{ text: "number", kind: "keyword" }]) { goToMarker(); - verify.verifyQuickInfoDisplayParts("var", name === "moduleElemWithoutExport" ? "" : "export", { start: test.markerByName(marker.toString()).position, length: name.length }, + verify.verifyQuickInfoDisplayParts("var", name === "namespaceElemWithoutExport" ? "" : "export", { start: test.markerByName(marker.toString()).position, length: name.length }, [{ text: "var", kind: "keyword" }, { text: " ", kind: "space" }].concat(optionalFullName || [{ text: name, kind: "localName" }]).concat( { text: ":", kind: "punctuation" }, { text: " ", kind: "space" }).concat(typeDisplay), []); } -verifyModule("m"); -verifyVar("moduleElemWithoutExport"); -verifyVar("moduleElemWithExport", [{ text: "m", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "moduleElemWithExport", kind: "localName" }]); +verifyNamespace("m"); +verifyVar("namespaceElemWithoutExport"); +verifyVar("namespaceElemWithExport", [{ text: "m", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "namespaceElemWithExport", kind: "localName" }]); verifyVar("a", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m", kind: "moduleName" }]); -verifyModule("m"); +verifyNamespace("m"); verifyVar("b", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m", kind: "moduleName" }]); -verifyModule("m"); +verifyNamespace("m"); -verifyModule("m1"); -verifyModule("m2", "m1"); -verifyVar("moduleElemWithoutExport"); -verifyVar("moduleElemWithExport", [{ text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, - { text: "m2", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "moduleElemWithExport", kind: "localName" }]); +verifyNamespace("m1"); +verifyNamespace("m2", "m1"); +verifyVar("namespaceElemWithoutExport"); +verifyVar("namespaceElemWithExport", [{ text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, + { text: "m2", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "namespaceElemWithExport", kind: "localName" }]); verifyVar("x", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "m2", kind: "moduleName" }]); -verifyModule("m1"); -verifyModule("m2", "m1"); +verifyNamespace("m1"); +verifyNamespace("m2", "m1"); verifyVar("y", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "m2", kind: "moduleName" }]); -verifyModule("m1"); -verifyModule("m2", "m1"); +verifyNamespace("m1"); +verifyNamespace("m2", "m1"); diff --git a/tests/cases/fourslash/quickInfoDisplayPartsModules.ts b/tests/cases/fourslash/quickInfoDisplayPartsModules.ts index aaa415708f4..a6eb0b9ae6b 100644 --- a/tests/cases/fourslash/quickInfoDisplayPartsModules.ts +++ b/tests/cases/fourslash/quickInfoDisplayPartsModules.ts @@ -1,14 +1,14 @@ /// -////module /*1*/m { -//// var /*2*/moduleElemWithoutExport = 10; -//// export var /*3*/moduleElemWithExport = 10; +////namespace /*1*/m { +//// var /*2*/namespaceElemWithoutExport = 10; +//// export var /*3*/namespaceElemWithExport = 10; ////} ////var /*4*/a = /*5*/m; ////var /*6*/b: typeof /*7*/m; -////module /*8*/m1./*9*/m2 { -//// var /*10*/moduleElemWithoutExport = 10; -//// export var /*11*/moduleElemWithExport = 10; +////namespace /*8*/m1./*9*/m2 { +//// var /*10*/namespaceElemWithoutExport = 10; +//// export var /*11*/namespaceElemWithExport = 10; ////} ////var /*12*/x = /*13*/m1./*14*/m2; ////var /*15*/y: typeof /*16*/m1./*17*/m2; @@ -19,14 +19,14 @@ function goToMarker() { goTo.marker(marker.toString()); } -function verifyModule(name: string, optionalParentName?: string) { +function verifyNamespace(name: string, optionalParentName?: string) { goToMarker(); - var moduleNameDisplay = [{ text: name, kind: "moduleName" }]; + var namespaceNameDisplay = [{ text: name, kind: "moduleName" }]; if (optionalParentName) { - moduleNameDisplay = [{ text: optionalParentName, kind: "moduleName" }, { text: ".", kind: "punctuation" }].concat(moduleNameDisplay); + namespaceNameDisplay = [{ text: optionalParentName, kind: "moduleName" }, { text: ".", kind: "punctuation" }].concat(namespaceNameDisplay); } verify.verifyQuickInfoDisplayParts("module", optionalParentName ? "export" : "", { start: test.markerByName(marker.toString()).position, length: name.length }, - [{ text: "module", kind: "keyword" }, { text: " ", kind: "space" }].concat(moduleNameDisplay), + [{ text: "namespace", kind: "keyword" }, { text: " ", kind: "space" }].concat(namespaceNameDisplay), []); } @@ -39,25 +39,25 @@ function verifyVar(name: string, optionalFullName?: ts.SymbolDisplayPart[], type []); } -verifyModule("m"); -verifyVar("moduleElemWithoutExport"); -verifyVar("moduleElemWithExport", [{ text: "m", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "moduleElemWithExport", kind: "localName" }]); +verifyNamespace("m"); +verifyVar("namespaceElemWithoutExport"); +verifyVar("namespaceElemWithExport", [{ text: "m", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "namespaceElemWithExport", kind: "localName" }]); verifyVar("a", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m", kind: "moduleName" }]); -verifyModule("m"); +verifyNamespace("m"); verifyVar("b", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m", kind: "moduleName" }]); -verifyModule("m"); +verifyNamespace("m"); -verifyModule("m1"); -verifyModule("m2", "m1"); -verifyVar("moduleElemWithoutExport"); -verifyVar("moduleElemWithExport", [{ text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, - { text: "m2", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "moduleElemWithExport", kind: "localName" }]); +verifyNamespace("m1"); +verifyNamespace("m2", "m1"); +verifyVar("namespaceElemWithoutExport"); +verifyVar("namespaceElemWithExport", [{ text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, + { text: "m2", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "namespaceElemWithExport", kind: "localName" }]); verifyVar("x", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "m2", kind: "moduleName" }]); -verifyModule("m1"); -verifyModule("m2", "m1"); +verifyNamespace("m1"); +verifyNamespace("m2", "m1"); verifyVar("y", /*optionalFullName*/ undefined, [{ text: "typeof", kind: "keyword" }, { text: " ", kind: "space" }, { text: "m1", kind: "moduleName" }, { text: ".", kind: "punctuation" }, { text: "m2", kind: "moduleName" }]); -verifyModule("m1"); -verifyModule("m2", "m1"); +verifyNamespace("m1"); +verifyNamespace("m2", "m1"); diff --git a/tests/cases/fourslash/server/typedefinition01.ts b/tests/cases/fourslash/server/typedefinition01.ts new file mode 100644 index 00000000000..e7c37747aba --- /dev/null +++ b/tests/cases/fourslash/server/typedefinition01.ts @@ -0,0 +1,12 @@ +/// + +// @Filename: b.ts +////import n = require('a'); +////var x/*1*/ = new n.Foo(); + +// @Filename: a.ts +//// /*2*/export class Foo {} + +goTo.marker('1'); +goTo.type(); +verify.caretAtMarker('2'); \ No newline at end of file diff --git a/tests/cases/fourslash/shims/goToTypeDefinition.ts b/tests/cases/fourslash/shims/goToTypeDefinition.ts new file mode 100644 index 00000000000..6b34e7e4886 --- /dev/null +++ b/tests/cases/fourslash/shims/goToTypeDefinition.ts @@ -0,0 +1,14 @@ +/// + +// @Filename: goToTypeDefinition_Definition.ts +/////*definition*/class C { +//// p; +////} +////var c: C; + +// @Filename: goToTypeDefinition_Consumption.ts +/////*reference*/c = undefined; + +goTo.marker('reference'); +goTo.type(); +verify.caretAtMarker('definition'); diff --git a/tests/cases/unittests/convertToBase64.ts b/tests/cases/unittests/convertToBase64.ts new file mode 100644 index 00000000000..96c082ae789 --- /dev/null +++ b/tests/cases/unittests/convertToBase64.ts @@ -0,0 +1,33 @@ +/// + +module ts { + describe('convertToBase64', () => { + function runTest(input: string): void { + var actual = ts.convertToBase64(input); + var expected = new Buffer(input).toString("base64"); + assert.equal(actual, expected, "Encoded string using convertToBase64 does not match buffer.toString('base64')"); + } + + it("Converts ASCII charaters correctelly", () => { + runTest(" !\"#$ %&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); + }); + + it("Converts escape sequences correctelly", () => { + runTest("\t\n\r\\\"\'\u0062"); + }); + + it("Converts simple unicode characters correctelly", () => { + runTest("ΠΣ ٵپ औठ ⺐⺠"); + }); + + it("Converts simple code snippit correctelly", () => { + runTest(`/// +var x: string = "string"; +console.log(x);`); + }); + + it("Converts simple code snippit with unicode characters correctelly", () => { + runTest(`var Π = 3.1415; console.log(Π);`); + }); + }); +}